OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #ifndef CHROMEOS_DBUS_SMS_CLIENT_H_ |
| 6 #define CHROMEOS_DBUS_SMS_CLIENT_H_ |
| 7 #pragma once |
| 8 |
| 9 #include <string> |
| 10 |
| 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" |
| 15 |
| 16 namespace base { |
| 17 class DictionaryValue; |
| 18 } |
| 19 |
| 20 namespace dbus { |
| 21 class Bus; |
| 22 class ObjectPath; |
| 23 } |
| 24 |
| 25 namespace chromeos { |
| 26 |
| 27 // SMSMessageClient is used to communicate with the |
| 28 // org.freedesktop.ModemManager1.SMS service. All methods should be |
| 29 // called from the origin thread (UI thread) which initializes the |
| 30 // DBusThreadManager instance. |
| 31 class SMSClient { |
| 32 public: |
| 33 typedef base::Callback<void(const base::DictionaryValue& sms)> GetAllCallback; |
| 34 |
| 35 virtual ~SMSClient(); |
| 36 |
| 37 // Factory function, creates a new instance and returns ownership. |
| 38 // For normal usage, access the singleton via DBusThreadManager::Get(). |
| 39 static SMSClient* Create(DBusClientImplementationType type, |
| 40 dbus::Bus* bus); |
| 41 |
| 42 // Calls GetAll method. |callback| is called after the method call succeeds. |
| 43 virtual void GetAll(const std::string& service_name, |
| 44 const dbus::ObjectPath& object_path, |
| 45 const GetAllCallback& callback) = 0; |
| 46 |
| 47 protected: |
| 48 // Create() should be used instead. |
| 49 SMSClient(); |
| 50 |
| 51 private: |
| 52 DISALLOW_COPY_AND_ASSIGN(SMSClient); |
| 53 }; |
| 54 |
| 55 } // namespace chromeos |
| 56 |
| 57 #endif // CHROMEOS_DBUS_SMS_CLIENT_H_ |
OLD | NEW |