分类: C/C++
2009-04-23 10:21:24
/********************此文可以被转发,但请转发者保留作者的署名权
****李浩
****msn:lihao_nx@hotmail.com
****
****email:lihaoyxj@gmail.com
****出处:lihaoyxj.cublog.cn
*******************************************************/
在以上篇幅中介绍了开源库FUNAMBOL,本节中介绍一下,使用funambol的client api。
funambol的客户端在有相关
的安装包下载,它包含了windows,windows mobile,black berry,所有支支持j2me的平台下的客户端。
笔者在进行基于symbian部分客户端开发时,funambol还没有提供 symbian的源码。故在对funambol windows mobile的源码进行了分析,以funambol c++ api开发出了symbian的SYNCML客户端。
笔者认为,开发基于funambol client api最主要的类为二个:DMTClientConfig用于配置同步项;SyncSourc用于同步在前边所配置的同步项。
DMTClientConfig在这里就不进行过多介绍。
由于SyncSource类为虚类,那么在你的客户端中就要去实现它的相关方法,方法清单如下:
SyncItem* getFirstItem();
/*
* Return the next SyncItem of all.
* It is used in case of slow or refresh sync
* and retrieve the entire data source content.
*/
SyncItem* getNextItem();
/*
* Return the first SyncItem of new one. It is used in case of fast sync
* and retrieve the new data source content.
*/
SyncItem* getFirstNewItem();
/*
* Return the next SyncItem of new one. It is used in case of fast sync
* and retrieve the new data source content.
*/
SyncItem* getNextNewItem();
/*
* Return the first SyncItem of updated one. It is used in case of fast sync
* and retrieve the new data source content.
*/
SyncItem* getFirstUpdatedItem() ;
/*
* Return the next SyncItem of updated one. It is used in case of fast sync
* and retrieve the new data source content.
*/
SyncItem* getNextUpdatedItem();
/*
* Return the first SyncItem of updated one. It is used in case of fast sync
* and retrieve the new data source content.
*/
SyncItem* getFirstDeletedItem();
/*
* Return the next SyncItem of updated one. It is used in case of fast sync
* and retrieve the new data source content.
*/
SyncItem* getFirstItemKey();
/*
* Return the key of the next SyncItem of all.
* It is used in case of refresh sync
* and retrieve all the keys of the data source.
*/
SyncItem* getNextItemKey();
SyncItem* getNextDeletedItem();
void setItemStatus(const WCHAR* key, int status);
int addItem(SyncItem& item);
int updateItem(SyncItem& item);
int deleteItem(SyncItem& item);
int removeAllItems(); //Not implemented
int beginSync();
int endSync();
只要实现了这些方法,那么意味着你的客户端实现了