src/include/common/vocl/vCard/Contact.h

00001 /*
00002  * Copyright (C) 2003-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 
00020 #ifndef INCL_PIM_CONTACT
00021 #define INCL_PIM_CONTACT
00022 
00024 #include "base/fscapi.h"
00025 #include "base/util/ArrayList.h"
00026 #include "vocl/VObject.h"
00027 #include "vocl/vCard/BusinessDetail.h"
00028 #include "vocl/vCard/Name.h"
00029 #include "vocl/vCard/Note.h"
00030 #include "vocl/vCard/Title.h"
00031 #include "vocl/vCard/PersonalDetail.h"
00032 #include "vocl/vCard/Phone.h"
00033 #include "vocl/vCard/Email.h"
00034 #include "vocl/vCard/WebPage.h"
00035 
00036 #define MAX_TITLES          10
00037 #define MAX_VPROPERTY_VALUE 200
00038 #define BUSINESS            0
00039 #define HOME                1
00040 #define OTHER               2
00041 
00042 class Contact : public VObject {
00043 
00044     // ------------------------------------------------------------ Private data
00045 
00046     private:
00047         Name* name;
00048         PersonalDetail* personalDetail;
00049         BusinessDetail* businessDetail;
00050         ArrayList* notes;
00051 
00061         void set(WCHAR** p, WCHAR* v);
00062         vCardProperty* getPropertyFromVProperty(VProperty* vp);
00063         VProperty* getVPropertyFromProperty(WCHAR* name, vCardProperty* prop);
00064         VProperty* composeVAddress(Address* adr);
00065         Address* composeAddress(VProperty* vp, int type);
00066         Address* addLabelAddress(VProperty* vp, int type);
00067 
00068     //--------------------------------------------- Constructors and Destructors
00069 
00070     public:
00071         Contact();
00072         ~Contact();
00073 
00074     // ---------------------------------------------------------- Public methods
00075 
00081         WCHAR* getUID(WCHAR* buf = NULL, int size = -1);
00082 
00091         WCHAR* getTimezone (WCHAR* buf = NULL, int size = -1);
00092 
00098         ArrayList* getNotes();
00099 
00104         void setNotes(ArrayList& list);
00105 
00114         WCHAR* getRevision(WCHAR* buf = NULL, int size = -1);
00115 
00121         Name* getName();
00122 
00127         void setName(Name& n);
00128 
00134         BusinessDetail* getBusinessDetail ();
00135 
00140         void setBusinessDetail(BusinessDetail& d);
00141 
00147         PersonalDetail* getPersonalDetail();
00148 
00153         void setPersonalDetail(PersonalDetail& d);
00154 
00160         void setUID (WCHAR* uid);
00161 
00167         void setTimezone (WCHAR* tz);
00168 
00174         void setRevision (WCHAR* revision);
00175 
00176         Contact* clone();
00177         WCHAR* toString();
00178 };
00179 
00181 #endif

Generated on Fri Jun 15 11:38:30 2007 for Funambol C++ Client Library by  doxygen 1.5.2