ce14de7ee6925cd7f2863e08a10fde3a05dff4c7
[apps/agl-service-homescreen.git] / doc / api-ref / latex / de / dd0 / class_lib_home_screen.tex
1 \hypertarget{class_lib_home_screen}{}\section{Lib\+Home\+Screen Class Reference}
2 \label{class_lib_home_screen}\index{Lib\+Home\+Screen@{Lib\+Home\+Screen}}
3
4
5 {\ttfamily \#include $<$libhomescreen.\+hpp$>$}
6
7 \subsection*{Public Types}
8 \begin{DoxyCompactItemize}
9 \item 
10 enum \hyperlink{class_lib_home_screen_a82616c91ac211d2ad08e709b524bf154}{Event\+Type} \{ \hyperlink{class_lib_home_screen_a82616c91ac211d2ad08e709b524bf154a4b0a82d501e4db5fbfe25c254c92896f}{Event\+\_\+\+Tap\+Shortcut} = 1, 
11 \hyperlink{class_lib_home_screen_a82616c91ac211d2ad08e709b524bf154aea56fa32a124a8ddcbea127755280a1d}{Event\+\_\+\+On\+Screen\+Message}, 
12 \hyperlink{class_lib_home_screen_a82616c91ac211d2ad08e709b524bf154acae91db4efc2394fd701f581d277a3fd}{Event\+\_\+\+On\+Screen\+Reply}
13  \}
14 \item 
15 using \hyperlink{class_lib_home_screen_a334f11f81c84c98d18284215dcaada3a}{handler\+\_\+func} = std\+::function$<$ void(json\+\_\+object $\ast$)$>$
16 \end{DoxyCompactItemize}
17 \subsection*{Public Member Functions}
18 \begin{DoxyCompactItemize}
19 \item 
20 \hyperlink{class_lib_home_screen_a724bd949c4154fad041f96a15ef0f5dc}{Lib\+Home\+Screen} ()
21 \item 
22 \hyperlink{class_lib_home_screen_a249902aebf71a5383ca8ec6ae558d095}{$\sim$\+Lib\+Home\+Screen} ()
23 \item 
24 \hyperlink{class_lib_home_screen_a0fff2f703c8ce184eb9edd133e0f4137}{Lib\+Home\+Screen} (const \hyperlink{class_lib_home_screen}{Lib\+Home\+Screen} \&)=delete
25 \item 
26 \hyperlink{class_lib_home_screen}{Lib\+Home\+Screen} \& \hyperlink{class_lib_home_screen_a23bc17798453cfca50904562736f6b25}{operator=} (const \hyperlink{class_lib_home_screen}{Lib\+Home\+Screen} \&)=delete
27 \item 
28 int \hyperlink{class_lib_home_screen_a6a57b573cc767725762ba9beab032220}{init} (const int port, const std\+::string \&token)
29 \item 
30 int \hyperlink{class_lib_home_screen_afb571c9577087b47065eb23e7fdbc903}{tap\+Shortcut} (const char $\ast$application\+\_\+name)
31 \item 
32 int \hyperlink{class_lib_home_screen_ac336482036a72b51a822725f1929523c}{on\+Screen\+Message} (const char $\ast$display\+\_\+message)
33 \item 
34 int \hyperlink{class_lib_home_screen_a6c065f41f2c5d1f58d2763bfb4da9c37}{on\+Screen\+Reply} (const char $\ast$reply\+\_\+message)
35 \item 
36 void \hyperlink{class_lib_home_screen_ab1b0e08bf35415de9064afed899e9f85}{set\+\_\+event\+\_\+handler} (enum \hyperlink{class_lib_home_screen_a82616c91ac211d2ad08e709b524bf154}{Event\+Type} et, \hyperlink{class_lib_home_screen_a334f11f81c84c98d18284215dcaada3a}{handler\+\_\+func} f)
37 \item 
38 void \hyperlink{class_lib_home_screen_a2789e8a5372202cc36f48e71dbb9b7cf}{register\+Callback} (void($\ast$event\+\_\+cb)(const std\+::string \&\hyperlink{structevent}{event}, struct json\+\_\+object $\ast$event\+\_\+contents), void($\ast$reply\+\_\+cb)(struct json\+\_\+object $\ast$reply\+\_\+contents), void($\ast$hangup\+\_\+cb)(void)=nullptr)
39 \item 
40 int \hyperlink{class_lib_home_screen_a527b49dcfe581be6275d0eb2236ba37f}{call} (const std\+::string \&verb, struct json\+\_\+object $\ast$arg)
41 \item 
42 int \hyperlink{class_lib_home_screen_ab5e8e8ab7d53e0f114e9e907fcbb7643}{call} (const char $\ast$verb, struct json\+\_\+object $\ast$arg)
43 \item 
44 int \hyperlink{class_lib_home_screen_aa4c189807b75d070f567967f0d690738}{subscribe} (const std\+::string \&event\+\_\+name)
45 \item 
46 int \hyperlink{class_lib_home_screen_aac03a45cbd453ba69ddb00c1016930a6}{unsubscribe} (const std\+::string \&event\+\_\+name)
47 \item 
48 void \hyperlink{class_lib_home_screen_ab1c1fa69f24b981e824dd9fb810c4b74}{on\+\_\+hangup} (void $\ast$closure, struct afb\+\_\+wsj1 $\ast$wsj)
49 \item 
50 void \hyperlink{class_lib_home_screen_a608638eb87b2772a3dcc92d8ca8f3596}{on\+\_\+call} (void $\ast$closure, const char $\ast$api, const char $\ast$verb, struct afb\+\_\+wsj1\+\_\+msg $\ast$msg)
51 \item 
52 void \hyperlink{class_lib_home_screen_a9c4885b51b43ab24a548d49fb3ab2de3}{on\+\_\+event} (void $\ast$closure, const char $\ast$\hyperlink{structevent}{event}, struct afb\+\_\+wsj1\+\_\+msg $\ast$msg)
53 \item 
54 void \hyperlink{class_lib_home_screen_a248d9648c6186287a7632ec1c75fc9c5}{on\+\_\+reply} (void $\ast$closure, struct afb\+\_\+wsj1\+\_\+msg $\ast$msg)
55 \end{DoxyCompactItemize}
56 \subsection*{Static Public Attributes}
57 \begin{DoxyCompactItemize}
58 \item 
59 static const std\+::vector$<$ std\+::string $>$ \hyperlink{class_lib_home_screen_a5593ff5ac78f6495ccb649904cf0ab08}{api\+\_\+list}
60 \item 
61 static const std\+::vector$<$ std\+::string $>$ \hyperlink{class_lib_home_screen_a6a6d8a4d33a006a08652e7377a4c29e9}{event\+\_\+list}
62 \end{DoxyCompactItemize}
63
64
65 \subsection{Detailed Description}
66
67
68 Definition at line 32 of file libhomescreen.\+hpp.
69
70
71
72 \subsection{Member Typedef Documentation}
73 \mbox{\Hypertarget{class_lib_home_screen_a334f11f81c84c98d18284215dcaada3a}\label{class_lib_home_screen_a334f11f81c84c98d18284215dcaada3a}} 
74 \index{Lib\+Home\+Screen@{Lib\+Home\+Screen}!handler\+\_\+func@{handler\+\_\+func}}
75 \index{handler\+\_\+func@{handler\+\_\+func}!Lib\+Home\+Screen@{Lib\+Home\+Screen}}
76 \subsubsection{\texorpdfstring{handler\+\_\+func}{handler\_func}}
77 {\footnotesize\ttfamily using \hyperlink{class_lib_home_screen_a334f11f81c84c98d18284215dcaada3a}{Lib\+Home\+Screen\+::handler\+\_\+func} =  std\+::function$<$void(json\+\_\+object$\ast$)$>$}
78
79
80
81 Definition at line 42 of file libhomescreen.\+hpp.
82
83
84
85 \subsection{Member Enumeration Documentation}
86 \mbox{\Hypertarget{class_lib_home_screen_a82616c91ac211d2ad08e709b524bf154}\label{class_lib_home_screen_a82616c91ac211d2ad08e709b524bf154}} 
87 \index{Lib\+Home\+Screen@{Lib\+Home\+Screen}!Event\+Type@{Event\+Type}}
88 \index{Event\+Type@{Event\+Type}!Lib\+Home\+Screen@{Lib\+Home\+Screen}}
89 \subsubsection{\texorpdfstring{Event\+Type}{EventType}}
90 {\footnotesize\ttfamily enum \hyperlink{class_lib_home_screen_a82616c91ac211d2ad08e709b524bf154}{Lib\+Home\+Screen\+::\+Event\+Type}}
91
92 \begin{DoxyEnumFields}{Enumerator}
93 \raisebox{\heightof{T}}[0pt][0pt]{\index{Event\+\_\+\+Tap\+Shortcut@{Event\+\_\+\+Tap\+Shortcut}!Lib\+Home\+Screen@{Lib\+Home\+Screen}}\index{Lib\+Home\+Screen@{Lib\+Home\+Screen}!Event\+\_\+\+Tap\+Shortcut@{Event\+\_\+\+Tap\+Shortcut}}}\mbox{\Hypertarget{class_lib_home_screen_a82616c91ac211d2ad08e709b524bf154a4b0a82d501e4db5fbfe25c254c92896f}\label{class_lib_home_screen_a82616c91ac211d2ad08e709b524bf154a4b0a82d501e4db5fbfe25c254c92896f}} 
94 Event\+\_\+\+Tap\+Shortcut&\\
95 \hline
96
97 \raisebox{\heightof{T}}[0pt][0pt]{\index{Event\+\_\+\+On\+Screen\+Message@{Event\+\_\+\+On\+Screen\+Message}!Lib\+Home\+Screen@{Lib\+Home\+Screen}}\index{Lib\+Home\+Screen@{Lib\+Home\+Screen}!Event\+\_\+\+On\+Screen\+Message@{Event\+\_\+\+On\+Screen\+Message}}}\mbox{\Hypertarget{class_lib_home_screen_a82616c91ac211d2ad08e709b524bf154aea56fa32a124a8ddcbea127755280a1d}\label{class_lib_home_screen_a82616c91ac211d2ad08e709b524bf154aea56fa32a124a8ddcbea127755280a1d}} 
98 Event\+\_\+\+On\+Screen\+Message&\\
99 \hline
100
101 \raisebox{\heightof{T}}[0pt][0pt]{\index{Event\+\_\+\+On\+Screen\+Reply@{Event\+\_\+\+On\+Screen\+Reply}!Lib\+Home\+Screen@{Lib\+Home\+Screen}}\index{Lib\+Home\+Screen@{Lib\+Home\+Screen}!Event\+\_\+\+On\+Screen\+Reply@{Event\+\_\+\+On\+Screen\+Reply}}}\mbox{\Hypertarget{class_lib_home_screen_a82616c91ac211d2ad08e709b524bf154acae91db4efc2394fd701f581d277a3fd}\label{class_lib_home_screen_a82616c91ac211d2ad08e709b524bf154acae91db4efc2394fd701f581d277a3fd}} 
102 Event\+\_\+\+On\+Screen\+Reply&\\
103 \hline
104
105 \end{DoxyEnumFields}
106
107
108 Definition at line 44 of file libhomescreen.\+hpp.
109
110
111 \begin{DoxyCode}
112 44                        \{
113 45             \hyperlink{class_lib_home_screen_a82616c91ac211d2ad08e709b524bf154a4b0a82d501e4db5fbfe25c254c92896f}{Event\_TapShortcut} = 1,
114 46             \hyperlink{class_lib_home_screen_a82616c91ac211d2ad08e709b524bf154aea56fa32a124a8ddcbea127755280a1d}{Event\_OnScreenMessage},
115 47             \hyperlink{class_lib_home_screen_a82616c91ac211d2ad08e709b524bf154acae91db4efc2394fd701f581d277a3fd}{Event\_OnScreenReply}
116 48         \};
117 \end{DoxyCode}
118
119
120 \subsection{Constructor \& Destructor Documentation}
121 \mbox{\Hypertarget{class_lib_home_screen_a724bd949c4154fad041f96a15ef0f5dc}\label{class_lib_home_screen_a724bd949c4154fad041f96a15ef0f5dc}} 
122 \index{Lib\+Home\+Screen@{Lib\+Home\+Screen}!Lib\+Home\+Screen@{Lib\+Home\+Screen}}
123 \index{Lib\+Home\+Screen@{Lib\+Home\+Screen}!Lib\+Home\+Screen@{Lib\+Home\+Screen}}
124 \subsubsection{\texorpdfstring{Lib\+Home\+Screen()}{LibHomeScreen()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
125 {\footnotesize\ttfamily Lib\+Home\+Screen\+::\+Lib\+Home\+Screen (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}
126
127 constructor 
128
129 Definition at line 83 of file libhomescreen.\+cpp.
130
131
132 \begin{DoxyCode}
133 84 \{
134 85 \}
135 \end{DoxyCode}
136 \mbox{\Hypertarget{class_lib_home_screen_a249902aebf71a5383ca8ec6ae558d095}\label{class_lib_home_screen_a249902aebf71a5383ca8ec6ae558d095}} 
137 \index{Lib\+Home\+Screen@{Lib\+Home\+Screen}!````~Lib\+Home\+Screen@{$\sim$\+Lib\+Home\+Screen}}
138 \index{````~Lib\+Home\+Screen@{$\sim$\+Lib\+Home\+Screen}!Lib\+Home\+Screen@{Lib\+Home\+Screen}}
139 \subsubsection{\texorpdfstring{$\sim$\+Lib\+Home\+Screen()}{~LibHomeScreen()}}
140 {\footnotesize\ttfamily Lib\+Home\+Screen\+::$\sim$\+Lib\+Home\+Screen (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}
141
142 destructor 
143
144 Definition at line 90 of file libhomescreen.\+cpp.
145
146
147 \begin{DoxyCode}
148 91 \{
149 92     \textcolor{keywordflow}{if}(mploop)
150 93     \{
151 94         sd\_event\_unref(mploop);
152 95     \}
153 96     \textcolor{keywordflow}{if}(sp\_websock != NULL)
154 97     \{
155 98         afb\_wsj1\_unref(sp\_websock);
156 99     \}
157 100 \}
158 \end{DoxyCode}
159 \mbox{\Hypertarget{class_lib_home_screen_a0fff2f703c8ce184eb9edd133e0f4137}\label{class_lib_home_screen_a0fff2f703c8ce184eb9edd133e0f4137}} 
160 \index{Lib\+Home\+Screen@{Lib\+Home\+Screen}!Lib\+Home\+Screen@{Lib\+Home\+Screen}}
161 \index{Lib\+Home\+Screen@{Lib\+Home\+Screen}!Lib\+Home\+Screen@{Lib\+Home\+Screen}}
162 \subsubsection{\texorpdfstring{Lib\+Home\+Screen()}{LibHomeScreen()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
163 {\footnotesize\ttfamily Lib\+Home\+Screen\+::\+Lib\+Home\+Screen (\begin{DoxyParamCaption}\item[{const \hyperlink{class_lib_home_screen}{Lib\+Home\+Screen} \&}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [delete]}}
164
165
166
167 \subsection{Member Function Documentation}
168 \mbox{\Hypertarget{class_lib_home_screen_a527b49dcfe581be6275d0eb2236ba37f}\label{class_lib_home_screen_a527b49dcfe581be6275d0eb2236ba37f}} 
169 \index{Lib\+Home\+Screen@{Lib\+Home\+Screen}!call@{call}}
170 \index{call@{call}!Lib\+Home\+Screen@{Lib\+Home\+Screen}}
171 \subsubsection{\texorpdfstring{call()}{call()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
172 {\footnotesize\ttfamily int Lib\+Home\+Screen\+::call (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{verb,  }\item[{struct json\+\_\+object $\ast$}]{arg }\end{DoxyParamCaption})}
173
174 \mbox{\Hypertarget{class_lib_home_screen_ab5e8e8ab7d53e0f114e9e907fcbb7643}\label{class_lib_home_screen_ab5e8e8ab7d53e0f114e9e907fcbb7643}} 
175 \index{Lib\+Home\+Screen@{Lib\+Home\+Screen}!call@{call}}
176 \index{call@{call}!Lib\+Home\+Screen@{Lib\+Home\+Screen}}
177 \subsubsection{\texorpdfstring{call()}{call()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
178 {\footnotesize\ttfamily int Lib\+Home\+Screen\+::call (\begin{DoxyParamCaption}\item[{const char $\ast$}]{verb,  }\item[{struct json\+\_\+object $\ast$}]{arg }\end{DoxyParamCaption})}
179
180 This function calls the A\+PI of Home\+Screen via Web\+Socket This function is overload function of \char`\"{}call\char`\"{}
181
182 \subparagraph*{Parameters}
183
184
185 \begin{DoxyItemize}
186 \item verb \mbox{[}in\mbox{]} \+: This argument should be specified to the A\+PI name (e.\+g. \char`\"{}tap\+\_\+shortcut\char`\"{})
187 \item arg \mbox{[}in\mbox{]} \+: This argument should be specified to the argument of A\+PI. And this argument expects J\+S\+ON object
188 \end{DoxyItemize}
189
190 \subparagraph*{Return}
191
192
193 \begin{DoxyItemize}
194 \item Returns 0 on success or -\/1 in case of error.
195 \end{DoxyItemize}
196
197 \subparagraph*{Note}
198
199 To call Home\+Screen\textquotesingle{}s A\+P\+Is, the application should set its function name, arguments to J\+S\+ON format. 
200
201 Definition at line 360 of file libhomescreen.\+cpp.
202
203
204 \begin{DoxyCode}
205 361 \{
206 362     \textcolor{keywordtype}{int} ret;
207 363     \textcolor{keywordflow}{if}(!sp\_websock)
208 364     \{
209 365         \textcolor{keywordflow}{return} -1;
210 366     \}
211 367     \textcolor{keywordflow}{if} (!\hyperlink{libhomescreen_8cpp_a7a2176c3d71fec0f09dcb2aa0866b17e}{has\_verb}(\textcolor{keywordtype}{string}(verb)))
212 368     \{
213 369         \hyperlink{hmi-debug_8h_a65bb6c7cfe38f8a724beab5059d36fb2}{HMI\_ERROR}(\textcolor{stringliteral}{"libhomescreen"},\textcolor{stringliteral}{"verb doesn't exit"});
214 370         \textcolor{keywordflow}{return} -1;
215 371     \}
216 372     ret = afb\_wsj1\_call\_j(sp\_websock, \hyperlink{libhomescreen_8cpp_a1e2d6e77dd8f0162f830058579eab42f}{API}, verb, arg, \hyperlink{libhomescreen_8cpp_a7778933bffa862c63fa0a1b8219faa8b}{\_on\_reply\_static}, \textcolor{keyword}{this});
217 373     \textcolor{keywordflow}{if} (ret < 0) \{
218 374         \hyperlink{hmi-debug_8h_a65bb6c7cfe38f8a724beab5059d36fb2}{HMI\_ERROR}(\textcolor{stringliteral}{"libhomescreen"},\textcolor{stringliteral}{"Failed to call verb:%s"},verb);
219 375     \}
220 376     \textcolor{keywordflow}{return} ret;
221 377 \}
222 \end{DoxyCode}
223 \mbox{\Hypertarget{class_lib_home_screen_a6a57b573cc767725762ba9beab032220}\label{class_lib_home_screen_a6a57b573cc767725762ba9beab032220}} 
224 \index{Lib\+Home\+Screen@{Lib\+Home\+Screen}!init@{init}}
225 \index{init@{init}!Lib\+Home\+Screen@{Lib\+Home\+Screen}}
226 \subsubsection{\texorpdfstring{init()}{init()}}
227 {\footnotesize\ttfamily int Lib\+Home\+Screen\+::init (\begin{DoxyParamCaption}\item[{const int}]{port,  }\item[{const std\+::string \&}]{token }\end{DoxyParamCaption})}
228
229 This function is initializer
230
231 \subparagraph*{Parameters}
232
233
234 \begin{DoxyItemize}
235 \item port \mbox{[}in\mbox{]} \+: This argument should be specified to the port number to be used for websocket
236 \item token \mbox{[}in\mbox{]} \+: This argument should be specified to the token to be used for websocket
237 \end{DoxyItemize}
238
239 \subparagraph*{Return}
240
241 Nothing
242
243 \subparagraph*{Note}
244
245 Use this constructor 
246
247 Definition at line 116 of file libhomescreen.\+cpp.
248
249
250 \begin{DoxyCode}
251 117 \{
252 118     \textcolor{keywordtype}{int} ret = 0;
253 119     \textcolor{keywordflow}{if}(port > 0 && token.size() > 0)
254 120     \{
255 121         mport = port;
256 122         mtoken = token;
257 123     \}
258 124     \textcolor{keywordflow}{else}
259 125     \{
260 126         \hyperlink{hmi-debug_8h_a65bb6c7cfe38f8a724beab5059d36fb2}{HMI\_ERROR}(\textcolor{stringliteral}{"libhomescreen"},\textcolor{stringliteral}{"port and token should be > 0, Initial port and token uses."});
261 127     \}
262 128 
263 129     ret = initialize\_websocket();
264 130     \textcolor{keywordflow}{if}(ret != 0 )
265 131     \{
266 132         \hyperlink{hmi-debug_8h_a65bb6c7cfe38f8a724beab5059d36fb2}{HMI\_ERROR}(\textcolor{stringliteral}{"libhomescreen"},\textcolor{stringliteral}{"Failed to initialize websocket"});
267 133     \}
268 134     \textcolor{keywordflow}{else}\{
269 135         \hyperlink{hmi-debug_8h_a0d26d8b8201011dade787236519711c0}{HMI\_DEBUG}(\textcolor{stringliteral}{"libhomescreen"},\textcolor{stringliteral}{"Initialized"});
270 136     \}
271 137 
272 138     \textcolor{keywordflow}{return} ret;
273 139 \}
274 \end{DoxyCode}
275 \mbox{\Hypertarget{class_lib_home_screen_a608638eb87b2772a3dcc92d8ca8f3596}\label{class_lib_home_screen_a608638eb87b2772a3dcc92d8ca8f3596}} 
276 \index{Lib\+Home\+Screen@{Lib\+Home\+Screen}!on\+\_\+call@{on\+\_\+call}}
277 \index{on\+\_\+call@{on\+\_\+call}!Lib\+Home\+Screen@{Lib\+Home\+Screen}}
278 \subsubsection{\texorpdfstring{on\+\_\+call()}{on\_call()}}
279 {\footnotesize\ttfamily void Lib\+Home\+Screen\+::on\+\_\+call (\begin{DoxyParamCaption}\item[{void $\ast$}]{closure,  }\item[{const char $\ast$}]{api,  }\item[{const char $\ast$}]{verb,  }\item[{struct afb\+\_\+wsj1\+\_\+msg $\ast$}]{msg }\end{DoxyParamCaption})}
280
281
282
283 Definition at line 448 of file libhomescreen.\+cpp.
284
285
286 \begin{DoxyCode}
287 449 \{
288 450 \}
289 \end{DoxyCode}
290 \mbox{\Hypertarget{class_lib_home_screen_a9c4885b51b43ab24a548d49fb3ab2de3}\label{class_lib_home_screen_a9c4885b51b43ab24a548d49fb3ab2de3}} 
291 \index{Lib\+Home\+Screen@{Lib\+Home\+Screen}!on\+\_\+event@{on\+\_\+event}}
292 \index{on\+\_\+event@{on\+\_\+event}!Lib\+Home\+Screen@{Lib\+Home\+Screen}}
293 \subsubsection{\texorpdfstring{on\+\_\+event()}{on\_event()}}
294 {\footnotesize\ttfamily void Lib\+Home\+Screen\+::on\+\_\+event (\begin{DoxyParamCaption}\item[{void $\ast$}]{closure,  }\item[{const char $\ast$}]{event,  }\item[{struct afb\+\_\+wsj1\+\_\+msg $\ast$}]{msg }\end{DoxyParamCaption})}
295
296
297
298 Definition at line 458 of file libhomescreen.\+cpp.
299
300
301 \begin{DoxyCode}
302 459 \{
303 460     \hyperlink{hmi-debug_8h_a0d26d8b8201011dade787236519711c0}{HMI\_DEBUG}(\textcolor{stringliteral}{"libhomescreen"},\textcolor{stringliteral}{"event: (%s) msg: (%s)."}, \hyperlink{structevent}{event}, afb\_wsj1\_msg\_object\_s(msg));
304 461 
305 462     \textcolor{keywordflow}{if} (strstr(\hyperlink{structevent}{event}, \hyperlink{libhomescreen_8cpp_a1e2d6e77dd8f0162f830058579eab42f}{API}) == NULL) \{
306 463         \textcolor{keywordflow}{return};
307 464     \}
308 465 
309 466     \textcolor{keyword}{struct }json\_object* ev\_contents = afb\_wsj1\_msg\_object\_j(msg);
310 467     \textcolor{keyword}{struct }json\_object *json\_data = json\_object\_object\_get(ev\_contents, \textcolor{stringliteral}{"data"});
311 468 
312 469     \textcolor{keywordflow}{if}(onEvent != \textcolor{keyword}{nullptr})
313 470     \{
314 471         \textcolor{keyword}{const} \textcolor{keywordtype}{string} ev(\hyperlink{structevent}{event});
315 472         onEvent(ev, ev\_contents);
316 473     \}
317 474 
318 475     \textcolor{keyword}{const} \textcolor{keywordtype}{char}* event\_only = strchr(\hyperlink{structevent}{event}, \textcolor{charliteral}{'/'});
319 476     \textcolor{keywordflow}{if} (event\_only != \textcolor{keyword}{nullptr}) \{
320 477         event\_only = event\_only + 1;
321 478     \}
322 479 
323 480     \textcolor{keywordflow}{if} (strcasecmp(event\_only, \hyperlink{class_lib_home_screen_a6a6d8a4d33a006a08652e7377a4c29e9}{LibHomeScreen::event\_list}[0].c\_str()) == 0) \{
324 481         \textcolor{keyword}{auto} i = this->handlers.find(\hyperlink{class_lib_home_screen_a82616c91ac211d2ad08e709b524bf154a4b0a82d501e4db5fbfe25c254c92896f}{Event\_TapShortcut});
325 482         \textcolor{keywordflow}{if} ( i != this->handlers.end() ) \{
326 483             i->second(json\_data);
327 484         \}
328 485     \}
329 486     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcasecmp(event\_only, \hyperlink{class_lib_home_screen_a6a6d8a4d33a006a08652e7377a4c29e9}{LibHomeScreen::event\_list}[1].c\_str()) == 0) \{
330 487         \textcolor{keyword}{auto} i = this->handlers.find(\hyperlink{class_lib_home_screen_a82616c91ac211d2ad08e709b524bf154aea56fa32a124a8ddcbea127755280a1d}{Event\_OnScreenMessage});
331 488         \textcolor{keywordflow}{if} ( i != this->handlers.end() ) \{
332 489             i->second(json\_data);
333 490         \}
334 491     \}
335 492     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcasecmp(event\_only, \hyperlink{class_lib_home_screen_a6a6d8a4d33a006a08652e7377a4c29e9}{LibHomeScreen::event\_list}[2].c\_str()) == 0) \{
336 493         \textcolor{keyword}{auto} i = this->handlers.find(\hyperlink{class_lib_home_screen_a82616c91ac211d2ad08e709b524bf154acae91db4efc2394fd701f581d277a3fd}{Event\_OnScreenReply});
337 494         \textcolor{keywordflow}{if} ( i != this->handlers.end() ) \{
338 495             i->second(json\_data);
339 496         \}
340 497     \}
341 498 
342 499     json\_object\_put(ev\_contents);
343 500 \}
344 \end{DoxyCode}
345 \mbox{\Hypertarget{class_lib_home_screen_ab1c1fa69f24b981e824dd9fb810c4b74}\label{class_lib_home_screen_ab1c1fa69f24b981e824dd9fb810c4b74}} 
346 \index{Lib\+Home\+Screen@{Lib\+Home\+Screen}!on\+\_\+hangup@{on\+\_\+hangup}}
347 \index{on\+\_\+hangup@{on\+\_\+hangup}!Lib\+Home\+Screen@{Lib\+Home\+Screen}}
348 \subsubsection{\texorpdfstring{on\+\_\+hangup()}{on\_hangup()}}
349 {\footnotesize\ttfamily void Lib\+Home\+Screen\+::on\+\_\+hangup (\begin{DoxyParamCaption}\item[{void $\ast$}]{closure,  }\item[{struct afb\+\_\+wsj1 $\ast$}]{wsj }\end{DoxyParamCaption})}
350
351
352
353 Definition at line 439 of file libhomescreen.\+cpp.
354
355
356 \begin{DoxyCode}
357 440 \{
358 441     \hyperlink{hmi-debug_8h_a0d26d8b8201011dade787236519711c0}{HMI\_DEBUG}(\textcolor{stringliteral}{"libhomescreen"},\textcolor{stringliteral}{"%s called"}, \_\_FUNCTION\_\_);
359 442     \textcolor{keywordflow}{if}(onHangup != \textcolor{keyword}{nullptr})
360 443     \{
361 444         onHangup();
362 445     \}
363 446 \}
364 \end{DoxyCode}
365 \mbox{\Hypertarget{class_lib_home_screen_a248d9648c6186287a7632ec1c75fc9c5}\label{class_lib_home_screen_a248d9648c6186287a7632ec1c75fc9c5}} 
366 \index{Lib\+Home\+Screen@{Lib\+Home\+Screen}!on\+\_\+reply@{on\+\_\+reply}}
367 \index{on\+\_\+reply@{on\+\_\+reply}!Lib\+Home\+Screen@{Lib\+Home\+Screen}}
368 \subsubsection{\texorpdfstring{on\+\_\+reply()}{on\_reply()}}
369 {\footnotesize\ttfamily void Lib\+Home\+Screen\+::on\+\_\+reply (\begin{DoxyParamCaption}\item[{void $\ast$}]{closure,  }\item[{struct afb\+\_\+wsj1\+\_\+msg $\ast$}]{msg }\end{DoxyParamCaption})}
370
371 msg is like (\{\char`\"{}response\char`\"{}\+:\{\char`\"{}verb\char`\"{}\+:\char`\"{}subscribe\char`\"{},\char`\"{}error\char`\"{}\+:0\},\char`\"{}jtype\char`\"{}\+:\char`\"{}afb-\/reply\char`\"{},\char`\"{}request\char`\"{}\+:\{\char`\"{}status\char`\"{}\+:\char`\"{}success\char`\"{},\char`\"{}info\char`\"{}\+:\char`\"{}homescreen binder subscribe event name \mbox{[}on\+\_\+screen\+\_\+message\mbox{]}\char`\"{}\}\}) msg is like (\{\char`\"{}response\char`\"{}\+:\{\char`\"{}verb\char`\"{}\+:\char`\"{}tap\+\_\+shortcut\char`\"{},\char`\"{}error\char`\"{}\+:0\},\char`\"{}jtype\char`\"{}\+:\char`\"{}afb-\/reply\char`\"{},\char`\"{}request\char`\"{}\+:\{\char`\"{}status\char`\"{}\+:\char`\"{}success\char`\"{},\char`\"{}info\char`\"{}\+:\char`\"{}afb\+\_\+event\+\_\+push event \mbox{[}tap\+\_\+shortcut\mbox{]}\char`\"{}\}\}) 
372
373 Definition at line 506 of file libhomescreen.\+cpp.
374
375
376 \begin{DoxyCode}
377 507 \{
378 508     \hyperlink{hmi-debug_8h_a0d26d8b8201011dade787236519711c0}{HMI\_DEBUG}(\textcolor{stringliteral}{"libhomescreen"},\textcolor{stringliteral}{"msg: (%s)"}, afb\_wsj1\_msg\_object\_s(msg));
379 509     \textcolor{keywordflow}{if}(onReply != \textcolor{keyword}{nullptr})
380 510     \{
381 511         \textcolor{keyword}{struct }json\_object* reply = afb\_wsj1\_msg\_object\_j(msg);
382 512         onReply(reply);
383 513 
384 514         json\_object\_put(reply);
385 515     \}
386 516 \}
387 \end{DoxyCode}
388 \mbox{\Hypertarget{class_lib_home_screen_ac336482036a72b51a822725f1929523c}\label{class_lib_home_screen_ac336482036a72b51a822725f1929523c}} 
389 \index{Lib\+Home\+Screen@{Lib\+Home\+Screen}!on\+Screen\+Message@{on\+Screen\+Message}}
390 \index{on\+Screen\+Message@{on\+Screen\+Message}!Lib\+Home\+Screen@{Lib\+Home\+Screen}}
391 \subsubsection{\texorpdfstring{on\+Screen\+Message()}{onScreenMessage()}}
392 {\footnotesize\ttfamily int Lib\+Home\+Screen\+::on\+Screen\+Message (\begin{DoxyParamCaption}\item[{const char $\ast$}]{display\+\_\+message }\end{DoxyParamCaption})}
393
394 Sending on\+Screen message event
395
396 Sending On\+Screen message event to Home\+Screen from applications
397
398 \subparagraph*{Parameters}
399
400
401 \begin{DoxyItemize}
402 \item display\+\_\+message \mbox{[}in\mbox{]} \+: message for display
403 \end{DoxyItemize}
404
405 \subparagraph*{Return}
406
407
408 \begin{DoxyItemize}
409 \item Returns 0 on success or -\/1 in case of error. 
410 \end{DoxyItemize}
411
412 Definition at line 244 of file libhomescreen.\+cpp.
413
414
415 \begin{DoxyCode}
416 245 \{
417 246     \textcolor{keywordflow}{if}(!sp\_websock)
418 247     \{
419 248         \textcolor{keywordflow}{return} -1;
420 249     \}
421 250 
422 251     \textcolor{keyword}{struct }json\_object* j\_obj = json\_object\_new\_object();
423 252     \textcolor{keyword}{struct }json\_object* val = json\_object\_new\_string(display\_message);
424 253     json\_object\_object\_add(j\_obj, \textcolor{stringliteral}{"display\_message"}, val);
425 254     \textcolor{keywordflow}{return} this->\hyperlink{class_lib_home_screen_a527b49dcfe581be6275d0eb2236ba37f}{call}(\textcolor{stringliteral}{"on\_screen\_message"}, j\_obj);
426 255 \}
427 \end{DoxyCode}
428 \mbox{\Hypertarget{class_lib_home_screen_a6c065f41f2c5d1f58d2763bfb4da9c37}\label{class_lib_home_screen_a6c065f41f2c5d1f58d2763bfb4da9c37}} 
429 \index{Lib\+Home\+Screen@{Lib\+Home\+Screen}!on\+Screen\+Reply@{on\+Screen\+Reply}}
430 \index{on\+Screen\+Reply@{on\+Screen\+Reply}!Lib\+Home\+Screen@{Lib\+Home\+Screen}}
431 \subsubsection{\texorpdfstring{on\+Screen\+Reply()}{onScreenReply()}}
432 {\footnotesize\ttfamily int Lib\+Home\+Screen\+::on\+Screen\+Reply (\begin{DoxyParamCaption}\item[{const char $\ast$}]{reply\+\_\+message }\end{DoxyParamCaption})}
433
434 Sending on\+Screen reply event
435
436 Sending On\+Screen reply event to applications from Home\+Screen
437
438 \subparagraph*{Parameters}
439
440
441 \begin{DoxyItemize}
442 \item reply\+\_\+message \mbox{[}in\mbox{]} \+: message for reply
443 \end{DoxyItemize}
444
445 \subparagraph*{Return}
446
447
448 \begin{DoxyItemize}
449 \item Returns 0 on success or -\/1 in case of error. 
450 \end{DoxyItemize}
451
452 Definition at line 268 of file libhomescreen.\+cpp.
453
454
455 \begin{DoxyCode}
456 269 \{
457 270     \textcolor{keywordflow}{if}(!sp\_websock)
458 271     \{
459 272         \textcolor{keywordflow}{return} -1;
460 273     \}
461 274 
462 275     \textcolor{keyword}{struct }json\_object* j\_obj = json\_object\_new\_object();
463 276     \textcolor{keyword}{struct }json\_object* val = json\_object\_new\_string(reply\_message);
464 277     json\_object\_object\_add(j\_obj, \textcolor{stringliteral}{"reply\_message"}, val);
465 278     \textcolor{keywordflow}{return} this->\hyperlink{class_lib_home_screen_a527b49dcfe581be6275d0eb2236ba37f}{call}(\textcolor{stringliteral}{"on\_screen\_reply"}, j\_obj);
466 279 \}
467 \end{DoxyCode}
468 \mbox{\Hypertarget{class_lib_home_screen_a23bc17798453cfca50904562736f6b25}\label{class_lib_home_screen_a23bc17798453cfca50904562736f6b25}} 
469 \index{Lib\+Home\+Screen@{Lib\+Home\+Screen}!operator=@{operator=}}
470 \index{operator=@{operator=}!Lib\+Home\+Screen@{Lib\+Home\+Screen}}
471 \subsubsection{\texorpdfstring{operator=()}{operator=()}}
472 {\footnotesize\ttfamily \hyperlink{class_lib_home_screen}{Lib\+Home\+Screen}\& Lib\+Home\+Screen\+::operator= (\begin{DoxyParamCaption}\item[{const \hyperlink{class_lib_home_screen}{Lib\+Home\+Screen} \&}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [delete]}}
473
474 \mbox{\Hypertarget{class_lib_home_screen_a2789e8a5372202cc36f48e71dbb9b7cf}\label{class_lib_home_screen_a2789e8a5372202cc36f48e71dbb9b7cf}} 
475 \index{Lib\+Home\+Screen@{Lib\+Home\+Screen}!register\+Callback@{register\+Callback}}
476 \index{register\+Callback@{register\+Callback}!Lib\+Home\+Screen@{Lib\+Home\+Screen}}
477 \subsubsection{\texorpdfstring{register\+Callback()}{registerCallback()}}
478 {\footnotesize\ttfamily void Lib\+Home\+Screen\+::register\+Callback (\begin{DoxyParamCaption}\item[{void($\ast$)(const std\+::string \&\hyperlink{structevent}{event}, struct json\+\_\+object $\ast$event\+\_\+contents)}]{event\+\_\+cb,  }\item[{void($\ast$)(struct json\+\_\+object $\ast$reply\+\_\+contents)}]{reply\+\_\+cb,  }\item[{void($\ast$)(void)}]{hangup\+\_\+cb = {\ttfamily nullptr} }\end{DoxyParamCaption})}
479
480 This function register callback function for reply/event message from home screen
481
482 \subparagraph*{Parameters}
483
484
485 \begin{DoxyItemize}
486 \item event\+\_\+cb \mbox{[}in\mbox{]} \+: This argument should be specified to the callback for subscribed event
487 \item reply\+\_\+cb \mbox{[}in\mbox{]} \+: This argument should be specified to the reply callback for call function
488 \end{DoxyItemize}
489
490 \subparagraph*{Return}
491
492 Nothing
493
494 \subparagraph*{Note}
495
496 Event callback is invoked by home screen for event you subscribed. If you would like to get event, please call subscribe function before/after this function 
497
498 Definition at line 155 of file libhomescreen.\+cpp.
499
500
501 \begin{DoxyCode}
502 159 \{
503 160     onEvent = event\_cb;
504 161     onReply = reply\_cb;
505 162     onHangup = hangup\_cb;
506 163 \}
507 \end{DoxyCode}
508 \mbox{\Hypertarget{class_lib_home_screen_ab1b0e08bf35415de9064afed899e9f85}\label{class_lib_home_screen_ab1b0e08bf35415de9064afed899e9f85}} 
509 \index{Lib\+Home\+Screen@{Lib\+Home\+Screen}!set\+\_\+event\+\_\+handler@{set\+\_\+event\+\_\+handler}}
510 \index{set\+\_\+event\+\_\+handler@{set\+\_\+event\+\_\+handler}!Lib\+Home\+Screen@{Lib\+Home\+Screen}}
511 \subsubsection{\texorpdfstring{set\+\_\+event\+\_\+handler()}{set\_event\_handler()}}
512 {\footnotesize\ttfamily void Lib\+Home\+Screen\+::set\+\_\+event\+\_\+handler (\begin{DoxyParamCaption}\item[{enum \hyperlink{class_lib_home_screen_a82616c91ac211d2ad08e709b524bf154}{Event\+Type}}]{et,  }\item[{\hyperlink{class_lib_home_screen_a334f11f81c84c98d18284215dcaada3a}{handler\+\_\+func}}]{f }\end{DoxyParamCaption})}
513
514 Setting Event Handler
515
516 Setting event handler for Homescreen
517
518 \subparagraph*{Parameters}
519
520
521 \begin{DoxyItemize}
522 \item et \mbox{[}in\mbox{]} \+: event name
523 \item f \mbox{[}in\mbox{]} \+: event handler
524 \end{DoxyItemize}
525
526 \subparagraph*{Return}
527
528 Nothing 
529
530 Definition at line 293 of file libhomescreen.\+cpp.
531
532
533 \begin{DoxyCode}
534 294 \{
535 295     \textcolor{keywordflow}{if} (et >= 1 && et <= 3) \{
536 296         \textcolor{keywordflow}{switch} (et) \{
537 297             \textcolor{keywordflow}{case} \hyperlink{class_lib_home_screen_a82616c91ac211d2ad08e709b524bf154a4b0a82d501e4db5fbfe25c254c92896f}{Event\_TapShortcut}:
538 298                 this->\hyperlink{class_lib_home_screen_aa4c189807b75d070f567967f0d690738}{subscribe}(\hyperlink{class_lib_home_screen_a6a6d8a4d33a006a08652e7377a4c29e9}{LibHomeScreen::event\_list}[0]);
539 299                 \textcolor{keywordflow}{break};
540 300             \textcolor{keywordflow}{case} \hyperlink{class_lib_home_screen_a82616c91ac211d2ad08e709b524bf154aea56fa32a124a8ddcbea127755280a1d}{Event\_OnScreenMessage}:
541 301                 this->\hyperlink{class_lib_home_screen_aa4c189807b75d070f567967f0d690738}{subscribe}(\hyperlink{class_lib_home_screen_a6a6d8a4d33a006a08652e7377a4c29e9}{LibHomeScreen::event\_list}[1]);
542 302                 \textcolor{keywordflow}{break};
543 303             \textcolor{keywordflow}{case} \hyperlink{class_lib_home_screen_a82616c91ac211d2ad08e709b524bf154acae91db4efc2394fd701f581d277a3fd}{Event\_OnScreenReply}:
544 304                 this->\hyperlink{class_lib_home_screen_aa4c189807b75d070f567967f0d690738}{subscribe}(\hyperlink{class_lib_home_screen_a6a6d8a4d33a006a08652e7377a4c29e9}{LibHomeScreen::event\_list}[2]);
545 305                 \textcolor{keywordflow}{break};
546 306         \}
547 307 
548 308         this->handlers[et] = std::move(f);
549 309     \}
550 310 \}
551 \end{DoxyCode}
552 \mbox{\Hypertarget{class_lib_home_screen_aa4c189807b75d070f567967f0d690738}\label{class_lib_home_screen_aa4c189807b75d070f567967f0d690738}} 
553 \index{Lib\+Home\+Screen@{Lib\+Home\+Screen}!subscribe@{subscribe}}
554 \index{subscribe@{subscribe}!Lib\+Home\+Screen@{Lib\+Home\+Screen}}
555 \subsubsection{\texorpdfstring{subscribe()}{subscribe()}}
556 {\footnotesize\ttfamily int Lib\+Home\+Screen\+::subscribe (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{event\+\_\+name }\end{DoxyParamCaption})}
557
558 Register callback function for each event
559
560 \subparagraph*{Parameters}
561
562
563 \begin{DoxyItemize}
564 \item event\+\_\+name \mbox{[}in\mbox{]} \+: This argument should be specified to the event name
565 \end{DoxyItemize}
566
567 \subparagraph*{Return}
568
569
570 \begin{DoxyItemize}
571 \item Returns 0 on success or -\/1 in case of error.
572 \end{DoxyItemize}
573
574 \subparagraph*{Note}
575
576 This function enables to get an event to your callback function. 
577
578 Definition at line 392 of file libhomescreen.\+cpp.
579
580
581 \begin{DoxyCode}
582 393 \{
583 394     \textcolor{keywordflow}{if}(!sp\_websock)
584 395     \{
585 396         \textcolor{keywordflow}{return} -1;
586 397     \}
587 398     \textcolor{keyword}{struct }json\_object* j\_obj = json\_object\_new\_object();
588 399     json\_object\_object\_add(j\_obj, \textcolor{stringliteral}{"event"}, json\_object\_new\_string(event\_name.c\_str()));
589 400 
590 401     \textcolor{keywordtype}{int} ret = afb\_wsj1\_call\_j(sp\_websock, \hyperlink{libhomescreen_8cpp_a1e2d6e77dd8f0162f830058579eab42f}{API}, \textcolor{stringliteral}{"subscribe"}, j\_obj, 
591       \hyperlink{libhomescreen_8cpp_a7778933bffa862c63fa0a1b8219faa8b}{\_on\_reply\_static}, \textcolor{keyword}{this});
592 402     \textcolor{keywordflow}{if} (ret < 0) \{
593 403         \hyperlink{hmi-debug_8h_a65bb6c7cfe38f8a724beab5059d36fb2}{HMI\_ERROR}(\textcolor{stringliteral}{"libhomescreen"},\textcolor{stringliteral}{"Failed to call verb:%s"},\_\_FUNCTION\_\_);
594 404     \}
595 405     \textcolor{keywordflow}{return} ret;
596 406 \}
597 \end{DoxyCode}
598 \mbox{\Hypertarget{class_lib_home_screen_afb571c9577087b47065eb23e7fdbc903}\label{class_lib_home_screen_afb571c9577087b47065eb23e7fdbc903}} 
599 \index{Lib\+Home\+Screen@{Lib\+Home\+Screen}!tap\+Shortcut@{tap\+Shortcut}}
600 \index{tap\+Shortcut@{tap\+Shortcut}!Lib\+Home\+Screen@{Lib\+Home\+Screen}}
601 \subsubsection{\texorpdfstring{tap\+Shortcut()}{tapShortcut()}}
602 {\footnotesize\ttfamily int Lib\+Home\+Screen\+::tap\+Shortcut (\begin{DoxyParamCaption}\item[{const char $\ast$}]{application\+\_\+name }\end{DoxyParamCaption})}
603
604 Sending Short\+Cut Icon tapped event
605
606 When Home\+Screen shortcut area is tapped, sending a event
607
608 \subparagraph*{Parameters}
609
610
611 \begin{DoxyItemize}
612 \item application\+\_\+name \mbox{[}in\mbox{]} \+: Tapped application name (label)
613 \end{DoxyItemize}
614
615 \subparagraph*{Return}
616
617
618 \begin{DoxyItemize}
619 \item Returns 0 on success or -\/1 in case of error. 
620 \end{DoxyItemize}
621
622 Definition at line 220 of file libhomescreen.\+cpp.
623
624
625 \begin{DoxyCode}
626 221 \{
627 222     \textcolor{keywordflow}{if}(!sp\_websock)
628 223     \{
629 224         \textcolor{keywordflow}{return} -1;
630 225     \}
631 226 
632 227     \textcolor{keyword}{struct }json\_object* j\_obj = json\_object\_new\_object();
633 228     \textcolor{keyword}{struct }json\_object* val = json\_object\_new\_string(application\_name);
634 229     json\_object\_object\_add(j\_obj, \textcolor{stringliteral}{"application\_name"}, val);
635 230     \textcolor{keywordflow}{return} this->\hyperlink{class_lib_home_screen_a527b49dcfe581be6275d0eb2236ba37f}{call}(\textcolor{stringliteral}{"tap\_shortcut"}, j\_obj);
636 231 \}
637 \end{DoxyCode}
638 \mbox{\Hypertarget{class_lib_home_screen_aac03a45cbd453ba69ddb00c1016930a6}\label{class_lib_home_screen_aac03a45cbd453ba69ddb00c1016930a6}} 
639 \index{Lib\+Home\+Screen@{Lib\+Home\+Screen}!unsubscribe@{unsubscribe}}
640 \index{unsubscribe@{unsubscribe}!Lib\+Home\+Screen@{Lib\+Home\+Screen}}
641 \subsubsection{\texorpdfstring{unsubscribe()}{unsubscribe()}}
642 {\footnotesize\ttfamily int Lib\+Home\+Screen\+::unsubscribe (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{event\+\_\+name }\end{DoxyParamCaption})}
643
644 Unregister callback function for each event
645
646 \subparagraph*{Parameters}
647
648
649 \begin{DoxyItemize}
650 \item event\+\_\+name \mbox{[}in\mbox{]} \+: This argument should be specified to the event name
651 \end{DoxyItemize}
652
653 \subparagraph*{Return}
654
655
656 \begin{DoxyItemize}
657 \item Returns 0 on success or -\/1 in case of error.
658 \end{DoxyItemize}
659
660 \subparagraph*{Note}
661
662 This function disables to get an event to your callback function. 
663
664 Definition at line 421 of file libhomescreen.\+cpp.
665
666
667 \begin{DoxyCode}
668 422 \{
669 423     \textcolor{keywordflow}{if}(!sp\_websock)
670 424     \{
671 425         \textcolor{keywordflow}{return} -1;
672 426     \}
673 427     \textcolor{keyword}{struct }json\_object* j\_obj = json\_object\_new\_object();
674 428     json\_object\_object\_add(j\_obj, \textcolor{stringliteral}{"event"}, json\_object\_new\_string(event\_name.c\_str()));
675 429 
676 430     \textcolor{keywordtype}{int} ret = afb\_wsj1\_call\_j(sp\_websock, \hyperlink{libhomescreen_8cpp_a1e2d6e77dd8f0162f830058579eab42f}{API}, \textcolor{stringliteral}{"unsubscribe"}, j\_obj, 
677       \hyperlink{libhomescreen_8cpp_a7778933bffa862c63fa0a1b8219faa8b}{\_on\_reply\_static}, \textcolor{keyword}{this});
678 431     \textcolor{keywordflow}{if} (ret < 0) \{
679 432         \hyperlink{hmi-debug_8h_a65bb6c7cfe38f8a724beab5059d36fb2}{HMI\_ERROR}(\textcolor{stringliteral}{"libhomescreen"},\textcolor{stringliteral}{"Failed to call verb:%s"},\_\_FUNCTION\_\_);
680 433     \}
681 434     \textcolor{keywordflow}{return} ret;
682 435 \}
683 \end{DoxyCode}
684
685
686 \subsection{Member Data Documentation}
687 \mbox{\Hypertarget{class_lib_home_screen_a5593ff5ac78f6495ccb649904cf0ab08}\label{class_lib_home_screen_a5593ff5ac78f6495ccb649904cf0ab08}} 
688 \index{Lib\+Home\+Screen@{Lib\+Home\+Screen}!api\+\_\+list@{api\+\_\+list}}
689 \index{api\+\_\+list@{api\+\_\+list}!Lib\+Home\+Screen@{Lib\+Home\+Screen}}
690 \subsubsection{\texorpdfstring{api\+\_\+list}{api\_list}}
691 {\footnotesize\ttfamily const std\+::vector$<$ std\+::string $>$ Lib\+Home\+Screen\+::api\+\_\+list\hspace{0.3cm}{\ttfamily [static]}}
692
693 {\bfseries Initial value\+:}
694 \begin{DoxyCode}
695 \{
696     std::string(\textcolor{stringliteral}{"ping"}), 
697     std::string(\textcolor{stringliteral}{"tap\_shortcut"}), 
698     std::string(\textcolor{stringliteral}{"on\_screen\_message"}),
699     std::string(\textcolor{stringliteral}{"on\_screen\_reply"}),
700     std::string(\textcolor{stringliteral}{"subscribe"}),
701     std::string(\textcolor{stringliteral}{"unsubscribe"})
702 \}
703 \end{DoxyCode}
704
705
706 Definition at line 50 of file libhomescreen.\+hpp.
707
708 \mbox{\Hypertarget{class_lib_home_screen_a6a6d8a4d33a006a08652e7377a4c29e9}\label{class_lib_home_screen_a6a6d8a4d33a006a08652e7377a4c29e9}} 
709 \index{Lib\+Home\+Screen@{Lib\+Home\+Screen}!event\+\_\+list@{event\+\_\+list}}
710 \index{event\+\_\+list@{event\+\_\+list}!Lib\+Home\+Screen@{Lib\+Home\+Screen}}
711 \subsubsection{\texorpdfstring{event\+\_\+list}{event\_list}}
712 {\footnotesize\ttfamily const std\+::vector$<$ std\+::string $>$ Lib\+Home\+Screen\+::event\+\_\+list\hspace{0.3cm}{\ttfamily [static]}}
713
714 {\bfseries Initial value\+:}
715 \begin{DoxyCode}
716 \{
717     std::string(\textcolor{stringliteral}{"tap\_shortcut"}),
718     std::string(\textcolor{stringliteral}{"on\_screen\_message"}),
719     std::string(\textcolor{stringliteral}{"on\_screen\_reply"}),
720     std::string(\textcolor{stringliteral}{"none"})
721 \}
722 \end{DoxyCode}
723
724
725 Definition at line 51 of file libhomescreen.\+hpp.
726
727
728
729 The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
730 \item 
731 include/\hyperlink{libhomescreen_8hpp}{libhomescreen.\+hpp}\item 
732 libhomescreen/\hyperlink{libhomescreen_8cpp}{libhomescreen.\+cpp}\end{DoxyCompactItemize}