src/include/windows/vocl/WinItem.h

00001  /*
00002  * Copyright (C) 2007 Funambol, Inc.
00003  *
00004  * This program is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License version 2 as
00006  * published by the Free Software Foundation.
00007  *
00008  * This program is distributed in the hope that it will be useful,
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  * MERCHANTABILITY, TITLE, NONINFRINGEMENT or FITNESS FOR A PARTICULAR
00011  * PURPOSE.  See the GNU General Public License for more details.
00012  *
00013  * You should have received a copy of the GNU General Public License
00014  * along with this program; if not, write to the Free Software
00015  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00016  * 02111-1307  USA
00017 */
00018 
00019 #ifndef INCL_WINITEM
00020 #define INCL_WINITEM
00021 
00027 #include "base/fscapi.h"
00028 #include "base/Log.h"
00029 #include <string>
00030 #include <list>
00031 #include <map>
00032 
00033 using namespace std;
00034 
00035 
00036 // Versions supported:
00037 #define VCARD_VERSION                       L"2.1"
00038 #define VCALENDAR_VERSION                   L"1.0"
00039 
00040 // Error messages:
00041 #define ERR_ITEM_VOBJ_PARSE                 "VConverter: error occurred parsing the item data."
00042 #define ERR_ITEM_VOBJ_WRONG_TYPE            "Error: wrong vobject type \"%ls\" (\"%ls\" expected)"
00043 #define ERR_ITEM_VOBJ_TYPE_NOTFOUND         "Error: vobject type not specified (\"%ls\" expected)"
00044 #define INFO_ITEM_VOBJ_WRONG_VERSION        "Warning! Wrong vobject version \"%ls\" (\"%ls\" expected)"
00045 #define INFO_ITEM_VOBJ_VERSION_NOTFOUND     "Warning! VObject version not specified (\"%ls\" expected)"
00046 
00047 
00055 class WinItem {
00056 
00057 private:
00058     static wstring badString;
00059 
00060 
00061 public:
00062     
00071     map<wstring,wstring> propertyMap;
00072 
00074     WinItem();
00075 
00077     virtual ~WinItem();
00078 
00079 
00081     int getPropertyMapSize();
00082 
00083 
00091     void setProperty(const wstring propertyName, const wstring propertyValue);
00092 
00102     bool getProperty(const wstring propertyName, wstring& propertyValue);
00103 
00115     wstring& getPropertyRef(const wstring propertyName, bool* found);
00116 
00117     void removeElement(wstring key);
00118 
00120     void resetPropertyMap();
00121 
00123     void resetAllValues();
00124 
00129     long getCRC();
00130 };
00131 
00134 #endif

Generated on Fri Nov 9 12:21:26 2007 for Funambol Outlook Plug-in Library by  doxygen 1.5.2