1 //
2 // Copyright (C) 2011 The Android Open Source Project
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 #ifndef SHILL_DBUS_PROPERTIES_PROXY_INTERFACE_H_
18 #define SHILL_DBUS_PROPERTIES_PROXY_INTERFACE_H_
19 
20 #include <string>
21 #include <vector>
22 
23 #include <base/callback.h>
24 
25 #include "shill/key_value_store.h"
26 
27 namespace shill {
28 
29 // This is a cellular-specific DBus Properties interface, as it supports
30 // cellular-specific signal (ModemManagerPropertiesChanged).
31 // These are the methods that a DBusProperties proxy must support. The interface
32 // is provided so that it can be mocked in tests.
33 class DBusPropertiesProxyInterface {
34  public:
35   // Callback invoked when an object sends a DBus property change signal.
36   typedef base::Callback<void(
37       const std::string& interface,
38       const KeyValueStore& changed_properties,
39       const std::vector<std::string>& invalidated_properties)>
40     PropertiesChangedCallback;
41 
42   // Callback invoked when the classic modem manager sends a DBus
43   // property change signal.
44   typedef base::Callback<void(
45       const std::string& interface,
46       const KeyValueStore& properties)>
47     ModemManagerPropertiesChangedCallback;
48 
~DBusPropertiesProxyInterface()49   virtual ~DBusPropertiesProxyInterface() {}
50 
51   virtual KeyValueStore GetAll(const std::string& interface_name) = 0;
52   virtual brillo::Any Get(const std::string& interface_name,
53                           const std::string& property) = 0;
54 
55   virtual void set_properties_changed_callback(
56       const PropertiesChangedCallback& callback) = 0;
57   virtual void set_modem_manager_properties_changed_callback(
58       const ModemManagerPropertiesChangedCallback& callback) = 0;
59 };
60 
61 }  // namespace shill
62 
63 #endif  // SHILL_DBUS_PROPERTIES_PROXY_INTERFACE_H_
64