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_IBUS_IBUS_CONFIG_CLIENT_H_
6 #define CHROMEOS_DBUS_IBUS_IBUS_CONFIG_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"
15 #include "dbus/object_path.h"
24 class IBusInputContextClient
;
26 // A class to make the actual DBus calls for IBusConfig service.
27 class CHROMEOS_EXPORT IBusConfigClient
{
29 typedef base::Callback
<void()> ErrorCallback
;
30 typedef base::Callback
<void()> OnIBusConfigReady
;
31 virtual ~IBusConfigClient();
33 // Initializes IBusConfig asynchronously. |on_ready| will be called if it is
35 virtual void InitializeAsync(const OnIBusConfigReady
& on_ready
) = 0;
37 // Requests the IBusConfig to set a string value.
38 virtual void SetStringValue(const std::string
& section
,
39 const std::string
& key
,
40 const std::string
& value
,
41 const ErrorCallback
& error_callback
) = 0;
43 // Requests the IBusConfig to set a integer value.
44 virtual void SetIntValue(const std::string
& section
,
45 const std::string
& key
,
47 const ErrorCallback
& error_callback
) = 0;
49 // Requests the IBusConfig to set a boolean value.
50 virtual void SetBoolValue(const std::string
& section
,
51 const std::string
& key
,
53 const ErrorCallback
& error_callback
) = 0;
55 // Requests the IBusConfig to set multiple string values.
56 virtual void SetStringListValue(const std::string
& section
,
57 const std::string
& key
,
58 const std::vector
<std::string
>& value
,
59 const ErrorCallback
& error_callback
) = 0;
61 // Factory function, creates a new instance and returns ownership.
62 // For normal usage, access the singleton via DBusThreadManager::Get().
63 static CHROMEOS_EXPORT IBusConfigClient
* Create(
64 DBusClientImplementationType type
,
68 // Create() should be used instead.
72 DISALLOW_COPY_AND_ASSIGN(IBusConfigClient
);
75 } // namespace chromeos
77 #endif // CHROMEOS_DBUS_IBUS_IBUS_CONFIG_CLIENT_H_