1 // Copyright (c) 2012 The Chromium 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.
5 #ifndef CHROMEOS_DBUS_CASHEW_CLIENT_H_
6 #define CHROMEOS_DBUS_CASHEW_CLIENT_H_
11 #include "base/basictypes.h"
12 #include "base/callback.h"
13 #include "chromeos/chromeos_export.h"
14 #include "chromeos/dbus/dbus_client_implementation_type.h"
26 // CashewClient is used to communicate with the Cashew service.
27 // All methods should be called from the origin thread (UI thread) which
28 // initializes the DBusThreadManager instance.
29 class CHROMEOS_EXPORT CashewClient
{
31 // A callback to handle "DataPlansUpdate" signal.
32 // |service| is the D-Bus path of the cellular service.
33 // (e.g. /service/cellular_0271266ce2ce_310260467781434)
34 typedef base::Callback
<void(const std::string
& service
,
35 const base::ListValue
& data_plans
)>
36 DataPlansUpdateHandler
;
38 virtual ~CashewClient();
40 // Factory function, creates a new instance and returns ownership.
41 // For normal usage, access the singleton via DBusThreadManager::Get().
42 static CashewClient
* Create(DBusClientImplementationType type
,
45 // Sets DataPlansUpdate signal handler.
46 virtual void SetDataPlansUpdateHandler(
47 const DataPlansUpdateHandler
& handler
) = 0;
49 // Resets DataPlansUpdate signal handler.
50 virtual void ResetDataPlansUpdateHandler() = 0;
52 // Calls RequestDataPlansUpdate method.
53 virtual void RequestDataPlansUpdate(const std::string
& service
) = 0;
56 // Create() should be used instead.
60 DISALLOW_COPY_AND_ASSIGN(CashewClient
);
63 } // namespace chromeos
65 #endif // CHROMEOS_DBUS_CASHEW_CLIENT_H_