Merge lp:~ralsina/ubuntu-push-qml/apidocs into lp:ubuntu-push-qml

Proposed by Roberto Alsina
Status: Work in progress
Proposed branch: lp:~ralsina/ubuntu-push-qml/apidocs
Merge into: lp:ubuntu-push-qml
Diff against target: 207 lines (+111/-13)
5 files modified
CMakeLists.txt (+1/-0)
docs/CMakeLists.txt (+21/-0)
docs/pages/moduledef.qdoc (+5/-0)
src/Ubuntu/PushNotifications/pushclient.cpp (+3/-3)
src/Ubuntu/PushNotifications/pushclient.h (+81/-10)
To merge this branch: bzr merge lp:~ralsina/ubuntu-push-qml/apidocs
Reviewer Review Type Date Requested Status
Ubuntu Push Hackers Pending
Review via email: mp+241993@code.launchpad.net

Commit message

Add API Doc comments

Description of the change

Add API Doc comments

To post a comment you must log in.
lp:~ralsina/ubuntu-push-qml/apidocs updated
15. By Roberto Alsina

add mandatory fields in class

16. By Roberto Alsina

more docs, need more markup

Unmerged revisions

16. By Roberto Alsina

more docs, need more markup

15. By Roberto Alsina

add mandatory fields in class

14. By Roberto Alsina

very basic stuff

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2014-08-07 11:50:58 +0000
+++ CMakeLists.txt 2014-11-19 11:57:52 +0000
@@ -46,6 +46,7 @@
46 COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)46 COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
4747
48add_subdirectory(src)48add_subdirectory(src)
49add_subdirectory(docs)
4950
50file(GLOB_RECURSE I18N_SRC_FILES51file(GLOB_RECURSE I18N_SRC_FILES
51 RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}52 RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
5253
=== added directory 'docs'
=== added file 'docs/CMakeLists.txt'
--- docs/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ docs/CMakeLists.txt 2014-11-19 11:57:52 +0000
@@ -0,0 +1,21 @@
1# add a target to generate API documentation with qdoc
2FIND_PROGRAM(QDOC_EXECUTABLE qdoc)
3if(QDOC_EXECUTABLE)
4configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ubuntu-push-qml.qdocconf.in ${CMAKE_CURRENT_BINARY_DIR}/ubuntu-push-qml.qdocconf @ONLY)
5add_custom_target(qmldoc
6${QDOC_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/ubuntu-push-qml.qdocconf
7WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
8COMMENT "Generating QML API documentation with qdoc" VERBATIM
9)
10
11# copy stylesheet files into build directory for shadow builds
12file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/css"
13 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
14 )
15
16install(
17 DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
18 DESTINATION ${CMAKE_INSTALL_DOCDIR}/qml/html
19)
20
21endif(QDOC_EXECUTABLE)
022
=== added directory 'docs/pages'
=== added file 'docs/pages/moduledef.qdoc'
--- docs/pages/moduledef.qdoc 1970-01-01 00:00:00 +0000
+++ docs/pages/moduledef.qdoc 2014-11-19 11:57:52 +0000
@@ -0,0 +1,5 @@
1/*!
2\qmlmodule PushNotifications 0.1
3
4This is the Push Notification Client module
5*/
06
=== modified file 'src/Ubuntu/PushNotifications/pushclient.cpp'
--- src/Ubuntu/PushNotifications/pushclient.cpp 2014-10-23 19:15:41 +0000
+++ src/Ubuntu/PushNotifications/pushclient.cpp 2014-11-19 11:57:52 +0000
@@ -32,7 +32,7 @@
32{32{
33}33}
3434
35void PushClient::registerApp(QString appId) {35void PushClient::registerApp(const QString &appId) {
36 if (appId == this->appId || appId == "")36 if (appId == this->appId || appId == "")
37 return;37 return;
3838
@@ -83,7 +83,7 @@
83 emit error(status);83 emit error(status);
84}84}
8585
86void PushClient::notified(QString)86void PushClient::notified(const QString &)
87{87{
88 this->getNotifications();88 this->getNotifications();
89}89}
@@ -116,7 +116,7 @@
116 return reply.arguments()[0].toStringList();116 return reply.arguments()[0].toStringList();
117}117}
118118
119void PushClient::clearPersistent(QStringList tags) {119void PushClient::clearPersistent(const QStringList &tags) {
120 QDBusConnection bus = QDBusConnection::sessionBus();120 QDBusConnection bus = QDBusConnection::sessionBus();
121 QString path(POSTAL_PATH);121 QString path(POSTAL_PATH);
122 path += "/" + pkgname;122 path += "/" + pkgname;
123123
=== modified file 'src/Ubuntu/PushNotifications/pushclient.h'
--- src/Ubuntu/PushNotifications/pushclient.h 2014-09-05 12:33:24 +0000
+++ src/Ubuntu/PushNotifications/pushclient.h 2014-11-19 11:57:52 +0000
@@ -21,13 +21,22 @@
21#include <QObject>21#include <QObject>
22#include <QString>22#include <QString>
23#include <QStringList>23#include <QStringList>
24/*!
25 \qmltype PushClient
26 \inqmlmodule PushNotifications
27 \instantiates PushClient
28 \since 0.1
29 \brief PushClient gives access to the Ubuntu Push system
2430
31 The PushClient type allows the app to register with the Push Notifications
32 Client service, as well as examine pending messages.
33*/
25class PushClient : public QObject34class PushClient : public QObject
26{35{
27 Q_OBJECT36 Q_OBJECT
28public:37public:
29 explicit PushClient(QObject *parent = 0);38 explicit PushClient(QObject *parent = 0);
30 void registerApp(QString appid);39 void registerApp(const QString &appid);
31 QString getStatus() {return this->status;};40 QString getStatus() {return this->status;};
32 QString getAppId();41 QString getAppId();
33 QString getToken();42 QString getToken();
@@ -35,27 +44,89 @@
35 void setCount(int count);44 void setCount(int count);
36 int getCount();45 int getCount();
3746
47 /*!
48 The APP_ID is as described in the \l {https://wiki.ubuntu.com/AppStore/Interfaces/ApplicationId} {ApplicationId documentation}
49except that the version is treated as optional. Therefore both com.ubuntu.music_music and com.ubuntu.music_music_1.3.496
50are valid. Keep in mind that while both versioned and unversioned APP_IDs are valid, they are still different and will affect
51which notifications are delivered to the application. Unversioned IDs mean the token will be the same after updates and the application
52will receive old notifications, while versioned IDs mean the app needs to explicitly ask to get older messages delivered.
53
54Setting the same appId more than once has no effect.
55
56After you are registered, if no error occurs, the PushClient will have a value set in its token property
57which uniquely identifies the user+device combination.
58 */
38 Q_PROPERTY(QString appId WRITE registerApp READ getAppId NOTIFY appIdChanged);59 Q_PROPERTY(QString appId WRITE registerApp READ getAppId NOTIFY appIdChanged);
60 /*!
61 After the user is registered, a token that uniquely identifies the user+device combination.
62 */
39 Q_PROPERTY(QString token READ getToken NOTIFY tokenChanged);63 Q_PROPERTY(QString token READ getToken NOTIFY tokenChanged);
64 /*!
65 The notifications property contains the current pending notifications.
66 After it's read, they \b {are cleared} and the notificationsChanged signal
67 is emitted.
68 */
40 Q_PROPERTY(QStringList notifications NOTIFY notificationsChanged);69 Q_PROPERTY(QStringList notifications NOTIFY notificationsChanged);
70 /*!
71 The status property contains the last error message, if there is one.
72 */
41 Q_PROPERTY(QString status READ getStatus NOTIFY statusChanged);73 Q_PROPERTY(QString status READ getStatus NOTIFY statusChanged);
74 /*!
75 The persistent property is a list of current persistent notification tags.
76 */
42 Q_PROPERTY(QStringList persistent READ getPersistent NOTIFY persistentChanged);77 Q_PROPERTY(QStringList persistent READ getPersistent NOTIFY persistentChanged);
78 /*!
79 The count property is the number displayed in the application's icon.
80 */
43 Q_PROPERTY(int count READ getCount WRITE setCount NOTIFY countChanged)81 Q_PROPERTY(int count READ getCount WRITE setCount NOTIFY countChanged)
4482
45signals:83signals:
46 void countChanged(int);84 /*!
47 void notificationsChanged(QStringList);85 The countChanged signal is emitted when the count displayed in the app's icon changes.
48 void persistentChanged(QStringList);86 */
49 void appIdChanged(QString);87 void countChanged(int count);
50 void error(QString);88 /*!
51 void tokenChanged(QString);89 The notificationsChanged signal is emitted after a message is placed in the user's mailbox.
52 void statusChanged(QString);90 */
91 void notificationsChanged(const QStringList &notifications);
92 /*!
93 The persistentChanged signal is emitted when the persistent notifications are cleared.
94 */
95 void persistentChanged(const QStringList &tags);
96 /*!
97 The appIdChanged signal is emitted when the appId changes.
98 */
99 void appIdChanged(const QString &appId);
100 /*!
101 The error signal is emitted when there is any error communicating with the push client.
102 */
103 void error(const QString &error);
104 /*!
105 The tokenChanged signal is emitted when the identifying token changes.
106 */
107 void tokenChanged(const QString &token);
108 /*!
109 The statusChanged signal passes around error messages.
110 */
111 void statusChanged(const QString &status);
53112
54public slots:113public slots:
114 /*!
115 Puts the pending notifications in the notifications property, clears them from the push client.
116 */
55 void getNotifications();117 void getNotifications();
56 void notified(QString appId);118 /*!
119 New notifications arrived, triggers getNotifications.
120 */
121 void notified(const QString &appId);
122 /*!
123 Emits the current status as an error.
124 */
57 void emitError();125 void emitError();
58 void clearPersistent(QStringList tags);126 /*!
127 Clears persistent notifications for that app as marked by tags. If no tag is given, match all.
128 */
129 void clearPersistent(const QStringList &tags);
59130
60private:131private:
61 QString appId;132 QString appId;

Subscribers

People subscribed via source and target branches