zoukankan      html  css  js  c++  java
  • 手机探索者开发实录—MobileExplorer接口

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

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

    MobileExplorer接口是手机探索者(mobile explorer)的一个重要部件,它提供了对手机操作的基本抽象:
    1. typedef MeRet (*MobileExplorerGetTypeInfoFunc)(MobileExplorer* thiz, MeType* type);
    2. typedef MeRet (*MobileExplorerGetDeviceInfoFunc)(MobileExplorer* thiz, MeDeviceInfo* info);
    3. typedef MeRet (*MobileExplorerAuthFunc)(MobileExplorer* thiz, const char* user, const char* passwd);
    4. typedef MeRet (*MobileExplorerDelObjectsFunc)(MobileExplorer* thiz, MePath* path);
    5. typedef MeRet (*MobileExplorerAddObjectsFunc)(MobileExplorer* thiz, MeObjects* objs);
    6. typedef MeRet (*MobileExplorerUpdateObjectsFunc)(MobileExplorer* thiz, MeObjects* objs);
    7. typedef MeRet (*MobileExplorerGetObjectsFunc)(MobileExplorer* thiz, MePath* path, MeObjects* hdrs);
    8. typedef MeRet (*MobileExplorerGetObjectsHdrFunc)(MobileExplorer* thiz, MePath* path, MeObjectsHdr* h
    9. drs);
    10. typedef MeRet (*MobileExplorerIMECommitFunc)(MobileExplorer* thiz, const char* text);
    11. typedef MeRet (*MobileExplorerClipboardSetDataFunc)(MobileExplorer* thiz, MeData* data);
    12. typedef MeRet (*MobileExplorerClipboardGetDataFunc)(MobileExplorer* thiz, MeData* data);
    13. typedef MeRet (*MobileExplorerRegListenerFunc)(MobileExplorer* thiz, MobileExplorerEvent* listener);
    14. typedef MeRet (*MobileExplorerDestroyFunc)(MobileExplorer* thiz);
    15. struct _MobileExplorer
    16. {
    17.     MobileExplorerGetTypeInfoFunc get_type_info;
    18.     MobileExplorerGetDeviceInfoFunc get_device_info;
    19.     MobileExplorerAuthFunc auth;
    20.     MobileExplorerDelObjectsFunc del_objects;
    21.     MobileExplorerAddObjectsFunc add_objects;
    22.     MobileExplorerUpdateObjectsFunc update_objects;
    23.     MobileExplorerGetObjectsFunc get_objects;
    24.     MobileExplorerGetObjectsHdrFunc get_objectshdr;
    25.     MobileExplorerIMECommitFunc ime_commit;
    26.     MobileExplorerClipboardSetDataFunc clipboard_set_data;
    27.     MobileExplorerClipboardGetDataFunc clipboard_get_data;
    28.     MobileExplorerRegListenerFunc reg_listener;
    29.     MobileExplorerDestroyFunc destroy;
    30.     char priv[0];
    31. };

    1. get_type_info 数据类型(包括mimetype)是以整数类型传递,如果需要更多关于某个类型的信息,需要调用这个函数得到指定类型的详细信息。
    2. get_device_info 用于查询设备信息,包括版本号,硬件配置,和对MobileExplorer接口的支持。
    3. auth 鉴权,目前的功能相当于login。
    4. del_objects 删除对象,对象包括文件对象和数据库对象,这里MePath是对象的标识,MePath可以代表单个对象,也可以代表一个对象集合。
    5. add_objects 向手机中增加对象。
    6. update_objects 更新手机中已有的对象。
    7. get_objects 获取指定的对象。
    8. get_objectshdr 获取指定对象的信息,不包括对象的数据。
    9. ime_commit PC输入法向手机提交字符串。
    10. clipboard_set_data 设置手机剪切板中的数据。
    11. clipboard_get_data 获取手机剪切板中的数据。
    12. reg_listener 注册手机中的事件,事件包括来电,新短信,新邮件,新彩信,提醒,剪切板类型变化,电量变化,睡眠和唤醒等等。
    13. destroy 销毁对象。
    ~~end~~


  • 相关阅读:
    不务正业系列-浅谈《过气堡垒》,一个RTS玩家的视角
    [LeetCode] 54. Spiral Matrix
    [LeetCode] 40. Combination Sum II
    138. Copy List with Random Pointer
    310. Minimum Height Trees
    4. Median of Two Sorted Arrays
    153. Find Minimum in Rotated Sorted Array
    33. Search in Rotated Sorted Array
    35. Search Insert Position
    278. First Bad Version
  • 原文地址:https://www.cnblogs.com/zhangyunlin/p/6167628.html
Copyright © 2011-2022 走看看