Darin Petkov | 5c97ac5 | 2011-07-19 16:30:49 -0700 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef SHILL_DBUS_PROPERTIES_PROXY_INTERFACE_ |
| 6 | #define SHILL_DBUS_PROPERTIES_PROXY_INTERFACE_ |
| 7 | |
Darin Petkov | c5f5656 | 2011-08-06 16:40:05 -0700 | [diff] [blame] | 8 | #include <vector> |
| 9 | |
Jason Glasgow | 9c09e36 | 2012-04-18 15:16:29 -0400 | [diff] [blame] | 10 | #include <base/callback.h> |
| 11 | |
Darin Petkov | e0a312e | 2011-07-20 13:45:28 -0700 | [diff] [blame] | 12 | #include "shill/dbus_properties.h" |
Darin Petkov | 5c97ac5 | 2011-07-19 16:30:49 -0700 | [diff] [blame] | 13 | |
| 14 | namespace shill { |
| 15 | |
| 16 | // These are the methods that a DBusProperties proxy must support. The interface |
| 17 | // is provided so that it can be mocked in tests. |
| 18 | class DBusPropertiesProxyInterface { |
| 19 | public: |
Jason Glasgow | 9c09e36 | 2012-04-18 15:16:29 -0400 | [diff] [blame] | 20 | // Callback invoked when an object sends a DBus property change signal. |
| 21 | typedef base::Callback<void( |
| 22 | const std::string &interface, |
| 23 | const DBusPropertiesMap &changed_properties, |
| 24 | const std::vector<std::string> &invalidated_properties)> |
| 25 | PropertiesChangedCallback; |
| 26 | |
| 27 | // Callback invoked when the classic modem manager sends a DBus |
| 28 | // property change signal. |
| 29 | typedef base::Callback<void( |
| 30 | const std::string &interface, |
| 31 | const DBusPropertiesMap &properties)> |
| 32 | ModemManagerPropertiesChangedCallback; |
| 33 | |
Darin Petkov | 5c97ac5 | 2011-07-19 16:30:49 -0700 | [diff] [blame] | 34 | virtual ~DBusPropertiesProxyInterface() {} |
| 35 | |
Darin Petkov | e0a312e | 2011-07-20 13:45:28 -0700 | [diff] [blame] | 36 | virtual DBusPropertiesMap GetAll(const std::string &interface_name) = 0; |
Darin Petkov | 5c97ac5 | 2011-07-19 16:30:49 -0700 | [diff] [blame] | 37 | |
Jason Glasgow | 9c09e36 | 2012-04-18 15:16:29 -0400 | [diff] [blame] | 38 | virtual void set_properties_changed_callback( |
| 39 | const PropertiesChangedCallback &callback) = 0; |
| 40 | virtual void set_modem_manager_properties_changed_callback( |
| 41 | const ModemManagerPropertiesChangedCallback &callback) = 0; |
Darin Petkov | c5f5656 | 2011-08-06 16:40:05 -0700 | [diff] [blame] | 42 | }; |
| 43 | |
Darin Petkov | 5c97ac5 | 2011-07-19 16:30:49 -0700 | [diff] [blame] | 44 | } // namespace shill |
| 45 | |
| 46 | #endif // SHILL_DBUS_PROPERTIES_PROXY_INTERFACE_ |