Remove unused directories and files in video_in_hal
[staging/basesystem.git] / nsframework / framework_unified / client / include / native_service / frameworkunified__CWORD77__session_if.h
1 /*
2  * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 ////////////////////////////////////////////////////////////////////////////////
18 /// \ingroup  tag_HMI_CWORD77_Controller
19 /// \brief
20 ///
21 ////////////////////////////////////////////////////////////////////////////////
22 //@{
23 /**
24  * @file frameworkunified__CWORD77__session_if.h
25  * @brief \~english This file provides API for operating session
26  *
27  */
28 /** @addtogroup BaseSystem
29  *  @{
30  */
31 /** @addtogroup native_service
32  *  @ingroup BaseSystem
33  *  @{
34  */
35 /** @addtogroup framework_unified
36  *  @ingroup native_service
37  *  @{
38  */
39 /** @addtogroup _CWORD77_
40  *  @ingroup framework_unified
41  *  @{
42  */
43 #ifndef _FRAMEWORKUNIFIED__CWORD77_SESSION_H_  // NOLINT  (build/header_guard)
44 #define _FRAMEWORKUNIFIED__CWORD77_SESSION_H_
45
46 #include <native_service/ns__CWORD77__common.h>
47 #include <string>
48 #include <vector>
49
50 class CFrameworkunified_CWORD77_Session {
51  protected:
52   HANDLE m_hSession;    ///< Handle to session
53   HANDLE m_hApp;      ///< Handle to Framework
54   HANDLE m_hService;    ///< Handle to Service
55   UI_32  m_uiSessionType;  ///< Session Type
56   ResponseServiceTo_CWORD77_ m_ResponseTo_CWORD77_;   ///< Call back function pointer
57   std::vector<FrameworkunifiedProtocolCallbackHandler> m_vSessionProtocolHanlder;
58   std::vector<UI_32> m_vEventVector;
59   std::vector<FrameworkunifiedProtocolCallbackHandler> m_vSessionEventHandler;
60   ////////////////////////////////////////////////////////////////////////////////////////////
61   ///   AddProtocol
62   /// Function to add notification
63   ///
64   /// \param[in]  f_uiCmdId
65   ///     UI_32 - Command id
66   /// \param[in]  f_cbFuncPtr
67   ///     CbFuncPtr - Callback function pointer
68   /// \return None
69   ///
70   ////////////////////////////////////////////////////////////////////////////////////////////
71   void AddProtocolHandler(UI_32 f_uiCmdId, CbFuncPtr f_cbFuncPtr);
72   ////////////////////////////////////////////////////////////////////////////////////////////
73   ///   AttachProtocolwithDispatcher
74   /// API to Register Session 1 of Service A protocols with Dispatcher
75   ///
76   /// \param  [in] f_hApp
77   ///     HANDLE - Handle to the Framework
78   /// \return status
79   ///     EFrameworkunifiedStatus - Success or Error
80   ////////////////////////////////////////////////////////////////////////////////////////////
81   EFrameworkunifiedStatus AttachProtocolwithDispatcher(HANDLE f_hApp);
82   ////////////////////////////////////////////////////////////////////////////////////////////
83   ///   DetachProtocolwithDispatcher
84   /// API to Un Register Session 1 of Service A protocols with Dispatcher
85   ///
86   /// \param  [in] f_hApp
87   ///     HANDLE - Handle to the Framework
88   /// \return status
89   ///     EFrameworkunifiedStatus - Success or Error
90   ////////////////////////////////////////////////////////////////////////////////////////////
91   EFrameworkunifiedStatus DetachProtocolwithDispatcher(HANDLE f_hApp);
92   ////////////////////////////////////////////////////////////////////////////////////////////
93   ///   AttachEventswithDispatcher
94   /// Function to register events with dispatcher
95   ///
96   /// \param  [in] f_hApp
97   ///     HANDLE - Handle to the Framework
98   /// \return status
99   ///     EFrameworkunifiedStatus - Success or Error
100   ////////////////////////////////////////////////////////////////////////////////////////////
101   EFrameworkunifiedStatus AttachEventswithDispatcher(HANDLE f_hApp);
102   ////////////////////////////////////////////////////////////////////////////////////////////
103   ///   RegisterEvents
104   /// Function to register events
105   ///
106   /// \param  [in] f_hApp
107   ///     HANDLE - Handle to the Framework
108   /// \return status
109   ///     EFrameworkunifiedStatus - Success or Error
110   ////////////////////////////////////////////////////////////////////////////////////////////
111   EFrameworkunifiedStatus RegisterEvents(HANDLE f_hApp);  // Function: added by Shyam to overcome
112   /// the naming conflict in registering the event
113
114   ////////////////////////////////////////////////////////////////////////////////////////////
115   ///   AttachEventHandlerswithDispatcher
116   /// API to Register Session 1 of Service A protocols with Dispatcher
117   ///
118   /// \param  [in] f_hApp
119   ///     HANDLE - Handle to the Framework
120   /// \return status
121   ///     EFrameworkunifiedStatus - Success or Error
122   ////////////////////////////////////////////////////////////////////////////////////////////
123   EFrameworkunifiedStatus AttachEventHandlerswithDispatcher(HANDLE f_hApp);
124   ////////////////////////////////////////////////////////////////////////////////////////////
125   ///   DetachEventHandlerswithDispatcher
126   /// API to Un Register Session 1 of Service A protocols with Dispatcher
127   ///
128   /// \param  [in] f_hApp
129   ///     HANDLE - Handle to the Framework
130   /// \return status
131   ///     EFrameworkunifiedStatus - Success or Error
132   ////////////////////////////////////////////////////////////////////////////////////////////
133   EFrameworkunifiedStatus DetachEventHandlerswithDispatcher(HANDLE f_hApp);
134   ////////////////////////////////////////////////////////////////////////////////////////////
135   ///   AddEventHandler
136   /// Function to add event handler
137   ///
138   /// \param[in]  f_uiCmdId
139   ///     UI_32 - Command id
140   /// \param[in]  f_cbFuncPtr
141   ///     CbFuncPtr - Callback function pointer
142   /// \return None
143   ///
144   ////////////////////////////////////////////////////////////////////////////////////////////
145   void AddEventHandler(UI_32 f_uiCmdId, CbFuncPtr f_cbFuncPtr);
146
147  public:
148   ////////////////////////////////////////////////////////////////////////////////////////////
149   /// \ingroup CFrameworkunified_CWORD77_Session
150   /// \~english @par Brief
151   ///        Constructor for CFrameworkunified_CWORD77_Session
152   /// \~english @retval none
153   /// \~english @par Preconditons
154   ///           no preconditions
155   /// \~english @par Change of internal status
156   ///           none
157   /// \~english @par Conditions of processing failure
158   ///           none
159   /// \~english @par Detail
160   ///           Create CFrameworkunified_CWORD77_Session instance and initialize the member parameter(m_hSession, m_hApp,m_hService,\n
161   ///           m_uiSessionType)
162   /// \~english @par Classification
163   ///           public
164   /// \~english @par Type
165   ///           none
166   /// \~english @see ~CFrameworkunified_CWORD77_Session
167   ////////////////////////////////////////////////////////////////////////////////////////////
168   CFrameworkunified_CWORD77_Session();
169
170   ////////////////////////////////////////////////////////////////////////////////////////////
171   /// \ingroup CFrameworkunified_CWORD77_Session
172   /// \~english @par Brief
173   ///        Destructor for CFrameworkunified_CWORD77_Session
174   /// \~english @retval none
175   /// \~english @par Preconditons
176   ///                CFrameworkunified_CWORD77_Session is decleared in constructor
177   /// \~english @par Change of internal status
178   ///                none
179   /// \~english @par Conditions of processing failure
180   ///                none
181   /// \~english @par Detail
182   ///                Release CFrameworkunified_CWORD77_Session class instance
183   /// \~english @par Classification
184   ///                public
185   /// \~english @par Type
186   ///                none
187   /// \~english @see CFrameworkunified_CWORD77_Session
188   ////////////////////////////////////////////////////////////////////////////////////////////
189   virtual ~CFrameworkunified_CWORD77_Session();
190
191   ////////////////////////////////////////////////////////////////////////////////////////////
192   /// \ingroup CFrameworkunified_CWORD77_Session
193   /// \~english @par Brief
194   ///         send specific command by session
195   /// \~english @param [in] cmdID
196   ///           cmdID - commond id
197   /// \~english @par
198   ///           cmdID   UI_32
199   /// \~english @retval EFrameworkunifiedStatus
200   ///           eFrameworkunifiedStatusOK or failed
201   /// \~english @par Preconditons
202   ///        - no preconditions
203   /// \~english @par Change of internal status
204   ///        -  none
205   /// \~english @par Conditions of processing failure
206   ///       -   GetReqDataFrom_CWORD77_DataPool() failed [eFrameworkunifiedStatusDbRecNotFound]
207   ///       -   FrameworkunifiedSendMsg() failed
208   ///       -   if m_hSession is NULL. [eFrameworkunifiedStatusSessionErr]
209   /// \~english @par Detail
210   ///         send specified commond by session.
211   /// \~english @par Classification
212   ///          public
213   /// \~english @par Type
214   ///          sync only
215   /// \~english @see GetReqDataFrom_CWORD77_DataPool
216   ////////////////////////////////////////////////////////////////////////////////////////////
217   // virtual EFrameworkunifiedStatus HandleSessionMessage(UI_32 cmdID);
218   EFrameworkunifiedStatus HandleSessionMessage(UI_32 cmdID);
219
220   ////////////////////////////////////////////////////////////////////////////////////////////
221   /// \ingroup CFrameworkunified_CWORD77_Session
222   /// \~english @par Brief
223   ///           Set Call back function in Session
224   /// \~english @param [in] fptr
225   ///           fptr - Pointer to call back function
226   /// \~english @par
227   ///           fptr   ResponseServiceTo_CWORD77_*
228   /// \~english @retval none
229   /// \~english @par Preconditons
230   ///        - no preconditions
231   /// \~english @par Change of internal status
232   ///        -  set callback into m_ResponseTo_CWORD77_.
233   /// \~english @par Conditions of processing failure
234   ///        - none
235   /// \~english @par Detail
236   ///          Set Call back function in Session
237   /// \~english @par Classification
238   ///          public
239   /// \~english @par Type
240   ///          sync only
241   /// \~english @see
242   ////////////////////////////////////////////////////////////////////////////////////////////
243   void SetResponseCallback(ResponseServiceTo_CWORD77_ fptr);
244
245   ////////////////////////////////////////////////////////////////////////////////////////////
246   /// \ingroup CFrameworkunified_CWORD77_Session
247   /// \~english @par Brief
248   ///          function to Open Session.(pure virtual function)
249   /// \~english @param [in] f_hApp
250   ///           f_hApp - Handle of framework
251   /// \~english @par
252   ///           f_hApp   HANDLE*
253   /// \~english @param [in] f_sServiceName
254   ///           f_sServiceName - Service Name
255   /// \~english @par
256   ///           f_sServiceName   std::string
257   /// \~english @retval EFrameworkunifiedStatus
258   ///            Success or Error
259   /// \~english @par Preconditons
260   ///        - no preconditions
261   /// \~english @par Change of internal status
262   ///        -  none
263   /// \~english @par Conditions of processing failure
264   ///        - none
265   /// \~english @par Detail
266   /// \~english @par Classification
267   ///          public
268   /// \~english @par Type
269   ///          none
270   /// \~english @see
271   ////////////////////////////////////////////////////////////////////////////////////////////
272   virtual EFrameworkunifiedStatus OpenSession(HANDLE f_hApp, std::string f_sServiceName) = 0;
273
274   ////////////////////////////////////////////////////////////////////////////////////////////
275   /// \ingroup CFrameworkunified_CWORD77_Session
276   /// \~english @par Brief
277   ///          function to close Session.(pure virtual function)
278   /// \~english @param [in] f_hApp
279   ///           f_hApp - Handle of framework
280   /// \~english @par
281   ///           f_hApp   HANDLE*
282   /// \~english @retval EFrameworkunifiedStatus
283   ///            Success or Error
284   /// \~english @par Preconditons
285   ///        - no preconditions
286   /// \~english @par Change of internal status
287   ///        -  none
288   /// \~english @par Conditions of processing failure
289   ///        -  none
290   /// \~english @par Detail
291   ///        - none
292   /// \~english @par Classification
293   ///          public
294   /// \~english @par Type
295   ///          none
296   /// \~english @see
297   ////////////////////////////////////////////////////////////////////////////////////////////
298   virtual EFrameworkunifiedStatus CloseSession(HANDLE f_hApp) = 0;
299
300   ////////////////////////////////////////////////////////////////////////////////////////////
301   /// \ingroup CFrameworkunified_CWORD77_Session
302   /// \~english @par Brief
303   ///          Open Session acknowledge.(pure virtual function)
304   /// \~english @param [in] f_hApp
305   ///           f_hApp - Handle of framework
306   /// \~english @par
307   ///           f_hApp   HANDLE*
308   /// \~english @retval EFrameworkunifiedStatus
309   ///            Success or Error
310   /// \~english @par Preconditons
311   ///        - no preconditions
312   /// \~english @par Change of internal status
313   ///        -  none
314   /// \~english @par Conditions of processing failure
315   ///        - none
316   /// \~english @par Detail
317   ///        -none
318   /// \~english @par Classification
319   ///          public
320   /// \~english @par Type
321   ///          none
322   /// \~english @see
323   ////////////////////////////////////////////////////////////////////////////////////////////
324   virtual EFrameworkunifiedStatus OpenSessionAcknowledge(HANDLE f_hApp) = 0;
325   ////////////////////////////////////////////////////////////////////////////////////////////
326   ///   GetSessionType
327   /// API to get session type
328   ///
329   /// \return UI_32 - Session type
330   ///     EFrameworkunifiedStatus - Success or Error
331   ////////////////////////////////////////////////////////////////////////////////////////////
332
333   ////////////////////////////////////////////////////////////////////////////////////////////
334   /// \ingroup CFrameworkunified_CWORD77_Session
335   /// \~english @par Brief
336   ///          API to get session type
337   /// \~english @param none
338   /// \~english @retval UI_32 - Session type
339   /// \~english @par Preconditons
340   ///        - no preconditions
341   /// \~english @par Change of internal status
342   ///        -  none
343   /// \~english @par Conditions of processing failure
344   ///        - none
345   /// \~english @par Detail
346   ///           API to get session type.\n
347   /// \~english @par Classification
348   ///          public
349   /// \~english @par Type
350   ///          sync only
351   /// \~english @see
352   ////////////////////////////////////////////////////////////////////////////////////////////
353   UI_32 GetSessionType();
354
355   ////////////////////////////////////////////////////////////////////////////////////////////
356   /// \ingroup CFrameworkunified_CWORD77_Session
357   /// \~english @par Brief
358   ///        API to set session type into class CFrameworkunified_CWORD77_Session object.
359   /// \~english @param[in] sessioType
360   ///        const UI_32& - Session type
361   /// \~english @retval none
362   /// \~english @par Preconditons
363   ///            none
364   /// \~english @par Change of internal status
365   ///            none
366   /// \~english @par Conditions of processing failure
367   ///            none
368   /// \~english @par Detail
369   ///            API to set session type into class CFrameworkunified_CWORD77_Session object.
370   /// \~english @par Classification
371   ///            public
372   /// \~english @par Type
373   ///            sync only
374   /// \~english @see
375   ///            none
376   ////////////////////////////////////////////////////////////////////////////////////////////
377   void SetSessionType(const UI_32 &sessioType);
378
379   ////////////////////////////////////////////////////////////////////////////////////////////
380   /// \ingroup CFrameworkunified_CWORD77_Session
381   /// \~english @par Brief
382   ///        declear callback funcion into Dispatcher
383   /// \~english @param[in] hApp
384   ///        HANDLE - Handle to Application
385   /// \~english @retval none
386   /// \~english @par Preconditons
387   ///            no precondition
388   /// \~english @par Change of internal status
389   ///            none
390   /// \~english @par Conditions of processing failure
391   ///            none
392   /// \~english @par Detail
393   ///           declear OnResponse() of callback function by calling FrameworkunifiedAttachCallbackToDispatcher()\n
394   ///           get decleared protocol ID through GetResponseProtocolArray()\n
395   ///           get decleared event ID through GetEventArray() and regist event-sending instance in FrameworkunifiedRegisterEvent
396   /// \~english @par
397   ///           cautions in using this API:\n
398   ///           -Registrition will fail without msg When Application handle is uncorrect set by parameter\n
399   ///           -Registrition process in FrameworkunifiedAttachCallbackToDispatcher() will not commit when
400   ///           GetResponseProtocolArray()\n
401   ///            or GetEventArray() returns NULL or NULL list
402   /// \~english @par Classification
403   ///            public
404   /// \~english @par Type
405   ///            none
406   /// \~english @see FrameworkunifiedAttachCallbackToDispatcher, FrameworkunifiedRegisterEvent,
407   ///                GetResponseProtocolArray, GetEventArray, OnResponse
408   ////////////////////////////////////////////////////////////////////////////////////////////
409   void AttachResponseCallbacks(HANDLE hApp);
410
411   ////////////////////////////////////////////////////////////////////////////////////////////
412   /// \ingroup CFrameworkunified_CWORD77_Session
413   /// \~english @par Brief
414   ///           unscrible dispatcher callback function
415   /// \~english @param[in] hApp
416   ///        HANDLE - Handle to Application
417   /// \~english @retval none
418   /// \~english @par Preconditons
419   ///                no preconditions
420   /// \~english @par Change of internal status
421   ///                none
422   /// \~english @par Conditions of processing failure
423   ///                none
424   /// \~english @par Detail
425   ///           declear OnResponse() of callback function by calling FrameworkunifiedDetachCallbackFromDispatcher()\n
426   ///           get unregistrition protocol ID through GetResponseProtocolArray()\n
427   ///           get unregistrition event ID through GetEventArray() and unregist event-sending instance in \n
428   ///           FrameworkunifiedUnRegisterEvent()
429   /// \~english @par Detail
430   ///            cautions in using this API:\n
431   ///           -Unregistrition will fail without msg When Application handle is uncorrect set by parameter\n
432   ///           -Unregistrition process in FrameworkunifiedDetachCallbackFromDispatcher() will not commit when
433   ///           GetResponseProtocolArray()\n
434   ///            or GetEventArray() returns NULL or NULL list
435   /// \~english @par Classification
436   ///           public
437   /// \~english @par Type
438   ///           none
439   /// \~english @see FrameworkunifiedDetachCallbackFromDispatcher, FrameworkunifiedUnRegisterEvent,
440   ///                GetResponseProtocolArray, GetEventArray
441   ////////////////////////////////////////////////////////////////////////////////////////////
442   void DetachResponseCallbacks(HANDLE hApp);
443
444   ////////////////////////////////////////////////////////////////////////////////////////////
445   ///   OnResponse
446   /// Callback function on receiving response protocol or event specified in the list, returned
447   /// by either \ref GetResponseProtocolArray or \ref GetEventArray
448   ///
449   /// \param  [in] hApp
450   ///     HANDLE - Handle to framework
451   /// \return None
452   ////////////////////////////////////////////////////////////////////////////////////////////
453
454   ////////////////////////////////////////////////////////////////////////////////////////////
455   /// \ingroup CFrameworkunified_CWORD77_Session
456   /// \~english @par Brief
457   ///        Callback function on receiving response protocol or event specified in the list, returned
458   ///            by either \ref GetResponseProtocolArray or \ref GetEventArray
459   /// \~english @param [in] f_hApp
460   ///           HANDLE - Handle of framework
461
462   /// \~english @retval EFrameworkunifiedStatus
463   ///            SuceFrameworkunifiedStatusOK or eFrameworkunifiedStatusNullPointer
464   /// \~english @par Preconditions
465   ///        -  no preconditions
466   /// \~english @par Change of internal status
467   ///        - framework handler is invalid handler.[eFrameworkunifiedStatusNullPointer]
468   /// \~english @par Conditions of processing failure
469   ///        - none
470   /// \~english @par Detail
471   ///        Callback function on receiving response protocol or event specified in the list, returned
472   ///            by either \ref GetResponseProtocolArray or \ref GetEventArray
473   /// \~english @par Classification
474   ///          public
475   /// \~english @par Type
476   ///          none
477   /// \~english @see FrameworkunifiedGetMsgDataOfSize
478   ////////////////////////////////////////////////////////////////////////////////////////////
479   EFrameworkunifiedStatus OnResponse(HANDLE hApp);
480
481   // FIXME: Following set of functions should be pure virtual functions.
482   // But, in order to avoid build errors for HMI__CWORD77_, it is defined as virtual functions only.
483   // Because nobody who is currently deriving off of frameworkunified__CWORD77__session_if.h has these functions implemented.
484   virtual UI_32 const *GetResponseProtocolArray() = 0;
485   virtual UI_32 const GetResponseProtocolArrayLength() = 0;
486   virtual UI_32 const *GetEventArray() = 0;
487   virtual UI_32 const GetEventArrayLength() = 0;
488 };
489
490 #endif   // _FRAMEWORKUNIFIED__CWORD77_SESSION_H_  NOLINT  (build/header_guard)
491 /** @}*/
492 /** @}*/
493 /** @}*/
494 /** @}*/
495 //@}