diff options
author | zheng_wenlong <wenlong_zheng@nexty-ele.com> | 2018-06-18 12:05:51 +0900 |
---|---|---|
committer | zheng_wenlong <wenlong_zheng@nexty-ele.com> | 2018-06-18 12:06:31 +0900 |
commit | 5716a8eebad5e503f2c73c382ba2a6fa9e101bc6 (patch) | |
tree | c16b893f7d95c0f9e29dff4a85c2bd4647eae150 /src/qlibhomescreen.cpp | |
parent | 8e55c3740ec7576ba08692572b28719404c77f66 (diff) |
Add comments for qlibhomescreen api
Add some comments for qlibhomescreen api.
Change-Id: I97f09d8c3f2a743e8ca1443b93f6625913475f5b
Signed-off-by: zheng_wenlong <wenlong_zheng@nexty-ele.com>
Diffstat (limited to 'src/qlibhomescreen.cpp')
-rw-r--r-- | src/qlibhomescreen.cpp | 84 |
1 files changed, 82 insertions, 2 deletions
diff --git a/src/qlibhomescreen.cpp b/src/qlibhomescreen.cpp index b9298f1..248dd72 100644 --- a/src/qlibhomescreen.cpp +++ b/src/qlibhomescreen.cpp @@ -30,7 +30,16 @@ using namespace std; static QLibHomeScreen* myThis; // Note: qlibhomescreen will be integrated to libqtappfw - +/** + * QLibHomeScreen construction function + * + * #### Parameters + * - parent [in] : object parent. + * + * #### Return + * - None + * + */ QLibHomeScreen::QLibHomeScreen(QObject *parent) : QObject(parent), mp_hs(NULL) @@ -38,6 +47,16 @@ QLibHomeScreen::QLibHomeScreen(QObject *parent) : } +/** + * QLibHomeScreen destruction function + * + * #### Parameters + * - None + * + * #### Return + * - None + * + */ QLibHomeScreen::~QLibHomeScreen() { if (mp_hs != NULL) { @@ -45,6 +64,19 @@ QLibHomeScreen::~QLibHomeScreen() } } +/** + * init function + * + * call libhomescreen init function to connect to binder by websocket + * + * #### Parameters + * - prot : port from application + * - token : token from application + * + * #### Return + * - None + * + */ void QLibHomeScreen::init(int port, const QString &token) { string ctoken = token.toStdString(); @@ -54,26 +86,74 @@ void QLibHomeScreen::init(int port, const QString &token) myThis = this; } + +/** + * call on screen message + * + * use libhomescreen api to call onscreen message + * + * #### Parameters + * - message : message contents + * + * #### Return + * - Returns 0 on success or -1 in case of error. + * + */ int QLibHomeScreen::onScreenMessage(const QString &message) { string str = message.toStdString(); return mp_hs->onScreenMessage(str.c_str()); } +/** + * subscribe event + * + * use libhomescreen api to subscribe homescreen event + * + * #### Parameters + * - evetNave : homescreen event name + * + * #### Return + * - Returns 0 on success or -1 in case of error. + * + */ int QLibHomeScreen::subscribe(const QString &evetName) { string str = evetName.toStdString(); return mp_hs->subscribe(str); } +/** + * unsubscribe event + * + * use libhomescreen api to unsubscribe homescreen event + * + * #### Parameters + * - evetNave : homescreen event name + * + * #### Return + * - Returns 0 on success or -1 in case of error. + * + */ int QLibHomeScreen::unsubscribe(const QString &evetName) { string str = evetName.toStdString(); return mp_hs->unsubscribe(str); } +/** + * set homescreen event handler function + * + * #### Parameters + * - et : homescreen event name + * - f : event handler function + * + * #### Return + * - None. + * + */ void QLibHomeScreen::set_event_handler(enum QEventType et, handler_fun f) { LibHomeScreen::EventType hs_et = (LibHomeScreen::EventType)et; return this->mp_hs->set_event_handler(hs_et, std::move(f)); -}
\ No newline at end of file +} |