src/include/common/examples/TestSyncSource.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_SOURCE
00020 #define INCL_TEST_SYNC_SOURCE
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  TestSyncSource : public SyncSource {
00031 
00032 public:
00033 
00040     TestSyncSource(const WCHAR* name, SyncSourceConfig *sc)  EXTRA_SECTION_01;
00041 
00042     // TestSyncSource
00043     ~TestSyncSource() 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     SyncItem* getFirstItemKey() EXTRA_SECTION_01;
00095 
00096     /*
00097      * Return the key of the next SyncItem of all.
00098      * It is used in case of refresh sync
00099      * and retrieve all the keys of the data source.
00100      */
00101     SyncItem* getNextItemKey() EXTRA_SECTION_01;
00102 
00103 
00104     SyncItem* getNextDeletedItem() EXTRA_SECTION_01;
00105 
00106     void setItemStatus(const WCHAR* key, int status) EXTRA_SECTION_01;
00107 
00108     int addItem(SyncItem& item) EXTRA_SECTION_01;
00109 
00110     int updateItem(SyncItem& item) EXTRA_SECTION_01;
00111 
00112     int deleteItem(SyncItem& item) EXTRA_SECTION_01;
00113 
00114     int beginSync() EXTRA_SECTION_01;
00115 
00116     int endSync() EXTRA_SECTION_01;
00117 
00118     ArrayElement* clone() { return 0; }
00119 };
00120 
00122 #endif

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