D:/develop/v65/clients/outlook/install/output/export/funambol/clients/outlook/mainclientDll/src/include/outlook/ClientRecurrence.h

00001 /*
00002  * Funambol is a mobile platform developed by Funambol, Inc. 
00003  * Copyright (C) 2003 - 2007 Funambol, Inc.
00004  * 
00005  * This program is free software; you can redistribute it and/or modify it under
00006  * the terms of the GNU Affero General Public License version 3 as published by
00007  * the Free Software Foundation with the addition of the following permission 
00008  * added to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED
00009  * WORK IN WHICH THE COPYRIGHT IS OWNED BY FUNAMBOL, FUNAMBOL DISCLAIMS THE 
00010  * WARRANTY OF NON INFRINGEMENT  OF THIRD PARTY RIGHTS.
00011  * 
00012  * This program is distributed in the hope that it will be useful, but WITHOUT
00013  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00014  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
00015  * details.
00016  * 
00017  * You should have received a copy of the GNU Affero General Public License 
00018  * along with this program; if not, see http://www.gnu.org/licenses or write to
00019  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00020  * MA 02110-1301 USA.
00021  * 
00022  * You can contact Funambol, Inc. headquarters at 643 Bair Island Road, Suite 
00023  * 305, Redwood City, CA 94063, USA, or at email address info@funambol.com.
00024  * 
00025  * The interactive user interfaces in modified source and object code versions
00026  * of this program must display Appropriate Legal Notices, as required under
00027  * Section 5 of the GNU Affero General Public License version 3.
00028  * 
00029  * In accordance with Section 7(b) of the GNU Affero General Public License
00030  * version 3, these Appropriate Legal Notices must retain the display of the
00031  * "Powered by Funambol" logo. If the display of the logo is not reasonably 
00032  * feasible for technical reasons, the Appropriate Legal Notices must display
00033  * the words "Powered by Funambol".
00034  */
00035 
00036 #ifndef INCL_CLIENTRECURRENCE
00037 #define INCL_CLIENTRECURRENCE
00038 
00043 #include "outlook/defs.h"
00044 #include "outlook/ClientAppException.h"
00045 
00046 #include <string>
00047 #include <list>
00048 
00049 typedef std::list<ClientAppException>     exceptionList;
00050 typedef exceptionList::iterator           exceptionIterator;
00051 
00052 
00070 class ClientRecurrence {
00071 
00072 private:
00073 
00074     // Rec properties:
00075     int          recurrenceType;
00076     int          interval;
00077     int          monthOfYear;
00078     int          dayOfMonth;
00079     int          dayOfWeekMask;
00080     int          instance;
00081     std::wstring patternStartDate;
00082     BOOL         noEndDate;
00083     std::wstring patternEndDate;
00084     int          occurrences;
00085 
00086     std::wstring start;             
00087     BOOL      isAllDay;             
00090 
00091     RecurrencePatternPtr  pRec;
00092 
00094     exceptionList appExceptions;
00095 
00096 
00100     bool recurring;
00101 
00105     bool isUpdated;
00106 
00108     int numRecursions;
00109 
00110 
00111 
00113     void checkIfRecIsCorrect();
00114 
00116     bool changeDay(const std::wstring dest);
00117 
00118 
00119     //
00120     // Internal methods to manage exceptions.
00121     //
00123     ClientAppException* getExceptionOnClient(const int index);
00124     const int           getExceptionsCountOnClient();
00125     int                 saveException(ClientAppException* cException);
00126     //void              freeDestinationDays(const DATE startDate, const DATE originalDate);
00127     //int               safeSaveException(ClientAppException* cException);
00128 
00129 public:
00130 
00132     ClientRecurrence();
00133 
00135     ~ClientRecurrence();
00136 
00138     void setCOMPtr(RecurrencePatternPtr& ptr);
00139 
00140 
00141 
00148     int read();
00149 
00158     int save();
00159 
00160 
00161 
00163     bool isRecurring();
00164 
00167     void setRecurrence();
00168 
00171     void clearRecurrence();
00172 
00173 
00174 
00175     //
00176     // Methods to get recurrence properties.
00177     // -------------------------------------
00178     // The first time a property is needed (isUpdated = false), all values 
00179     // are retrieved from Outlook calling 'read()'.
00180     //
00181     const int           getRecurrenceType  ();
00182     const int           getInterval        ();
00183     const int           getMonthOfYear     ();
00184     const int           getDayOfMonth      ();
00185     const int           getDayOfWeekMask   ();
00186     const int           getInstance        ();
00187     const std::wstring& getPatternStartDate();
00188     const BOOL          getNoEndDate       ();
00189     const std::wstring& getPatternEndDate  ();
00190     const int           getOccurrences     ();
00191 
00192     // Get property value (wstring) from its name.
00193     const std::wstring getProperty(const std::wstring& propertyName);
00194 
00195 
00196     //
00197     // Methods to set recurrence properties.
00198     // -------------------------------------
00199     // Values passed are stored in internal members, calling 'save()' all properties 
00200     // are put together into Outlook rec pattern (this is for UTC transformations).
00201     // No test on value content is done at this level.
00202     // 'isUpdated' is set to false, cause setting a property the rec pattern is no
00203     // more updated with Outlook.
00204     //
00205     void setRecurrenceType  (const int           val);
00206     void setInterval        (const int           val);
00207     void setMonthOfYear     (const int           val);
00208     void setDayOfMonth      (const int           val);
00209     void setDayOfWeekMask   (const int           val);
00210     void setInstance        (const int           val);
00211     void setPatternStartDate(const std::wstring& val);
00212     void setNoEndDate       (const BOOL          val);
00213     void setPatternEndDate  (const std::wstring& val);
00214     void setOccurrences     (const int           val);
00215 
00217     void setStart           (const std::wstring& val);
00218     void setIsAllDay        (const BOOL          val);
00219 
00220     // Set property value from its name: set internal object values.
00221     int setProperty(const std::wstring& propertyName, const std::wstring& propertyValue);
00222 
00223 
00224 
00225     //
00226     // To manage appointment exceptions.
00227     //
00228     ClientAppException* getException(const int index);
00229     const int           getExceptionsCount();
00230     int                 addException(ClientAppException* cException);
00231     void                resetExceptions();
00232     int                 saveAllExceptions();
00233     int                 removeDuplicatedExceptions();
00234 
00235     _AppointmentItemPtr getOccurrence(const DATE originalDate);
00236 
00237 };
00238 
00241 #endif

Generated on Mon Feb 4 09:50:49 2008 for Funambol Outlook Plug-in Library by  doxygen 1.5.2