1 /***************************************************************************
3 * Copyright 2010,2011 BMW Car IT GmbH
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 ****************************************************************************/
20 #ifndef _COMMANDEXECUTOR_H_
21 #define _COMMANDEXECUTOR_H_
23 #include "RendererList.h"
24 #include "CommunicatorList.h"
25 #include "SceneProviderList.h"
26 #include "ApplicationReferenceMap.h"
27 #include "LayerType.h"
28 #include "ObjectType.h"
29 #include "CommandList.h"
30 #include "NotificationQueue.h"
38 * \brief Interface for LayerManagement Command Executors
40 * \defgroup ServiceAPI Layer Management Service API
42 * Objects who implement this interface can be used to have command objects
43 * executed. Communication classes must only know this interface of a class to
44 * be able to pass along command objects.
46 * \note This interface is used to reduce dependency of communicators on the
47 * main layermanagement component
49 class ICommandExecutor
53 * \brief default destructor
56 virtual ~ICommandExecutor() {}
59 * \brief Have a command processed.
61 * \param[in] commandToBeExecuted The command to be processed
62 * \return TRUE: execution of command successful
63 * \return FALSE: execution of command failed
65 virtual bool execute(ICommand* commandToBeExecuted) = 0;
68 * \brief start layer management
70 * \return TRUE: start management successful
71 * \return FALSE: start management failed
73 virtual bool startManagement() = 0;
76 * \brief stop layer management
78 * \return TRUE: stopped management successfully
79 * \return FALSE: stopping management failed
81 virtual bool stopManagement() = 0;
84 * \brief get handle to scene data structure
86 * \return Pointer to the internal scene data structure
88 virtual Scene* getScene(void) = 0;
90 // renderer management
93 * \brief get list of renderer plugins currently used
95 * \return Pointer to list of renderer plugins
97 virtual RendererList* getRendererList(void) = 0;
100 * \brief add a renderer to be used for layer management
101 * \ingroup ServiceAPI
102 * \param[in] renderer pointer to renderer object
104 virtual void addRenderer(IRenderer* renderer) = 0;
107 * \brief remove renderer from layer management
108 * \ingroup ServiceAPI
109 * \param[in] renderer pointer to renderer object
111 virtual void removeRenderer(IRenderer* renderer) = 0;
113 // communicator management
116 * \brief get list of communicator plugins currently used
117 * \ingroup ServiceAPI
118 * \return Pointer to internal list of communicators
120 virtual CommunicatorList* getCommunicatorList(void) = 0;
124 * \brief add a communicator to be used for layer management
125 * \ingroup ServiceAPI
126 * \param[in] communicator pointer to communicator object
128 virtual void addCommunicator(ICommunicator* communicator) = 0;
132 * \brief remove communicator from layer management
133 * \ingroup ServiceAPI
134 * \param[in] communicator pointer to communicator object
136 virtual void removeCommunicator(ICommunicator* communicator) = 0;
138 // scene provider management
141 * \brief get list of scene provider plugins currently used
142 * \ingroup ServiceAPI
143 * \return Pointer to internal list of communicators
145 virtual SceneProviderList* getSceneProviderList(void) = 0;
149 * \brief add a scene provider to be used for layer management
150 * \ingroup ServiceAPI
151 * \param[in] sceneProvider pointer to scene provider object
153 virtual void addSceneProvider(ISceneProvider* sceneProvider) = 0;
157 * \brief remove scene provider from layer management
158 * \ingroup ServiceAPI
159 * \param[in] sceneProvider pointer to scene provider object
161 virtual void removeSceneProvider(ISceneProvider* sceneProvider) = 0;
163 // client application management
166 * \brief get map of currently registered applications
167 * \ingroup ServiceAPI
168 * \return map of currently registered applications
170 virtual ApplicationReferenceMap* getApplicationReferenceMap(void) = 0;
173 * \brief add application to list of currently registered applications
174 * \ingroup ServiceAPI
175 * \param[in] client handle to connected client application
176 * \param[in] applicationReference pointer to application object
178 virtual void addApplicationReference(t_ilm_client_handle client, IApplicationReference* applicationReference) = 0;
181 * \brief remove application from list of currently registered applications
182 * \ingroup ServiceAPI
183 * \param[in] client handle to connected client application
185 virtual void removeApplicationReference(t_ilm_client_handle client) = 0;
188 * \brief get pid of a connected application
189 * \ingroup ServiceAPI
190 * \param[in] client client handle to get process id for
192 virtual t_ilm_uint getSenderPid(t_ilm_client_handle client) = 0;
195 * \brief get name of a connected application
196 * \ingroup ServiceAPI
197 * \param[in] client client handle to get process name for
199 virtual const char* getSenderName(t_ilm_client_handle client) = 0;
202 * \brief get name of a connected application
203 * \ingroup ServiceAPI
204 * \param[in] pid process id to get process name for
206 virtual const char* getSenderName(unsigned int pid) = 0;
209 * \brief get capabilities of layer type
210 * \ingroup ServiceAPI
211 * \param[in] layertype layer type
212 * \return bitmask with capability flags set according to layer type capabilities
213 * \todo removable, use default command processing
215 virtual unsigned int getLayerTypeCapabilities(const LayerType layertype) const = 0;
218 * \brief get number of supported hardware layers for screen
219 * \ingroup ServiceAPI
220 * \param[in] screenID id of screen
221 * \return number of supported hardware layers for screen
222 * \todo removable, use default command processing
224 virtual unsigned int getNumberOfHardwareLayers(const unsigned int screenID) const = 0;
227 * \brief get resolution of screen
228 * \ingroup ServiceAPI
229 * \param[in] screenID id of screen
230 * \return array of integer with width and height of screen
231 * \todo removable, use default command processing
233 virtual unsigned int* getScreenResolution(const unsigned int screenID) const = 0;
236 * \brief get list of available screens
237 * \ingroup ServiceAPI
238 * \param[out] length of returned array
239 * \return list of screen ids
240 * \todo removable, use default command processing
242 virtual unsigned int* getScreenIDs(unsigned int* length) const = 0;
245 * \brief add a notification for an updated scene element
246 * \ingroup ServiceAPI
247 * \param[in] object pointer to updated scene element, e.g. layer or surface
248 * \param[in] mask bitmask indicating which property of scene element was udpated
250 virtual void addClientNotification(GraphicalObject* object, t_ilm_notification_mask mask) = 0;
253 * \brief get the list of updated scene elements
254 * \ingroup ServiceAPI
255 * \return reference to current list of updated scene elements
257 virtual NotificationQueue& getClientNotificationQueue() = 0;
260 * \brief get the list of enqueued commands for a client
261 * \ingroup ServiceAPI
262 * \param[in] clientPid process id of client
263 * \return Reference to command list for client
265 virtual CommandList& getEnqueuedCommands(unsigned int clientPid) = 0;
268 * \brief get system health state
269 * \ingroup ServiceAPI
270 * \return system health condition
272 virtual HealthCondition getHealth() = 0;
275 #endif /* _COMMANDEXECUTOR_H_ */