Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1223)

Unified Diff: chromeos/dbus/sms_client.h

Issue 10533006: Support the ModemManager1 interfaces for SMS messages (Closed) Base URL: http://git.chromium.org/git/chromium/src@master
Patch Set: Implement full unit testing Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chromeos/dbus/sms_client.h
diff --git a/chromeos/dbus/sms_client.h b/chromeos/dbus/sms_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..db3332dc8165111ee98ab7271b1987269fc26bfc
--- /dev/null
+++ b/chromeos/dbus/sms_client.h
@@ -0,0 +1,57 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMEOS_DBUS_SMS_CLIENT_H_
+#define CHROMEOS_DBUS_SMS_CLIENT_H_
+#pragma once
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/callback.h"
+#include "chromeos/chromeos_export.h"
+#include "chromeos/dbus/dbus_client_implementation_type.h"
+
+namespace base {
+class DictionaryValue;
+}
+
+namespace dbus {
+class Bus;
+class ObjectPath;
+}
+
+namespace chromeos {
+
+// SMSMessageClient is used to communicate with the
+// org.freedesktop.ModemManager1.SMS service. All methods should be
+// called from the origin thread (UI thread) which initializes the
+// DBusThreadManager instance.
+class SMSClient {
+ public:
+ typedef base::Callback<void(const base::DictionaryValue& sms)> GetAllCallback;
+
+ virtual ~SMSClient();
+
+ // Factory function, creates a new instance and returns ownership.
+ // For normal usage, access the singleton via DBusThreadManager::Get().
+ static SMSClient* Create(DBusClientImplementationType type,
+ dbus::Bus* bus);
+
+ // Calls GetAll method. |callback| is called after the method call succeeds.
+ virtual void GetAll(const std::string& service_name,
+ const dbus::ObjectPath& object_path,
+ const GetAllCallback& callback) = 0;
+
+ protected:
+ // Create() should be used instead.
+ SMSClient();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SMSClient);
+};
+
+} // namespace chromeos
+
+#endif // CHROMEOS_DBUS_SMS_CLIENT_H_

Powered by Google App Engine
This is Rietveld 408576698