update doc
[apps/agl-service-homescreen.git] / doc / api-ref / latex / d5 / d20 / class_h_s___client.tex
1 \hypertarget{class_h_s___client}{}\section{H\+S\+\_\+\+Client Class Reference}
2 \label{class_h_s___client}\index{H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}}
3
4
5 {\ttfamily \#include $<$hs-\/client.\+h$>$}
6
7 \subsection*{Public Member Functions}
8 \begin{DoxyCompactItemize}
9 \item 
10 \hyperlink{class_h_s___client_a0afac6b86b9a72e74846e47e435f5f90}{H\+S\+\_\+\+Client} (afb\+\_\+req\+\_\+t request, const char $\ast$id)
11 \item 
12 \hyperlink{class_h_s___client_a47cb0035116ac7be4fffcfc9736e9233}{H\+S\+\_\+\+Client} (afb\+\_\+req\+\_\+t request, std\+::string id)
13 \item 
14 \hyperlink{class_h_s___client_a429a4697767344f3789bb233bc73a2b9}{H\+S\+\_\+\+Client} (\hyperlink{class_h_s___client}{H\+S\+\_\+\+Client} \&)=delete
15 \item 
16 \hyperlink{class_h_s___client}{H\+S\+\_\+\+Client} \& \hyperlink{class_h_s___client_a3e3d8fa1c8746d6d1b1650fe1fcc56a8}{operator=} (\hyperlink{class_h_s___client}{H\+S\+\_\+\+Client} \&)=delete
17 \item 
18 \hyperlink{class_h_s___client_ab29a9e899aaec3c21983c24ec6e5ee70}{$\sim$\+H\+S\+\_\+\+Client} ()
19 \item 
20 int \hyperlink{class_h_s___client_a0d7fb8316248e8946dcb73a6612f21bb}{tap\+\_\+shortcut} (const char $\ast$appid)
21 \item 
22 int \hyperlink{class_h_s___client_af0f2be967a5b6ee81932c73b101184f7}{show\+Window} (afb\+\_\+req\+\_\+t request, const char $\ast$appid)
23 \item 
24 int \hyperlink{class_h_s___client_ac29482ffdf1b27733247ba0ffcc28b76}{hide\+Window} (afb\+\_\+req\+\_\+t request)
25 \item 
26 int \hyperlink{class_h_s___client_a294e461500ef02aed17ed5d91479f6b9}{reply\+Show\+Window} (afb\+\_\+req\+\_\+t request, const char $\ast$appid)
27 \item 
28 int \hyperlink{class_h_s___client_a274301617c9ab629d6916c0dde8c40b9}{on\+\_\+screen\+\_\+message} (afb\+\_\+req\+\_\+t request, const char $\ast$message)
29 \item 
30 int \hyperlink{class_h_s___client_a9f7a30840c95b1348bcce4cd4626b2ae}{on\+\_\+screen\+\_\+reply} (afb\+\_\+req\+\_\+t request, const char $\ast$message)
31 \item 
32 int \hyperlink{class_h_s___client_a3d000ca70bd4a8af7c4895d95bc7d0d0}{subscribe} (afb\+\_\+req\+\_\+t request, const char $\ast$event)
33 \item 
34 int \hyperlink{class_h_s___client_a3da3b5662f918e11773da75f8f971d9c}{unsubscribe} (afb\+\_\+req\+\_\+t request, const char $\ast$event)
35 \item 
36 int \hyperlink{class_h_s___client_a77b41c1bc6f2c939410108d821a0b456}{show\+Notification} (afb\+\_\+req\+\_\+t request)
37 \item 
38 int \hyperlink{class_h_s___client_a7145c14a7a971b45f647a82e3390ce9c}{show\+Information} (afb\+\_\+req\+\_\+t request)
39 \end{DoxyCompactItemize}
40
41
42 \subsection{Detailed Description}
43
44
45 Definition at line 25 of file hs-\/client.\+h.
46
47
48
49 \subsection{Constructor \& Destructor Documentation}
50 \index{H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}!H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}}
51 \index{H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}!H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}}
52 \subsubsection[{\texorpdfstring{H\+S\+\_\+\+Client(afb\+\_\+req\+\_\+t request, const char $\ast$id)}{HS_Client(afb_req_t request, const char *id)}}]{\setlength{\rightskip}{0pt plus 5cm}H\+S\+\_\+\+Client\+::\+H\+S\+\_\+\+Client (
53 \begin{DoxyParamCaption}
54 \item[{afb\+\_\+req\+\_\+t}]{request, }
55 \item[{const char $\ast$}]{id}
56 \end{DoxyParamCaption}
57 )\hspace{0.3cm}{\ttfamily [inline]}}\hypertarget{class_h_s___client_a0afac6b86b9a72e74846e47e435f5f90}{}\label{class_h_s___client_a0afac6b86b9a72e74846e47e435f5f90}
58
59
60 Definition at line 27 of file hs-\/client.\+h.
61
62
63 \begin{DoxyCode}
64 27 : \hyperlink{class_h_s___client_a0afac6b86b9a72e74846e47e435f5f90}{HS\_Client}(request, std::string(\textcolor{keywordtype}{id}))\{\}
65 \end{DoxyCode}
66 \index{H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}!H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}}
67 \index{H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}!H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}}
68 \subsubsection[{\texorpdfstring{H\+S\+\_\+\+Client(afb\+\_\+req\+\_\+t request, std\+::string id)}{HS_Client(afb_req_t request, std::string id)}}]{\setlength{\rightskip}{0pt plus 5cm}H\+S\+\_\+\+Client\+::\+H\+S\+\_\+\+Client (
69 \begin{DoxyParamCaption}
70 \item[{afb\+\_\+req\+\_\+t}]{request, }
71 \item[{std\+::string}]{id}
72 \end{DoxyParamCaption}
73 )}\hypertarget{class_h_s___client_a47cb0035116ac7be4fffcfc9736e9233}{}\label{class_h_s___client_a47cb0035116ac7be4fffcfc9736e9233}
74 \hyperlink{class_h_s___client}{H\+S\+\_\+\+Client} construction function
75
76 \subparagraph*{Parameters}
77
78
79 \begin{DoxyItemize}
80 \item id\+: app\textquotesingle{}s id
81 \end{DoxyItemize}
82
83 \subparagraph*{Return}
84
85 None 
86
87 Definition at line 38 of file hs-\/client.\+cpp.
88
89
90 \begin{DoxyCode}
91 38                                                     : my\_id(\textcolor{keywordtype}{id})
92 39 \{
93 40     \hyperlink{include_2hmi-debug_8h_abc0d6e0760017d8ae48b836925b2ef15}{HMI\_NOTICE}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"called."});
94 41     my\_event = afb\_api\_make\_event(request->api, \textcolor{keywordtype}{id}.c\_str());
95 42 \}
96 \end{DoxyCode}
97 \index{H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}!H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}}
98 \index{H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}!H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}}
99 \subsubsection[{\texorpdfstring{H\+S\+\_\+\+Client(\+H\+S\+\_\+\+Client \&)=delete}{HS_Client(HS_Client &)=delete}}]{\setlength{\rightskip}{0pt plus 5cm}H\+S\+\_\+\+Client\+::\+H\+S\+\_\+\+Client (
100 \begin{DoxyParamCaption}
101 \item[{{\bf H\+S\+\_\+\+Client} \&}]{}
102 \end{DoxyParamCaption}
103 )\hspace{0.3cm}{\ttfamily [delete]}}\hypertarget{class_h_s___client_a429a4697767344f3789bb233bc73a2b9}{}\label{class_h_s___client_a429a4697767344f3789bb233bc73a2b9}
104 \index{H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}!````~H\+S\+\_\+\+Client@{$\sim$\+H\+S\+\_\+\+Client}}
105 \index{````~H\+S\+\_\+\+Client@{$\sim$\+H\+S\+\_\+\+Client}!H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}}
106 \subsubsection[{\texorpdfstring{$\sim$\+H\+S\+\_\+\+Client()}{~HS_Client()}}]{\setlength{\rightskip}{0pt plus 5cm}H\+S\+\_\+\+Client\+::$\sim$\+H\+S\+\_\+\+Client (
107 \begin{DoxyParamCaption}
108 {}
109 \end{DoxyParamCaption}
110 )}\hypertarget{class_h_s___client_ab29a9e899aaec3c21983c24ec6e5ee70}{}\label{class_h_s___client_ab29a9e899aaec3c21983c24ec6e5ee70}
111 \hyperlink{class_h_s___client}{H\+S\+\_\+\+Client} destruction function
112
113 \subparagraph*{Parameters}
114
115
116 \begin{DoxyItemize}
117 \item null
118 \end{DoxyItemize}
119
120 \subparagraph*{Return}
121
122 None 
123
124 Definition at line 54 of file hs-\/client.\+cpp.
125
126
127 \begin{DoxyCode}
128 55 \{
129 56     \hyperlink{include_2hmi-debug_8h_abc0d6e0760017d8ae48b836925b2ef15}{HMI\_NOTICE}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"called."});
130 57     afb\_event\_unref(my\_event);
131 58 \}
132 \end{DoxyCode}
133
134
135 \subsection{Member Function Documentation}
136 \index{H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}!hide\+Window@{hide\+Window}}
137 \index{hide\+Window@{hide\+Window}!H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}}
138 \subsubsection[{\texorpdfstring{hide\+Window(afb\+\_\+req\+\_\+t request)}{hideWindow(afb_req_t request)}}]{\setlength{\rightskip}{0pt plus 5cm}int H\+S\+\_\+\+Client\+::hide\+Window (
139 \begin{DoxyParamCaption}
140 \item[{afb\+\_\+req\+\_\+t}]{request}
141 \end{DoxyParamCaption}
142 )}\hypertarget{class_h_s___client_ac29482ffdf1b27733247ba0ffcc28b76}{}\label{class_h_s___client_ac29482ffdf1b27733247ba0ffcc28b76}
143 hide\+Window event
144
145 input contents \+: \{\char`\"{}application\+\_\+id\char`\"{}\+:\char`\"{}the appid that want to hide\char`\"{}\}
146
147 \subparagraph*{Parameters}
148
149
150 \begin{DoxyItemize}
151 \item request \+: the request
152 \end{DoxyItemize}
153
154 \subparagraph*{Return}
155
156 0 \+: success others \+: fail 
157
158 Definition at line 245 of file hs-\/client.\+cpp.
159
160
161 \begin{DoxyCode}
162 246 \{
163 247     \textcolor{keywordflow}{if}(!checkEvent(\_\_FUNCTION\_\_))
164 248         \textcolor{keywordflow}{return} 0;
165 249 
166 250     \hyperlink{include_2hmi-debug_8h_abc0d6e0760017d8ae48b836925b2ef15}{HMI\_NOTICE}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"%s application\_id = %s."}, \_\_FUNCTION\_\_);
167 251     \textcolor{keyword}{const} \textcolor{keywordtype}{char}* req\_appid = afb\_req\_get\_application\_id(request);
168 252     \textcolor{keyword}{struct }json\_object* push\_obj = json\_object\_new\_object();
169 253     \hyperlink{hs-helper_8cpp_a8777c53f1d4d5412f19b134ad85ffedf}{hs\_add\_object\_to\_json\_object\_str}( push\_obj, 4, 
170       \hyperlink{homescreen_8cpp_a6a0e1db2562b442f8131ddf64b61d1ba}{\_application\_id}, req\_appid,
171 254     \hyperlink{hs-client_8cpp_a1c24b43242df87f75631175c75afdcda}{\_type}, \_\_FUNCTION\_\_);
172 255     afb\_event\_push(my\_event, push\_obj);
173 256     \textcolor{keywordflow}{return} 0;
174 257 \}
175 \end{DoxyCode}
176 \index{H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}!on\+\_\+screen\+\_\+message@{on\+\_\+screen\+\_\+message}}
177 \index{on\+\_\+screen\+\_\+message@{on\+\_\+screen\+\_\+message}!H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}}
178 \subsubsection[{\texorpdfstring{on\+\_\+screen\+\_\+message(afb\+\_\+req\+\_\+t request, const char $\ast$message)}{on_screen_message(afb_req_t request, const char *message)}}]{\setlength{\rightskip}{0pt plus 5cm}int H\+S\+\_\+\+Client\+::on\+\_\+screen\+\_\+message (
179 \begin{DoxyParamCaption}
180 \item[{afb\+\_\+req\+\_\+t}]{request, }
181 \item[{const char $\ast$}]{message}
182 \end{DoxyParamCaption}
183 )}\hypertarget{class_h_s___client_a274301617c9ab629d6916c0dde8c40b9}{}\label{class_h_s___client_a274301617c9ab629d6916c0dde8c40b9}
184 push on\+\_\+screen\+\_\+message event
185
186 \subparagraph*{Parameters}
187
188
189 \begin{DoxyItemize}
190 \item message\+: post message.
191 \end{DoxyItemize}
192
193 \subparagraph*{Return}
194
195 result 
196
197 Definition at line 93 of file hs-\/client.\+cpp.
198
199
200 \begin{DoxyCode}
201 94 \{
202 95     \textcolor{keywordflow}{if}(!checkEvent(\_\_FUNCTION\_\_))
203 96         \textcolor{keywordflow}{return} 0;
204 97 
205 98     \hyperlink{include_2hmi-debug_8h_abc0d6e0760017d8ae48b836925b2ef15}{HMI\_NOTICE}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"push %s event message [%s]."}, \_\_FUNCTION\_\_, message);
206 99     \textcolor{keyword}{struct }json\_object* push\_obj = json\_object\_new\_object();
207 100     \hyperlink{hs-helper_8cpp_a8777c53f1d4d5412f19b134ad85ffedf}{hs\_add\_object\_to\_json\_object\_str}( push\_obj, 4, 
208       \hyperlink{homescreen_8cpp_abfd6c1d6f316fa952b11553f8f275e92}{\_display\_message}, message,
209 101     \hyperlink{hs-client_8cpp_a1c24b43242df87f75631175c75afdcda}{\_type}, \_\_FUNCTION\_\_);
210 102     afb\_event\_push(my\_event, push\_obj);
211 103     \textcolor{keywordflow}{return} 0;
212 104 \}
213 \end{DoxyCode}
214 \index{H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}!on\+\_\+screen\+\_\+reply@{on\+\_\+screen\+\_\+reply}}
215 \index{on\+\_\+screen\+\_\+reply@{on\+\_\+screen\+\_\+reply}!H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}}
216 \subsubsection[{\texorpdfstring{on\+\_\+screen\+\_\+reply(afb\+\_\+req\+\_\+t request, const char $\ast$message)}{on_screen_reply(afb_req_t request, const char *message)}}]{\setlength{\rightskip}{0pt plus 5cm}int H\+S\+\_\+\+Client\+::on\+\_\+screen\+\_\+reply (
217 \begin{DoxyParamCaption}
218 \item[{afb\+\_\+req\+\_\+t}]{request, }
219 \item[{const char $\ast$}]{message}
220 \end{DoxyParamCaption}
221 )}\hypertarget{class_h_s___client_a9f7a30840c95b1348bcce4cd4626b2ae}{}\label{class_h_s___client_a9f7a30840c95b1348bcce4cd4626b2ae}
222 push on\+\_\+screen\+\_\+reply event
223
224 \subparagraph*{Parameters}
225
226
227 \begin{DoxyItemize}
228 \item message\+: reply message.
229 \end{DoxyItemize}
230
231 \subparagraph*{Return}
232
233 result 
234
235 Definition at line 116 of file hs-\/client.\+cpp.
236
237
238 \begin{DoxyCode}
239 117 \{
240 118     \textcolor{keywordflow}{if}(!checkEvent(\_\_FUNCTION\_\_))
241 119         \textcolor{keywordflow}{return} 0;
242 120 
243 121     \hyperlink{include_2hmi-debug_8h_abc0d6e0760017d8ae48b836925b2ef15}{HMI\_NOTICE}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"push %s event message [%s]."}, \_\_FUNCTION\_\_, message);
244 122     \textcolor{keyword}{struct }json\_object* push\_obj = json\_object\_new\_object();
245 123     \hyperlink{hs-helper_8cpp_a8777c53f1d4d5412f19b134ad85ffedf}{hs\_add\_object\_to\_json\_object\_str}( push\_obj, 4, 
246       \hyperlink{homescreen_8cpp_a79b0f0b481161527ccb80e83da143219}{\_reply\_message}, message,
247 124     \hyperlink{hs-client_8cpp_a1c24b43242df87f75631175c75afdcda}{\_type}, \_\_FUNCTION\_\_);
248 125     afb\_event\_push(my\_event, push\_obj);
249 126     \textcolor{keywordflow}{return} 0;
250 127 \}
251 \end{DoxyCode}
252 \index{H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}!operator=@{operator=}}
253 \index{operator=@{operator=}!H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}}
254 \subsubsection[{\texorpdfstring{operator=(\+H\+S\+\_\+\+Client \&)=delete}{operator=(HS_Client &)=delete}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf H\+S\+\_\+\+Client}\& H\+S\+\_\+\+Client\+::operator= (
255 \begin{DoxyParamCaption}
256 \item[{{\bf H\+S\+\_\+\+Client} \&}]{}
257 \end{DoxyParamCaption}
258 )\hspace{0.3cm}{\ttfamily [delete]}}\hypertarget{class_h_s___client_a3e3d8fa1c8746d6d1b1650fe1fcc56a8}{}\label{class_h_s___client_a3e3d8fa1c8746d6d1b1650fe1fcc56a8}
259 \index{H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}!reply\+Show\+Window@{reply\+Show\+Window}}
260 \index{reply\+Show\+Window@{reply\+Show\+Window}!H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}}
261 \subsubsection[{\texorpdfstring{reply\+Show\+Window(afb\+\_\+req\+\_\+t request, const char $\ast$appid)}{replyShowWindow(afb_req_t request, const char *appid)}}]{\setlength{\rightskip}{0pt plus 5cm}int H\+S\+\_\+\+Client\+::reply\+Show\+Window (
262 \begin{DoxyParamCaption}
263 \item[{afb\+\_\+req\+\_\+t}]{request, }
264 \item[{const char $\ast$}]{appid}
265 \end{DoxyParamCaption}
266 )}\hypertarget{class_h_s___client_a294e461500ef02aed17ed5d91479f6b9}{}\label{class_h_s___client_a294e461500ef02aed17ed5d91479f6b9}
267 reply\+Show\+Window event
268
269 input contens \+: \{\char`\"{}application\+\_\+id\char`\"{}\+: \char`\"{}the appid that want to reply\char`\"{}, \char`\"{}parameter\char`\"{}\+: \{...\}\}
270
271 \subparagraph*{Parameters}
272
273
274 \begin{DoxyItemize}
275 \item request \+: the request
276 \item appid \+: the appid that want to reply
277 \end{DoxyItemize}
278
279 \subparagraph*{Return}
280
281 0 \+: success others \+: fail 
282
283 Definition at line 273 of file hs-\/client.\+cpp.
284
285
286 \begin{DoxyCode}
287 274 \{
288 275     \textcolor{keywordflow}{if}(!checkEvent(\_\_FUNCTION\_\_))
289 276         \textcolor{keywordflow}{return} 0;
290 277 
291 278     \hyperlink{include_2hmi-debug_8h_abc0d6e0760017d8ae48b836925b2ef15}{HMI\_NOTICE}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"%s application\_id = %s."}, \_\_FUNCTION\_\_, appid);
292 279     \textcolor{keyword}{struct }json\_object* push\_obj = json\_object\_new\_object();
293 280     \hyperlink{hs-helper_8cpp_a8777c53f1d4d5412f19b134ad85ffedf}{hs\_add\_object\_to\_json\_object\_str}( push\_obj, 4, 
294       \hyperlink{homescreen_8cpp_a6a0e1db2562b442f8131ddf64b61d1ba}{\_application\_id}, appid, \hyperlink{hs-client_8cpp_a1c24b43242df87f75631175c75afdcda}{\_type}, \_\_FUNCTION\_\_);
295 281     \textcolor{keyword}{const} \textcolor{keywordtype}{char}* param = afb\_req\_value(request, \hyperlink{hs-client_8cpp_ae3fc16098a2461f2f1ae0ac8561437c6}{\_parameter});
296 282     \textcolor{keywordflow}{if}(param) \{
297 283         json\_object\_object\_add(push\_obj, \hyperlink{hs-client_8cpp_ae3fc16098a2461f2f1ae0ac8561437c6}{\_parameter}, json\_tokener\_parse(param));
298 284     \}
299 285     \textcolor{keywordflow}{else} \{
300 286         \hyperlink{include_2hmi-debug_8h_a65bb6c7cfe38f8a724beab5059d36fb2}{HMI\_ERROR}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"please input correct parameter."});
301 287         \textcolor{keywordflow}{return} \hyperlink{hs-helper_8h_aa611e2ec24ef295bd87825889fe2ce5e}{AFB\_EVENT\_BAD\_REQUEST};
302 288     \}
303 289 
304 290     afb\_event\_push(my\_event, push\_obj);
305 291     \textcolor{keywordflow}{return} 0;
306 292 \}
307 \end{DoxyCode}
308 \index{H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}!show\+Information@{show\+Information}}
309 \index{show\+Information@{show\+Information}!H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}}
310 \subsubsection[{\texorpdfstring{show\+Information(afb\+\_\+req\+\_\+t request)}{showInformation(afb_req_t request)}}]{\setlength{\rightskip}{0pt plus 5cm}int H\+S\+\_\+\+Client\+::show\+Information (
311 \begin{DoxyParamCaption}
312 \item[{afb\+\_\+req\+\_\+t}]{request}
313 \end{DoxyParamCaption}
314 )}\hypertarget{class_h_s___client_a7145c14a7a971b45f647a82e3390ce9c}{}\label{class_h_s___client_a7145c14a7a971b45f647a82e3390ce9c}
315 show\+Information event
316
317 input contents \+: \{\char`\"{}info\char`\"{}\+: \char`\"{}information contents\char`\"{}\}
318
319 \subparagraph*{Parameters}
320
321
322 \begin{DoxyItemize}
323 \item request \+: the request
324 \end{DoxyItemize}
325
326 \subparagraph*{Return}
327
328 0 \+: success others \+: fail 
329
330 Definition at line 350 of file hs-\/client.\+cpp.
331
332
333 \begin{DoxyCode}
334 351 \{
335 352     \textcolor{keywordtype}{int} ret = 0;
336 353     \textcolor{keyword}{const} \textcolor{keywordtype}{char} *value = afb\_req\_value(request, \hyperlink{hs-client_8cpp_ae125cd80cb98582684636e46ecf33cac}{\_info});
337 354     \textcolor{keywordflow}{if}(value) \{
338 355         \hyperlink{include_2hmi-debug_8h_abc0d6e0760017d8ae48b836925b2ef15}{HMI\_NOTICE}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"info is %s"}, value);
339 356         \textcolor{keyword}{const} \textcolor{keywordtype}{char}* appid = afb\_req\_get\_application\_id(request);
340 357         \textcolor{keyword}{struct }json\_object* param\_obj = json\_object\_new\_object();
341 358         json\_object\_object\_add(param\_obj, \hyperlink{hs-client_8cpp_ae125cd80cb98582684636e46ecf33cac}{\_info}, json\_object\_new\_string(value));
342 359         \textcolor{keyword}{struct }json\_object* push\_obj = json\_object\_new\_object();
343 360         \hyperlink{hs-helper_8cpp_a8777c53f1d4d5412f19b134ad85ffedf}{hs\_add\_object\_to\_json\_object\_str}( push\_obj, 4, 
344       \hyperlink{homescreen_8cpp_a6a0e1db2562b442f8131ddf64b61d1ba}{\_application\_id}, appid, \hyperlink{hs-client_8cpp_a1c24b43242df87f75631175c75afdcda}{\_type}, \_\_FUNCTION\_\_);
345 361         json\_object\_object\_add(push\_obj, \hyperlink{hs-client_8cpp_ae3fc16098a2461f2f1ae0ac8561437c6}{\_parameter}, param\_obj);
346 362         afb\_event\_push(my\_event, push\_obj);
347 363     \}
348 364     \textcolor{keywordflow}{else} \{
349 365         \hyperlink{include_2hmi-debug_8h_abc0d6e0760017d8ae48b836925b2ef15}{HMI\_NOTICE}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"please input information."});
350 366         ret = \hyperlink{hs-helper_8h_aefe0d7ff8202f954693c235c1fb8e310}{AFB\_REQ\_SHOWINFORMATION\_ERROR};
351 367     \}
352 368 
353 369     \textcolor{keywordflow}{return} ret;
354 370 \}
355 \end{DoxyCode}
356 \index{H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}!show\+Notification@{show\+Notification}}
357 \index{show\+Notification@{show\+Notification}!H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}}
358 \subsubsection[{\texorpdfstring{show\+Notification(afb\+\_\+req\+\_\+t request)}{showNotification(afb_req_t request)}}]{\setlength{\rightskip}{0pt plus 5cm}int H\+S\+\_\+\+Client\+::show\+Notification (
359 \begin{DoxyParamCaption}
360 \item[{afb\+\_\+req\+\_\+t}]{request}
361 \end{DoxyParamCaption}
362 )}\hypertarget{class_h_s___client_a77b41c1bc6f2c939410108d821a0b456}{}\label{class_h_s___client_a77b41c1bc6f2c939410108d821a0b456}
363 show\+Notification event
364
365 input contents \+: \{\char`\"{}icon\char`\"{}\+: \char`\"{}icon path\char`\"{}, \char`\"{}text\char`\"{}\+: \char`\"{}message contents\char`\"{}\}
366
367 \subparagraph*{Parameters}
368
369
370 \begin{DoxyItemize}
371 \item request \+: the request
372 \end{DoxyItemize}
373
374 \subparagraph*{Return}
375
376 0 \+: success others \+: fail 
377
378 Definition at line 307 of file hs-\/client.\+cpp.
379
380
381 \begin{DoxyCode}
382 308 \{
383 309     \textcolor{keywordtype}{int} ret = 0;
384 310     \textcolor{keyword}{const} \textcolor{keywordtype}{char} *value = afb\_req\_value(request, \hyperlink{hs-client_8cpp_ad177811d47939fe9404de88672a980ab}{\_text});
385 311     \textcolor{keywordflow}{if}(value) \{
386 312         \hyperlink{include_2hmi-debug_8h_abc0d6e0760017d8ae48b836925b2ef15}{HMI\_NOTICE}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"text is %s"}, value);
387 313         \textcolor{keyword}{const} \textcolor{keywordtype}{char}* appid = afb\_req\_get\_application\_id(request);
388 314         \textcolor{keyword}{struct }json\_object* param\_obj = json\_object\_new\_object();
389 315         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *icon = afb\_req\_value(request, \hyperlink{hs-client_8cpp_a5476c8a51997c773220bec9fc02eeaf5}{\_icon});
390 316         \textcolor{keywordflow}{if}(icon) \{
391 317             json\_object\_object\_add(param\_obj, \hyperlink{hs-client_8cpp_a5476c8a51997c773220bec9fc02eeaf5}{\_icon}, json\_object\_new\_string(icon));
392 318             json\_object\_object\_add(param\_obj, \hyperlink{hs-client_8cpp_ad177811d47939fe9404de88672a980ab}{\_text}, json\_object\_new\_string(value));
393 319             \textcolor{keyword}{struct }json\_object* push\_obj = json\_object\_new\_object();
394 320             \hyperlink{hs-helper_8cpp_a8777c53f1d4d5412f19b134ad85ffedf}{hs\_add\_object\_to\_json\_object\_str}( push\_obj, 4, 
395       \hyperlink{homescreen_8cpp_a6a0e1db2562b442f8131ddf64b61d1ba}{\_application\_id}, appid, \hyperlink{hs-client_8cpp_a1c24b43242df87f75631175c75afdcda}{\_type}, \_\_FUNCTION\_\_);
396 321             json\_object\_object\_add(push\_obj, \hyperlink{hs-client_8cpp_ae3fc16098a2461f2f1ae0ac8561437c6}{\_parameter}, param\_obj);
397 322             afb\_event\_push(my\_event, push\_obj);
398 323         \}
399 324         \textcolor{keywordflow}{else} \{
400 325             \hyperlink{include_2hmi-debug_8h_abc0d6e0760017d8ae48b836925b2ef15}{HMI\_NOTICE}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"please input icon."});
401 326             ret = \hyperlink{hs-helper_8h_a057fc88b8445828c261305cf9107d99d}{AFB\_REQ\_SHOWNOTIFICATION\_ERROR};
402 327         \}
403 328     \}
404 329     \textcolor{keywordflow}{else} \{
405 330         \hyperlink{include_2hmi-debug_8h_abc0d6e0760017d8ae48b836925b2ef15}{HMI\_NOTICE}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"please input text."});
406 331         ret = \hyperlink{hs-helper_8h_a057fc88b8445828c261305cf9107d99d}{AFB\_REQ\_SHOWNOTIFICATION\_ERROR};
407 332     \}
408 333 
409 334     \textcolor{keywordflow}{return} ret;
410 335 \}
411 \end{DoxyCode}
412 \index{H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}!show\+Window@{show\+Window}}
413 \index{show\+Window@{show\+Window}!H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}}
414 \subsubsection[{\texorpdfstring{show\+Window(afb\+\_\+req\+\_\+t request, const char $\ast$appid)}{showWindow(afb_req_t request, const char *appid)}}]{\setlength{\rightskip}{0pt plus 5cm}int H\+S\+\_\+\+Client\+::show\+Window (
415 \begin{DoxyParamCaption}
416 \item[{afb\+\_\+req\+\_\+t}]{request, }
417 \item[{const char $\ast$}]{appid}
418 \end{DoxyParamCaption}
419 )}\hypertarget{class_h_s___client_af0f2be967a5b6ee81932c73b101184f7}{}\label{class_h_s___client_af0f2be967a5b6ee81932c73b101184f7}
420 show\+Window event
421
422 input contents \+: \{\char`\"{}application\+\_\+id\char`\"{}\+:\char`\"{}the appid that want to display\char`\"{}, \char`\"{}parameter\char`\"{}\+:\{\char`\"{}area\char`\"{}\+: \char`\"{}display area\char`\"{}, ...\}\}
423
424 \subparagraph*{Parameters}
425
426
427 \begin{DoxyItemize}
428 \item request \+: the request
429 \item appid \+: the appid that want to display
430 \end{DoxyItemize}
431
432 \subparagraph*{Return}
433
434 0 \+: success others \+: fail 
435
436 Definition at line 209 of file hs-\/client.\+cpp.
437
438
439 \begin{DoxyCode}
440 210 \{
441 211     \textcolor{keywordflow}{if}(!checkEvent(\_\_FUNCTION\_\_))
442 212         \textcolor{keywordflow}{return} 0;
443 213 
444 214     \hyperlink{include_2hmi-debug_8h_abc0d6e0760017d8ae48b836925b2ef15}{HMI\_NOTICE}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"%s application\_id = %s."}, \_\_FUNCTION\_\_, appid);
445 215     \textcolor{keyword}{struct }json\_object* push\_obj = json\_object\_new\_object();
446 216     \hyperlink{hs-helper_8cpp_a8777c53f1d4d5412f19b134ad85ffedf}{hs\_add\_object\_to\_json\_object\_str}( push\_obj, 4, 
447       \hyperlink{homescreen_8cpp_a6a0e1db2562b442f8131ddf64b61d1ba}{\_application\_id}, appid, \hyperlink{hs-client_8cpp_a1c24b43242df87f75631175c75afdcda}{\_type}, \_\_FUNCTION\_\_);
448 217     \textcolor{keyword}{const} \textcolor{keywordtype}{char}* param = afb\_req\_value(request, \hyperlink{hs-client_8cpp_ae3fc16098a2461f2f1ae0ac8561437c6}{\_parameter});
449 218     \textcolor{keywordflow}{if}(param) \{
450 219         \textcolor{keyword}{const} \textcolor{keywordtype}{char}* req\_appid = afb\_req\_get\_application\_id(request);
451 220         \textcolor{keyword}{struct }json\_object* param\_obj = json\_tokener\_parse(param);
452 221         json\_object\_object\_add(param\_obj, \hyperlink{hs-client_8cpp_ac5b722c0d87d2b0e3dfc527b44a1f5db}{\_replyto}, json\_object\_new\_string(req\_appid));
453 222         json\_object\_object\_add(push\_obj, \hyperlink{hs-client_8cpp_ae3fc16098a2461f2f1ae0ac8561437c6}{\_parameter}, param\_obj);
454 223     \}
455 224     \textcolor{keywordflow}{else} \{
456 225         \hyperlink{include_2hmi-debug_8h_a65bb6c7cfe38f8a724beab5059d36fb2}{HMI\_ERROR}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"please input correct parameter."});
457 226         \textcolor{keywordflow}{return} \hyperlink{hs-helper_8h_aa611e2ec24ef295bd87825889fe2ce5e}{AFB\_EVENT\_BAD\_REQUEST};
458 227     \}
459 228     afb\_event\_push(my\_event, push\_obj);
460 229     \textcolor{keywordflow}{return} 0;
461 230 \}
462 \end{DoxyCode}
463 \index{H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}!subscribe@{subscribe}}
464 \index{subscribe@{subscribe}!H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}}
465 \subsubsection[{\texorpdfstring{subscribe(afb\+\_\+req\+\_\+t request, const char $\ast$event)}{subscribe(afb_req_t request, const char *event)}}]{\setlength{\rightskip}{0pt plus 5cm}int H\+S\+\_\+\+Client\+::subscribe (
466 \begin{DoxyParamCaption}
467 \item[{afb\+\_\+req\+\_\+t}]{request, }
468 \item[{const char $\ast$}]{event}
469 \end{DoxyParamCaption}
470 )}\hypertarget{class_h_s___client_a3d000ca70bd4a8af7c4895d95bc7d0d0}{}\label{class_h_s___client_a3d000ca70bd4a8af7c4895d95bc7d0d0}
471 subscribe event
472
473 \subparagraph*{Parameters}
474
475
476 \begin{DoxyItemize}
477 \item event\+: homescreen event, tap\+\_\+shortcut etc.
478 \end{DoxyItemize}
479
480 \subparagraph*{Return}
481
482 result 
483
484 Definition at line 139 of file hs-\/client.\+cpp.
485
486
487 \begin{DoxyCode}
488 140 \{
489 141     \textcolor{keywordtype}{int} ret = 0;
490 142     \textcolor{keyword}{auto} ip = event\_list.find(std::string(event));
491 143     \textcolor{keywordflow}{if}(ip == event\_list.end()) \{
492 144         event\_list[std::string(event)] = 0;
493 145     \}
494 146     \textcolor{keywordflow}{if}(!subscription) \{
495 147         ret = afb\_req\_subscribe(request, my\_event);
496 148         \textcolor{keywordflow}{if}(ret == 0) \{
497 149             subscription = \textcolor{keyword}{true};
498 150         \}
499 151     \}
500 152     \textcolor{keywordflow}{return} ret;
501 153 \}
502 \end{DoxyCode}
503 \index{H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}!tap\+\_\+shortcut@{tap\+\_\+shortcut}}
504 \index{tap\+\_\+shortcut@{tap\+\_\+shortcut}!H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}}
505 \subsubsection[{\texorpdfstring{tap\+\_\+shortcut(const char $\ast$appid)}{tap_shortcut(const char *appid)}}]{\setlength{\rightskip}{0pt plus 5cm}int H\+S\+\_\+\+Client\+::tap\+\_\+shortcut (
506 \begin{DoxyParamCaption}
507 \item[{const char $\ast$}]{appid}
508 \end{DoxyParamCaption}
509 )}\hypertarget{class_h_s___client_a0d7fb8316248e8946dcb73a6612f21bb}{}\label{class_h_s___client_a0d7fb8316248e8946dcb73a6612f21bb}
510 push tap\+\_\+shortcut event
511
512 \subparagraph*{Parameters}
513
514
515 \begin{DoxyItemize}
516 \item appid\+: app\textquotesingle{}s id.
517 \end{DoxyItemize}
518
519 \subparagraph*{Return}
520
521 result 
522
523 Definition at line 70 of file hs-\/client.\+cpp.
524
525
526 \begin{DoxyCode}
527 71 \{
528 72     \textcolor{keywordflow}{if}(!checkEvent(\_\_FUNCTION\_\_))
529 73         \textcolor{keywordflow}{return} 0;
530 74 
531 75     \hyperlink{include_2hmi-debug_8h_abc0d6e0760017d8ae48b836925b2ef15}{HMI\_NOTICE}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"%s application\_id = %s."}, \_\_FUNCTION\_\_, appid);
532 76     \textcolor{keyword}{struct }json\_object* push\_obj = json\_object\_new\_object();
533 77     \hyperlink{hs-helper_8cpp_a8777c53f1d4d5412f19b134ad85ffedf}{hs\_add\_object\_to\_json\_object\_str}( push\_obj, 4, 
534       \hyperlink{homescreen_8cpp_a6a0e1db2562b442f8131ddf64b61d1ba}{\_application\_id}, appid,
535 78     \hyperlink{hs-client_8cpp_a1c24b43242df87f75631175c75afdcda}{\_type}, \_\_FUNCTION\_\_);
536 79     afb\_event\_push(my\_event, push\_obj);
537 80     \textcolor{keywordflow}{return} 0;
538 81 \}
539 \end{DoxyCode}
540 \index{H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}!unsubscribe@{unsubscribe}}
541 \index{unsubscribe@{unsubscribe}!H\+S\+\_\+\+Client@{H\+S\+\_\+\+Client}}
542 \subsubsection[{\texorpdfstring{unsubscribe(afb\+\_\+req\+\_\+t request, const char $\ast$event)}{unsubscribe(afb_req_t request, const char *event)}}]{\setlength{\rightskip}{0pt plus 5cm}int H\+S\+\_\+\+Client\+::unsubscribe (
543 \begin{DoxyParamCaption}
544 \item[{afb\+\_\+req\+\_\+t}]{request, }
545 \item[{const char $\ast$}]{event}
546 \end{DoxyParamCaption}
547 )}\hypertarget{class_h_s___client_a3da3b5662f918e11773da75f8f971d9c}{}\label{class_h_s___client_a3da3b5662f918e11773da75f8f971d9c}
548 unsubscribe event
549
550 \subparagraph*{Parameters}
551
552
553 \begin{DoxyItemize}
554 \item event\+: homescreen event, tap\+\_\+shortcut etc.
555 \end{DoxyItemize}
556
557 \subparagraph*{Return}
558
559 result 
560
561 Definition at line 165 of file hs-\/client.\+cpp.
562
563
564 \begin{DoxyCode}
565 166 \{
566 167     \textcolor{keywordtype}{int} ret = 0;
567 168     event\_list.erase(std::string(event));
568 169     \textcolor{keywordflow}{if}(event\_list.empty()) \{
569 170         ret = afb\_req\_unsubscribe(request, my\_event);
570 171     \}
571 172     \textcolor{keywordflow}{return} ret;
572 173 \}
573 \end{DoxyCode}
574
575
576 The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
577 \item 
578 src/\hyperlink{hs-client_8h}{hs-\/client.\+h}\item 
579 src/\hyperlink{hs-client_8cpp}{hs-\/client.\+cpp}\end{DoxyCompactItemize}