Darin Petkov | 394b7d4 | 2011-11-03 15:48:02 +0100 | [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_POWER_MANAGER_PROXY_ |
| 6 | #define SHILL_POWER_MANAGER_PROXY_ |
| 7 | |
| 8 | #include "shill/dbus_bindings/power_manager.h" |
| 9 | #include "shill/power_manager_proxy_interface.h" |
| 10 | |
| 11 | namespace shill { |
| 12 | |
| 13 | class PowerManagerProxy : public PowerManagerProxyInterface { |
| 14 | public: |
| 15 | // Constructs a PowerManager DBus object proxy with signals dispatched to |
| 16 | // |delegate|. |
| 17 | PowerManagerProxy(PowerManagerProxyDelegate *delegate, |
| 18 | DBus::Connection *connection); |
| 19 | virtual ~PowerManagerProxy(); |
| 20 | |
| 21 | // Inherited from PowerManagerProxyInterface. |
| 22 | virtual void RegisterSuspendDelay(uint32 delay_ms); |
| 23 | |
| 24 | private: |
| 25 | class Proxy : public org::chromium::PowerManager_proxy, |
| 26 | public DBus::ObjectProxy { |
| 27 | public: |
| 28 | Proxy(PowerManagerProxyDelegate *delegate, |
| 29 | DBus::Connection *connection); |
| 30 | virtual ~Proxy(); |
| 31 | |
| 32 | private: |
| 33 | // Signal callbacks inherited from org::chromium::PowerManager_proxy. |
| 34 | virtual void SuspendDelay(const uint32_t &sequence_number); |
| 35 | |
| 36 | PowerManagerProxyDelegate *delegate_; |
| 37 | |
| 38 | DISALLOW_COPY_AND_ASSIGN(Proxy); |
| 39 | }; |
| 40 | |
| 41 | Proxy proxy_; |
| 42 | |
| 43 | DISALLOW_COPY_AND_ASSIGN(PowerManagerProxy); |
| 44 | }; |
| 45 | |
| 46 | } // namespace shill |
| 47 | |
| 48 | #endif // SHILL_POWER_MANAGER_PROXY_ |