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}}
5 {\ttfamily \#include $<$hs-\/client.\+h$>$}
7 \subsection*{Public Member Functions}
8 \begin{DoxyCompactItemize}
10 \hyperlink{class_h_s___client_a0afac6b86b9a72e74846e47e435f5f90}{H\+S\+\_\+\+Client} (afb\+\_\+req\+\_\+t request, const char $\ast$id)
12 \hyperlink{class_h_s___client_a47cb0035116ac7be4fffcfc9736e9233}{H\+S\+\_\+\+Client} (afb\+\_\+req\+\_\+t request, std\+::string id)
14 \hyperlink{class_h_s___client_a429a4697767344f3789bb233bc73a2b9}{H\+S\+\_\+\+Client} (\hyperlink{class_h_s___client}{H\+S\+\_\+\+Client} \&)=delete
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
18 \hyperlink{class_h_s___client_ab29a9e899aaec3c21983c24ec6e5ee70}{$\sim$\+H\+S\+\_\+\+Client} ()
20 int \hyperlink{class_h_s___client_a0d7fb8316248e8946dcb73a6612f21bb}{tap\+\_\+shortcut} (const char $\ast$appid)
22 int \hyperlink{class_h_s___client_af0f2be967a5b6ee81932c73b101184f7}{show\+Window} (afb\+\_\+req\+\_\+t request, const char $\ast$appid)
24 int \hyperlink{class_h_s___client_ac29482ffdf1b27733247ba0ffcc28b76}{hide\+Window} (afb\+\_\+req\+\_\+t request)
26 int \hyperlink{class_h_s___client_a294e461500ef02aed17ed5d91479f6b9}{reply\+Show\+Window} (afb\+\_\+req\+\_\+t request, const char $\ast$appid)
28 int \hyperlink{class_h_s___client_a274301617c9ab629d6916c0dde8c40b9}{on\+\_\+screen\+\_\+message} (afb\+\_\+req\+\_\+t request, const char $\ast$message)
30 int \hyperlink{class_h_s___client_a9f7a30840c95b1348bcce4cd4626b2ae}{on\+\_\+screen\+\_\+reply} (afb\+\_\+req\+\_\+t request, const char $\ast$message)
32 int \hyperlink{class_h_s___client_a3d000ca70bd4a8af7c4895d95bc7d0d0}{subscribe} (afb\+\_\+req\+\_\+t request, const char $\ast$event)
34 int \hyperlink{class_h_s___client_a3da3b5662f918e11773da75f8f971d9c}{unsubscribe} (afb\+\_\+req\+\_\+t request, const char $\ast$event)
36 int \hyperlink{class_h_s___client_a77b41c1bc6f2c939410108d821a0b456}{show\+Notification} (afb\+\_\+req\+\_\+t request)
38 int \hyperlink{class_h_s___client_a7145c14a7a971b45f647a82e3390ce9c}{show\+Information} (afb\+\_\+req\+\_\+t request)
39 \end{DoxyCompactItemize}
42 \subsection{Detailed Description}
45 Definition at line 25 of file hs-\/client.\+h.
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}
60 Definition at line 27 of file hs-\/client.\+h.
64 27 : \hyperlink{class_h_s___client_a0afac6b86b9a72e74846e47e435f5f90}{HS\_Client}(request, std::string(\textcolor{keywordtype}{id}))\{\}
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
76 \subparagraph*{Parameters}
80 \item id\+: app\textquotesingle{}s id
83 \subparagraph*{Return}
87 Definition at line 38 of file hs-\/client.\+cpp.
91 38 : my\_id(\textcolor{keywordtype}{id})
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());
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}
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
113 \subparagraph*{Parameters}
120 \subparagraph*{Return}
124 Definition at line 54 of file hs-\/client.\+cpp.
129 56 \hyperlink{include_2hmi-debug_8h_abc0d6e0760017d8ae48b836925b2ef15}{HMI\_NOTICE}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"called."});
130 57 afb\_event\_unref(my\_event);
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}
145 input contents \+: \{\char`\"{}application\+\_\+id\char`\"{}\+:\char`\"{}the appid that want to hide\char`\"{}\}
147 \subparagraph*{Parameters}
151 \item request \+: the request
154 \subparagraph*{Return}
156 0 \+: success others \+: fail
158 Definition at line 245 of file hs-\/client.\+cpp.
163 247 \textcolor{keywordflow}{if}(!checkEvent(\_\_FUNCTION\_\_))
164 248 \textcolor{keywordflow}{return} 0;
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;
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
186 \subparagraph*{Parameters}
190 \item message\+: post message.
193 \subparagraph*{Return}
197 Definition at line 93 of file hs-\/client.\+cpp.
202 95 \textcolor{keywordflow}{if}(!checkEvent(\_\_FUNCTION\_\_))
203 96 \textcolor{keywordflow}{return} 0;
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;
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
224 \subparagraph*{Parameters}
228 \item message\+: reply message.
231 \subparagraph*{Return}
235 Definition at line 116 of file hs-\/client.\+cpp.
240 118 \textcolor{keywordflow}{if}(!checkEvent(\_\_FUNCTION\_\_))
241 119 \textcolor{keywordflow}{return} 0;
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;
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
269 input contens \+: \{\char`\"{}application\+\_\+id\char`\"{}\+: \char`\"{}the appid that want to reply\char`\"{}, \char`\"{}parameter\char`\"{}\+: \{...\}\}
271 \subparagraph*{Parameters}
275 \item request \+: the request
276 \item appid \+: the appid that want to reply
279 \subparagraph*{Return}
281 0 \+: success others \+: fail
283 Definition at line 273 of file hs-\/client.\+cpp.
288 275 \textcolor{keywordflow}{if}(!checkEvent(\_\_FUNCTION\_\_))
289 276 \textcolor{keywordflow}{return} 0;
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));
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};
304 290 afb\_event\_push(my\_event, push\_obj);
305 291 \textcolor{keywordflow}{return} 0;
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
317 input contents \+: \{\char`\"{}info\char`\"{}\+: \char`\"{}information contents\char`\"{}\}
319 \subparagraph*{Parameters}
323 \item request \+: the request
326 \subparagraph*{Return}
328 0 \+: success others \+: fail
330 Definition at line 350 of file hs-\/client.\+cpp.
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);
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};
353 369 \textcolor{keywordflow}{return} ret;
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
365 input contents \+: \{\char`\"{}icon\char`\"{}\+: \char`\"{}icon path\char`\"{}, \char`\"{}text\char`\"{}\+: \char`\"{}message contents\char`\"{}\}
367 \subparagraph*{Parameters}
371 \item request \+: the request
374 \subparagraph*{Return}
376 0 \+: success others \+: fail
378 Definition at line 307 of file hs-\/client.\+cpp.
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);
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};
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};
409 334 \textcolor{keywordflow}{return} ret;
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}
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`\"{}, ...\}\}
424 \subparagraph*{Parameters}
428 \item request \+: the request
429 \item appid \+: the appid that want to display
432 \subparagraph*{Return}
434 0 \+: success others \+: fail
436 Definition at line 209 of file hs-\/client.\+cpp.
441 211 \textcolor{keywordflow}{if}(!checkEvent(\_\_FUNCTION\_\_))
442 212 \textcolor{keywordflow}{return} 0;
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);
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};
459 228 afb\_event\_push(my\_event, push\_obj);
460 229 \textcolor{keywordflow}{return} 0;
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}
473 \subparagraph*{Parameters}
477 \item event\+: homescreen event, tap\+\_\+shortcut etc.
480 \subparagraph*{Return}
484 Definition at line 139 of file hs-\/client.\+cpp.
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;
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};
500 152 \textcolor{keywordflow}{return} ret;
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
512 \subparagraph*{Parameters}
516 \item appid\+: app\textquotesingle{}s id.
519 \subparagraph*{Return}
523 Definition at line 70 of file hs-\/client.\+cpp.
528 72 \textcolor{keywordflow}{if}(!checkEvent(\_\_FUNCTION\_\_))
529 73 \textcolor{keywordflow}{return} 0;
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;
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}
550 \subparagraph*{Parameters}
554 \item event\+: homescreen event, tap\+\_\+shortcut etc.
557 \subparagraph*{Return}
561 Definition at line 165 of file hs-\/client.\+cpp.
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);
571 172 \textcolor{keywordflow}{return} ret;
576 The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
578 src/\hyperlink{hs-client_8h}{hs-\/client.\+h}\item
579 src/\hyperlink{hs-client_8cpp}{hs-\/client.\+cpp}\end{DoxyCompactItemize}