src/include/common/examples/TestSyncSource2.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 #ifndef INCL_TEST_SYNC_SOURCE2
00020 #define INCL_TEST_SYNC_SOURCE2
00021 
00023 #include "base/fscapi.h"
00024 #include "spds/constants.h"
00025 #include "spds/SyncItem.h"
00026 #include "spds/SyncMap.h"
00027 #include "spds/SyncStatus.h"
00028 #include "spds/SyncSource.h"
00029 
00030 class TestSyncSource2 : public SyncSource {
00031 
00032 public:
00033 
00040     TestSyncSource2(const WCHAR* name, SyncSourceConfig *sc);
00041 
00042     // TestSyncSource
00043     ~TestSyncSource2();
00044 
00045     /*
00046      * Return the first SyncItem of all.
00047      * It is used in case of slow or refresh sync
00048      * and retrieve the entire data source content.
00049      */
00050     SyncItem* getFirstItem();
00051 
00052     /*
00053      * Return the next SyncItem of all.
00054      * It is used in case of slow or refresh sync
00055      * and retrieve the entire data source content.
00056      */
00057     SyncItem* getNextItem();
00058 
00059     /*
00060      * Return the first SyncItem of new one. It is used in case of fast sync
00061      * and retrieve the new data source content.
00062      */
00063     SyncItem* getFirstNewItem();
00064 
00065     /*
00066      * Return the next SyncItem of new one. It is used in case of fast sync
00067      * and retrieve the new data source content.
00068      */
00069     SyncItem* getNextNewItem();
00070 
00071     /*
00072      * Return the first SyncItem of updated one. It is used in case of fast sync
00073      * and retrieve the new data source content.
00074      */
00075     SyncItem* getFirstUpdatedItem() ;
00076 
00077     /*
00078      * Return the next SyncItem of updated one. It is used in case of fast sync
00079      * and retrieve the new data source content.
00080      */
00081     SyncItem* getNextUpdatedItem();
00082 
00083     /*
00084      * Return the first SyncItem of updated one. It is used in case of fast sync
00085      * and retrieve the new data source content.
00086      */
00087     SyncItem* getFirstDeletedItem();
00088 
00089     /*
00090      * Return the next SyncItem of updated one. It is used in case of fast sync
00091      * and retrieve the new data source content.
00092      */
00093      /*
00094      * Return the next SyncItem of updated one. It is used in case of fast sync
00095      * and retrieve the new data source content.
00096      */
00097 
00098     SyncItem* getFirstItemKey();
00099 
00100     /*
00101      * Return the key of the next SyncItem of all.
00102      * It is used in case of refresh sync
00103      * and retrieve all the keys of the data source.
00104      */
00105     SyncItem* getNextItemKey();
00106 
00107     SyncItem* getNextDeletedItem();
00108 
00109     void setItemStatus(const WCHAR* key, int status);
00110 
00111     int addItem(SyncItem& item);
00112 
00113     int updateItem(SyncItem& item);
00114 
00115     int deleteItem(SyncItem& item);
00116 
00117     int beginSync();
00118 
00119     int endSync();
00120 
00121     ArrayElement* clone() { return 0; }
00122 };
00123 
00125 #endif

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