• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /***************************************************************************
2 *
3 * Copyright 2010,2011 BMW Car IT GmbH
4 * Copyright (c) 2012, NVIDIA CORPORATION.  All rights reserved.
5 *
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 *        http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 *
19 ****************************************************************************/
20 #ifndef _ILM_COMMON_H_
21 #define _ILM_COMMON_H_
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif /* __cplusplus */
26 
27 #include "ilm_types.h"
28 
29 /**
30  * \brief Initializes the IVI LayerManagement Client.
31  *        in case of wayland this API will create a connection to wayland server
32  *        and maintain own instance of the wl_display
33  * \ingroup ilmCommon
34  * \return ILM_SUCCESS if the method call was successful
35  * \return ILM_FAILED if a connection can not be established to the services.
36  */
37 ilmErrorTypes ilm_init(void);
38 
39 /**
40  * \brief Initializes the IVI LayerManagement Client.
41  *        in case of wayland nativedisplay is the wl_display and connection
42  *        will be created to the corresponding wayland server
43  * \ingroup ilmCommon
44  * \return ILM_SUCCESS if the method call was successful
45  * \return ILM_FAILED if a connection can not be established to the services.
46  */
47 ilmErrorTypes ilm_initWithNativedisplay(t_ilm_nativedisplay nativedisplay);
48 
49 /**
50  * \brief Returns initialization state of the IVI LayerManagement Client.
51  * \ingroup ilmCommon
52  * \return true if client library is initialized
53  * \return false if client library is not initialized
54  */
55 t_ilm_bool ilm_isInitialized(void);
56 
57 /**
58  * \brief Commit all changes and execute all enqueued commands since last commit.
59  *        All enqueued command on the server site will be executed,
60  *        regardless which client enqueued them
61  * \ingroup ilmCommon
62  * \return ILM_SUCCESS if the method call was successful
63  * \return ILM_FAILED if the client can not call the method on the service.
64  */
65 ilmErrorTypes ilm_commitChanges(void);
66 
67 /**
68  * \brief register for notification on an event of ilm shutdown
69  * \ingroup ilmCommon
70  * \param[in] callback pointer to function to be called for notification
71               callback function is defined as:
72               void cb(t_ilm_shutdown_error_type error_type, int errornum, void *user_data)
73  * \param[in] user_data pointer to data which will be passed to a notification callback
74  * \return ILM_SUCCESS if the method call was successful
75  * \return ILM_FAILED if the client can not call the method on the service.
76  */
77 ilmErrorTypes ilm_registerShutdownNotification(shutdownNotificationFunc callback,
78 					       void *user_data);
79 
80 /**
81  * \brief Destroys the IVI LayerManagement Client.
82  * \ingroup ilmCommon
83  * \return ILM_SUCCESS if the method call was successful
84  * \return ILM_FAILED if the client can not be closed or was not initialized.
85  */
86 ilmErrorTypes ilm_destroy(void);
87 
88 
89 
90 #ifdef __cplusplus
91 } /**/
92 #endif /* __cplusplus */
93 
94 #endif /* _ILM_COMMON_H_ */
95