00001
00020 #ifndef INCL_VIRTUAL_PROPERTY
00021 #define INCL_VIRTUAL_PROPERTY
00022
00024 #include "base/fscapi.h"
00025 #include "base/util/WKeyValuePair.h"
00026 #include "base/util/ArrayList.h"
00027
00028
00029
00030 #define QP_MAX_LINE_LEN 70
00031 #define VCARD_MAX_LINE_LEN 76
00032
00033
00034
00035 #define VCARD21_SPECIAL_CHARS TEXT(";\\")
00036 #define VCARD30_SPECIAL_CHARS TEXT(";\\,")
00037 #define RFC822_LINE_BREAK TEXT("\r\n")
00038
00039
00040
00041 WCHAR* escapeSpecialChars(const WCHAR* inputString, WCHAR* version);
00042 char* convertToQP(const char* input, int start);
00043 bool encodingIsNeed(const char *in);
00044 WCHAR* folding(const WCHAR* inputString, const int maxLine);
00045 WCHAR* unfolding(const WCHAR* inputString);
00046
00047
00048
00049
00050
00051 class VProperty : public ArrayElement {
00052
00053 private:
00054
00055 WCHAR* name;
00056 void set(WCHAR** p, const WCHAR* v);
00057
00058 ArrayList* parameters;
00059 ArrayList* values;
00060
00061
00062 WCHAR* valueBuf;
00063
00064 public:
00065
00066 VProperty(const WCHAR* propName , const WCHAR* propValue = NULL);
00067 ~VProperty();
00068 ArrayElement* clone();
00069 void setName (const WCHAR* name);
00070 WCHAR* getName(WCHAR* buf = NULL, int size = -1);
00071
00072 void addValue(const WCHAR* value);
00073 bool removeValue(const int index);
00074 WCHAR* getValue(int index);
00075 int valueCount();
00076
00077
00078 WCHAR* getValue(WCHAR* buf = NULL);
00079 void setValue (const WCHAR* value);
00080 WCHAR* getPropComponent(int i);
00081
00082 void addParameter(const WCHAR* paramName, const WCHAR* paramValue);
00083 void removeParameter(WCHAR* paramName);
00084 bool containsParameter(WCHAR* paramName);
00085
00086
00087
00088
00089 WCHAR* getParameterValue(WCHAR* paramName);
00090 WCHAR* getParameterValue(int index);
00091 WCHAR* getParameter(int index);
00092 int parameterCount();
00093 bool equalsEncoding(WCHAR* encoding);
00094
00095 bool isType(WCHAR* type);
00096 WCHAR* toString(WCHAR* version = NULL);
00097
00098 };
00099
00101 #endif