Initial import to Git
[profile/ivi/common-api-dbus-runtime.git] / CommonAPI-DBus / src / CommonAPI / DBus / DBusServiceStatusEvent.h
1 /* This Source Code Form is subject to the terms of the Mozilla Public\r
2  * License, v. 2.0. If a copy of the MPL was not distributed with this\r
3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\r
4 #ifndef COMMONAPI_DBUS_DBUS_SERVICE_STATUS_EVENT_H_\r
5 #define COMMONAPI_DBUS_DBUS_SERVICE_STATUS_EVENT_H_\r
6 \r
7 #include "DBusMultiEvent.h"\r
8 \r
9 #include <CommonAPI/Event.h>\r
10 #include <CommonAPI/types.h>\r
11 \r
12 #include <string>\r
13 #include <memory>\r
14 \r
15 namespace CommonAPI {\r
16 namespace DBus {\r
17 \r
18 \r
19 class DBusServiceRegistry;\r
20 \r
21 class DBusServiceStatusEvent: public DBusMultiEvent<AvailabilityStatus> {\r
22  public:\r
23         DBusServiceStatusEvent(std::shared_ptr<DBusServiceRegistry> registry);\r
24 \r
25  protected:\r
26         void onFirstListenerAdded(const std::string& serviceName, const Listener& listener);\r
27         void onListenerAdded(const std::string& serviceName, const Listener& listener);\r
28 \r
29  private:\r
30         void availabilityEvent(const std::string& name, const bool& available);\r
31 \r
32         std::shared_ptr<DBusServiceRegistry> registry_;\r
33 };\r
34 \r
35 } // namespace DBus\r
36 } // namespace CommonAPI\r
37 \r
38 #endif // COMMONAPI_DBUS_DBUS_SERVICE_STATUS_EVENT_H_\r
39 \r