| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef SRC_CASHEW_SERVER_H_ | 5 #ifndef SRC_CASHEW_SERVER_H_ |
| 6 #define SRC_CASHEW_SERVER_H_ | 6 #define SRC_CASHEW_SERVER_H_ |
| 7 | 7 |
| 8 #include <base/basictypes.h> | 8 #include <map> |
| 9 #include <dbus-c++/dbus.h> | 9 #include <string> |
| 10 #include <vector> |
| 11 |
| 12 #include <base/basictypes.h> // NOLINT |
| 13 #include <dbus-c++/dbus.h> // NOLINT |
| 10 | 14 |
| 11 #include "src/cashew_server_glue.h" | 15 #include "src/cashew_server_glue.h" |
| 12 | 16 |
| 13 namespace cashew { | 17 namespace cashew { |
| 14 | 18 |
| 19 typedef std::map<std::string, DBus::Variant> DataPlan; |
| 20 typedef std::vector<DataPlan> DataPlanList; |
| 21 |
| 15 // Implements Cashew D-Bus API | 22 // Implements Cashew D-Bus API |
| 16 class CashewServer : public org::chromium::Cashew_adaptor, | 23 class CashewServer : public org::chromium::Cashew_adaptor, |
| 17 public DBus::IntrospectableAdaptor, | 24 public DBus::IntrospectableAdaptor, |
| 18 public DBus::ObjectAdaptor { | 25 public DBus::ObjectAdaptor { |
| 19 public: | 26 public: |
| 20 explicit CashewServer(DBus::Connection& connection); // NOLINT | 27 explicit CashewServer(DBus::Connection& connection); // NOLINT |
| 21 virtual ~CashewServer() {} | 28 virtual ~CashewServer() {} |
| 22 | 29 |
| 23 // Cashew D-Bus API methods | 30 // Cashew D-Bus API methods |
| 24 // TODO(vlaviano): add real API methods | |
| 25 | 31 |
| 32 // Get data plan info for a cellular service |
| 33 virtual DataPlanList GetDataPlans(const std::string& service, |
| 34 DBus::Error& error); // NOLINT |
| 35 |
| 36 // Request that a DataPlansUpdate signal be sent for a cellular service |
| 37 virtual void RequestDataPlansUpdate(const std::string& service, |
| 38 DBus::Error& error); // NOLINT |
| 39 |
| 40 // Test method to verify that Cashew service is working |
| 26 virtual bool IsAlive(DBus::Error& error); // NOLINT | 41 virtual bool IsAlive(DBus::Error& error); // NOLINT |
| 27 | 42 |
| 28 static const char* kServiceName; | 43 static const char* kServiceName; |
| 29 static const char* kServicePath; | 44 static const char* kServicePath; |
| 30 | 45 |
| 31 private: | 46 private: |
| 47 // Emit a DataPlansUpdate signal for a service |
| 48 void EmitDataPlansUpdateSignal(const std::string& service); |
| 49 |
| 50 // Fill in data plan with hardcoded data for testing |
| 51 void GetHardcodedDataPlan(DataPlan* data_plan); |
| 52 |
| 32 DISALLOW_COPY_AND_ASSIGN(CashewServer); | 53 DISALLOW_COPY_AND_ASSIGN(CashewServer); |
| 33 }; | 54 }; |
| 34 | 55 |
| 35 } // namespace cashew | 56 } // namespace cashew |
| 36 | 57 |
| 37 #endif // SRC_CASHEW_SERVER_H_ | 58 #endif // SRC_CASHEW_SERVER_H_ |
| OLD | NEW |