blob: d36614a0f5df9eec0ffe2c3b94b48d4b06fbeb42 [file] [log] [blame]
Arman Uguray618af2b2012-12-11 19:20:42 -08001// Copyright (c) 2012 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_MM1_MODEM_TIME_PROXY_H_
6#define SHILL_MM1_MODEM_TIME_PROXY_H_
7
8#include <string>
9
10#include "shill/dbus_bindings/mm1-modem-time.h"
11#include "shill/dbus_properties.h"
12#include "shill/mm1_modem_time_proxy_interface.h"
13
14namespace shill {
15namespace mm1 {
16
17class ModemTimeProxy : public ModemTimeProxyInterface {
18 public:
19 ModemTimeProxy(DBus::Connection *connection,
20 const std::string &path,
21 const std::string &service);
22 virtual ~ModemTimeProxy();
23
24 // Inherited methods from ModemTimeProxyInterface.
25 virtual void GetNetworkTime(Error *error,
26 const StringCallback &callback,
27 int timeout);
28
29 virtual void set_network_time_changed_callback(
30 const NetworkTimeChangedSignalCallback &callback);
31
32 // Inherited properties from ModemTimeProxyInterface.
33 virtual const DBusPropertiesMap NetworkTimezone();
34
35 private:
36 class Proxy : public org::freedesktop::ModemManager1::Modem::Time_proxy,
37 public DBus::ObjectProxy {
38 public:
39 Proxy(DBus::Connection *connection,
40 const std::string &path,
41 const std::string &service);
42 virtual ~Proxy();
43
44 void set_network_time_changed_callback(
45 const NetworkTimeChangedSignalCallback &callback);
46
47 private:
48 // Signal callbacks inherited from Proxy
49 // handle signals.
50 void NetworkTimeChanged(const std::string &time);
51
52 // Method callbacks inherited from
53 // org::freedesktop::ModemManager1::Modem::Time_proxy.
54 virtual void GetNetworkTimeCallback(const std::string &time,
55 const ::DBus::Error &dberror,
56 void *data);
57
58 NetworkTimeChangedSignalCallback network_time_changed_callback_;
59
60 DISALLOW_COPY_AND_ASSIGN(Proxy);
61 };
62
63 Proxy proxy_;
64
65 DISALLOW_COPY_AND_ASSIGN(ModemTimeProxy);
66};
67
68} // namespace mm1
69} // namespace shill
70
71#endif // SHILL_MM1_MODEM_TIME_PROXY_H_