src/include/common/examples/TestSyncSource2.h

00001 /*
00002  * Copyright (C) 2003-2007 Funambol
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 as published by
00006  * the Free Software Foundation; either version 2 of the License, or
00007  * (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  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) EXTRA_SECTION_01;
00041 
00042     // TestSyncSource
00043     ~TestSyncSource2() EXTRA_SECTION_01;
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() EXTRA_SECTION_01;
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() EXTRA_SECTION_01;
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() EXTRA_SECTION_01;
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() EXTRA_SECTION_01;
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()  EXTRA_SECTION_01;
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() EXTRA_SECTION_01;
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() EXTRA_SECTION_01;
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() EXTRA_SECTION_01;
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() EXTRA_SECTION_01;
00106 
00107     SyncItem* getNextDeletedItem() EXTRA_SECTION_01;
00108     
00109     void setItemStatus(const WCHAR* key, int status) EXTRA_SECTION_01;
00110     
00111     int addItem(SyncItem& item) EXTRA_SECTION_01;
00112    
00113     int updateItem(SyncItem& item) EXTRA_SECTION_01;
00114 
00115     int deleteItem(SyncItem& item) EXTRA_SECTION_01;
00116     
00117     int beginSync() EXTRA_SECTION_01;
00118     
00119     int endSync() EXTRA_SECTION_01;
00120 
00121     ArrayElement* clone() { return 0; }
00122 };
00123 
00125 #endif

Generated on Fri Apr 27 12:29:18 2007 for Funambol C++ Client Library by  doxygen 1.5.2