00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef INCL_VIRTUAL_PROPERTY
00038 #define INCL_VIRTUAL_PROPERTY
00039
00041 #include "base/fscapi.h"
00042 #include "base/util/WKeyValuePair.h"
00043 #include "base/util/ArrayList.h"
00044
00045
00046
00047 #define QP_MAX_LINE_LEN 70
00048 #define VCARD_MAX_LINE_LEN 76
00049
00050
00051
00052 #define VCARD21_SPECIAL_CHARS TEXT(";\\")
00053 #define VCARD30_SPECIAL_CHARS TEXT(";\\,")
00054 #define RFC822_LINE_BREAK TEXT("\r\n")
00055 #include "base/globalsdef.h"
00056
00057 BEGIN_NAMESPACE
00058
00059
00060
00061 WCHAR* escapeSpecialChars(const WCHAR* inputString, WCHAR* version);
00062 char* convertToQP(const char* input, int start);
00063 bool encodingIsNeed(const char *in);
00064 WCHAR* folding(const WCHAR* inputString, const int maxLine);
00065 WCHAR* unfolding(const WCHAR* inputString);
00066
00067
00068
00069
00070
00071 class VProperty : public ArrayElement {
00072
00073 private:
00074
00075 WCHAR* name;
00076 void set(WCHAR** p, const WCHAR* v);
00077
00078 ArrayList* parameters;
00079 ArrayList* values;
00080
00081
00082 WCHAR* valueBuf;
00083
00084 public:
00085
00086 VProperty(const WCHAR* propName , const WCHAR* propValue = NULL);
00087 ~VProperty();
00088 ArrayElement* clone();
00089 void setName (const WCHAR* name);
00090 WCHAR* getName(WCHAR* buf = NULL, int size = -1);
00091
00092 void addValue(const WCHAR* value);
00093 bool removeValue(const int index);
00094 WCHAR* getValue(int index);
00095 int valueCount();
00096
00097
00098 WCHAR* getValue(WCHAR* buf = NULL);
00099 void setValue (const WCHAR* value);
00100 WCHAR* getPropComponent(int i);
00101
00102 void addParameter(const WCHAR* paramName, const WCHAR* paramValue);
00103 void removeParameter(const WCHAR* paramName);
00104 bool containsParameter(const WCHAR* paramName);
00105
00106
00107
00108
00109 WCHAR* getParameterValue(const WCHAR* paramName);
00110 WCHAR* getParameterValue(int index);
00111 WCHAR* getParameter(int index);
00112 int parameterCount();
00113 bool equalsEncoding(const WCHAR* encoding);
00114
00115 bool isType(const WCHAR* type);
00116 WCHAR* toString(WCHAR* version = NULL);
00117
00118 };
00119
00120
00121 END_NAMESPACE
00122
00124 #endif