您的位置:首页 > 其它

手机探索者开发实录—MobileExplorer接口

2008-08-20 20:50 169 查看
手机探索者开发实录—MobileExplorer接口

转载时请注明出处和作者联系方式
作者联系方式:李先静 <xianjimli at hotmail dot com>

MobileExplorer接口是手机探索者(mobile explorer)的一个重要部件,它提供了对手机操作的基本抽象:

typedef MeRet (*MobileExplorerGetTypeInfoFunc)(MobileExplorer* thiz, MeType* type);
typedef MeRet (*MobileExplorerGetDeviceInfoFunc)(MobileExplorer* thiz, MeDeviceInfo* info);
typedef MeRet (*MobileExplorerAuthFunc)(MobileExplorer* thiz, const char* user, const char* passwd);
typedef MeRet (*MobileExplorerDelObjectsFunc)(MobileExplorer* thiz, MePath* path);
typedef MeRet (*MobileExplorerAddObjectsFunc)(MobileExplorer* thiz, MeObjects* objs);
typedef MeRet (*MobileExplorerUpdateObjectsFunc)(MobileExplorer* thiz, MeObjects* objs);
typedef MeRet (*MobileExplorerGetObjectsFunc)(MobileExplorer* thiz, MePath* path, MeObjects* hdrs);
typedef MeRet (*MobileExplorerGetObjectsHdrFunc)(MobileExplorer* thiz, MePath* path, MeObjectsHdr* h
drs);
typedef MeRet (*MobileExplorerIMECommitFunc)(MobileExplorer* thiz, const char* text);
typedef MeRet (*MobileExplorerClipboardSetDataFunc)(MobileExplorer* thiz, MeData* data);
typedef MeRet (*MobileExplorerClipboardGetDataFunc)(MobileExplorer* thiz, MeData* data);
typedef MeRet (*MobileExplorerRegListenerFunc)(MobileExplorer* thiz, MobileExplorerEvent* listener);
typedef MeRet (*MobileExplorerDestroyFunc)(MobileExplorer* thiz);

struct _MobileExplorer
{
MobileExplorerGetTypeInfoFunc get_type_info;
MobileExplorerGetDeviceInfoFunc get_device_info;
MobileExplorerAuthFunc auth;
MobileExplorerDelObjectsFunc del_objects;
MobileExplorerAddObjectsFunc add_objects;
MobileExplorerUpdateObjectsFunc update_objects;
MobileExplorerGetObjectsFunc get_objects;
MobileExplorerGetObjectsHdrFunc get_objectshdr;
MobileExplorerIMECommitFunc ime_commit;
MobileExplorerClipboardSetDataFunc clipboard_set_data;
MobileExplorerClipboardGetDataFunc clipboard_get_data;
MobileExplorerRegListenerFunc reg_listener;
MobileExplorerDestroyFunc destroy;

char priv[0];
};

get_type_info 数据类型(包括mimetype)是以整数类型传递,如果需要更多关于某个类型的信息,需要调用这个函数得到指定类型的详细信息。
get_device_info 用于查询设备信息,包括版本号,硬件配置,和对MobileExplorer接口的支持。
auth 鉴权,目前的功能相当于login。
del_objects 删除对象,对象包括文件对象和数据库对象,这里MePath是对象的标识,MePath可以代表单个对象,也可以代表一个对象集合。
add_objects 向手机中增加对象。
update_objects 更新手机中已有的对象。
get_objects 获取指定的对象。
get_objectshdr 获取指定对象的信息,不包括对象的数据。
ime_commit PC输入法向手机提交字符串。
clipboard_set_data 设置手机剪切板中的数据。
clipboard_get_data 获取手机剪切板中的数据。
reg_listener 注册手机中的事件,事件包括来电,新短信,新邮件,新彩信,提醒,剪切板类型变化,电量变化,睡眠和唤醒等等。
destroy 销毁对象。
~~end~~
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: