Bug #100 - update of interface version numbers and added removed comments
[profile/ivi/genivi/genivi-audio-manager.git] / include / command / IAmCommandSend.h
1 /**
2  * Copyright (C) 2012 - 2014, BMW AG
3  *
4  * This file is part of GENIVI Project AudioManager.
5  *
6  * Contributions are licensed to the GENIVI Alliance under one or more
7  * Contribution License Agreements.
8  *
9  * \copyright
10  * This Source Code Form is subject to the terms of the
11  * Mozilla Public License, v. 2.0. If a  copy of the MPL was not distributed with
12  * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
13  *
14  *
15  * \author Christian Linke, christian.linke@bmw.de BMW 2011 - 2014
16  *
17  * \file
18  * For further information see http://projects.genivi.org/audio-manager
19  *
20  * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. 
21  * PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN.
22  */
23 #if !defined(EA_B654431C_A920_4376_9B2F_3FF803354EAD__INCLUDED_)
24 #define EA_B654431C_A920_4376_9B2F_3FF803354EAD__INCLUDED_
25
26 #include <vector>
27 #include <string>
28 #include "audiomanagertypes.h"
29 namespace am {
30 class IAmCommandReceive;
31 }
32
33 #include "IAmCommandReceive.h"
34 #include "audiomanagertypes.h"
35
36 #define CommandSendVersion "3.0" 
37 namespace am {
38
39 /**
40  * This interface handles all communication from the AudioManagerDaemon towards
41  * the system. It is designed in such a way that only callbacks with no return
42  * types are implemented. So when the CommandInterfacePlugins are designed in such
43  * a way that they broadcast signals to any node who is interested in the
44  * particular information (like signals on Dbus for example), more information can
45  * be retrieved via the CommandReceiveInterface.
46  * There are two rules that have to be kept in mind when implementing against this
47  * interface:\n
48  * \warning
49  * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!! \n
50  * 2. YOU MAY NOT CALL THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS
51  * CALL THAT EXPECTS A RETURN VALUE.\n
52  * \details
53  * Violation these rules may lead to unexpected behavior! Nevertheless you can
54  * implement thread safe by using the deferred-call pattern described on the wiki
55  * which also helps to implement calls that are forbidden.\n
56  * For more information, please check CAmSerializer
57  */
58 class IAmCommandSend
59 {
60
61 public:
62         IAmCommandSend() {
63
64         }
65
66         virtual ~IAmCommandSend() {
67
68         }
69
70         /**
71          * returns the interface version as string.
72          */
73         virtual void getInterfaceVersion(std::string& version) const =0;
74         /**
75          * This command starts the interface, the plugin itself. This is not meant to
76          * start communication with the HMI itself. It is a good idea to implement here
77          * everything that sets up the basic communication like DbusCommunication etc...
78          * Be aware of side effects with systemd and socketbased communication!
79          * @return E_OK on success, E_UNKNOWN on error
80          */
81         virtual am_Error_e startupInterface(IAmCommandReceive* commandreceiveinterface) =0;
82         /**
83          * This function will indirectly be called by the Controller and is used to start
84          * the Communication. Before this command, all communication will be ignored by
85          * the AudioManager.
86          * After the Plugin is ready, it will asynchronously answer with
87          * condfirmCommandReady, the handle that is handed over must be returned.
88          */
89         virtual void setCommandReady(const uint16_t handle) =0;
90         /**
91          * This function will indirectly be called by the Controller and is used to stop
92          * the Communication. After this command, all communication will be ignored by the
93          * AudioManager. The plugin has to be prepared that either the power will be
94          * switched off or the Interface is started again with setCommandReady
95          * After the Plugin is ready to rundown, it will asynchronously answer with
96          * condfirmCommandRundown, the handle that is handed over must be returned.
97          */
98         virtual void setCommandRundown(const uint16_t handle) =0;
99         /**
100          * Callback that is called when the number of connections change
101          */
102         virtual void cbNewMainConnection(const am_MainConnectionType_s& mainConnection) =0;
103         /**
104          * Callback that is called when the number of connections change
105          */
106         virtual void cbRemovedMainConnection(const am_mainConnectionID_t mainConnection) =0;
107         /**
108          * Callback that is called when the number of sinks change
109          */
110         virtual void cbNewSink(const am_SinkType_s& sink) =0;
111         /**
112          * Callback that is called when the number of sinks change
113          */
114         virtual void cbRemovedSink(const am_sinkID_t sinkID) =0;
115         /**
116          * Callback that is called when the number of sources change
117          */
118         virtual void cbNewSource(const am_SourceType_s& source) =0;
119         /**
120          * Callback that is called when the number of sources change
121          */
122         virtual void cbRemovedSource(const am_sourceID_t source) =0;
123         /**
124          * this callback is fired if the number of sink classes changed
125          */
126         virtual void cbNumberOfSinkClassesChanged() =0;
127         /**
128          * this callback is fired if the number of source classes changed
129          */
130         virtual void cbNumberOfSourceClassesChanged() =0;
131         /**
132          * This callback is called when the ConnectionState of a connection changed.
133          */
134         virtual void cbMainConnectionStateChanged(const am_mainConnectionID_t connectionID, const am_ConnectionState_e connectionState) =0;
135         /**
136          * this callback indicates that a sinkSoundProperty has changed.
137          */
138         virtual void cbMainSinkSoundPropertyChanged(const am_sinkID_t sinkID, const am_MainSoundProperty_s& soundProperty) =0;
139         /**
140          * this callback indicates that a sourceSoundProperty has changed.
141          */
142         virtual void cbMainSourceSoundPropertyChanged(const am_sourceID_t sourceID, const am_MainSoundProperty_s& soundProperty) =0;
143         /**
144          * this callback is called when the availability of a sink has changed
145          */
146         virtual void cbSinkAvailabilityChanged(const am_sinkID_t sinkID, const am_Availability_s& availability) =0;
147         /**
148          * this callback is called when the availability of source has changed.
149          */
150         virtual void cbSourceAvailabilityChanged(const am_sourceID_t sourceID, const am_Availability_s& availability) =0;
151         /**
152          * this callback indicates a volume change on the indicated sink
153          */
154         virtual void cbVolumeChanged(const am_sinkID_t sinkID, const am_mainVolume_t volume) =0;
155         /**
156          * this callback indicates a mute state change on a sink.
157          */
158         virtual void cbSinkMuteStateChanged(const am_sinkID_t sinkID, const am_MuteState_e muteState) =0;
159         /**
160          * is fired if a systemProperty changed
161          */
162         virtual void cbSystemPropertyChanged(const am_SystemProperty_s& systemProperty) =0;
163         /**
164          * This callback is fired if the timinginformation for a mainConnectionID changed
165          */
166         virtual void cbTimingInformationChanged(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time) =0;
167         /**
168          * This callback is called when a sink is updated.
169          */
170         virtual void cbSinkUpdated(const am_sinkID_t sinkID, const am_sinkClass_t sinkClassID, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties) =0;
171         /**
172          * This callback is called when a source is updated.
173          */
174         virtual void cbSourceUpdated(const am_sourceID_t sourceID, const am_sourceClass_t sourceClassID, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties) =0;
175         /**
176          * This callback is called when a notificated value of a sink changes.
177          */
178         virtual void cbSinkNotification(const am_sinkID_t sinkID, const am_NotificationPayload_s& notification) =0;
179         /**
180          * This callback is called when a notifcated value of a source changes.
181          */
182         virtual void cbSourceNotification(const am_sourceID_t sourceID, const am_NotificationPayload_s& notification) =0;
183         /**
184          * This callback is triggered when a mainNotificationConfiguration is changed.
185          */
186         virtual void cbMainSinkNotificationConfigurationChanged(const am_sinkID_t sinkID, const am_NotificationConfiguration_s& mainNotificationConfiguration) =0;
187         /**
188          * This callback is triggered when a mainNotificationConfiguration is changed.
189          */
190         virtual void cbMainSourceNotificationConfigurationChanged(const am_sourceID_t sourceID, const am_NotificationConfiguration_s& mainNotificationConfiguration) =0;
191
192 };
193 }
194 #endif // !defined(EA_B654431C_A920_4376_9B2F_3FF803354EAD__INCLUDED_)