summaryrefslogtreecommitdiffstats
path: root/chromeos/ime/ibus_bridge.h
diff options
context:
space:
mode:
authornona@chromium.org <nona@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-07 22:16:23 +0000
committernona@chromium.org <nona@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-07 22:16:23 +0000
commit393a331ee18d32236436805a3a41d786d39b1204 (patch)
tree98497cdf5d71b53c0a023eeead68f7c8b5ddae62 /chromeos/ime/ibus_bridge.h
parent12e74bbd334775bd1961464e22085c551703ecb2 (diff)
downloadchromium_src-393a331ee18d32236436805a3a41d786d39b1204.zip
chromium_src-393a331ee18d32236436805a3a41d786d39b1204.tar.gz
chromium_src-393a331ee18d32236436805a3a41d786d39b1204.tar.bz2
Introduce IBusBridge for ibus-less implementation.
IBusBridge provides access of each ibus event handler. This patch is second try of https://codereview.chromium.org/11956041/ Using singleton in chromeos/ directory breaks component build. BUG=170671 TEST=None Review URL: https://chromiumcodereview.appspot.com/12088085 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181372 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/ime/ibus_bridge.h')
-rw-r--r--chromeos/ime/ibus_bridge.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/chromeos/ime/ibus_bridge.h b/chromeos/ime/ibus_bridge.h
new file mode 100644
index 0000000..075bcd0
--- /dev/null
+++ b/chromeos/ime/ibus_bridge.h
@@ -0,0 +1,79 @@
+// 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_IME_IBUS_BRIDGE_H_
+#define CHROMEOS_IME_IBUS_BRIDGE_H_
+
+#include <string>
+#include "base/basictypes.h"
+
+namespace chromeos {
+class IBusInputContextHandlerInterface;
+class IBusEngineHandlerInterface;
+class IBusPanelCandidateWindowHandlerInterface;
+class IBusPanelPropertyHandlerInterface;
+
+// IBusBridge provides access of each IME related handler. This class is used
+// for IME implementation without ibus-daemon. The legacy ibus IME communicates
+// their engine with dbus protocol, but new implementation doesn't. Instead of
+// dbus communcation, new implementation calls target service(e.g. PanelService
+// or EngineService) directly by using this class.
+class IBusBridge {
+ public:
+ virtual ~IBusBridge();
+
+ // Allocates the global instance. Must be called before any calls to Get().
+ static void Initialize();
+
+ // Releases the global instance.
+ static void Shutdown();
+
+ // Returns IBusBridge global instance. Initialize() must be called first.
+ static IBusBridge* Get();
+
+ // Returns current InputContextHandler. This function returns NULL if input
+ // context is not ready to use.
+ virtual IBusInputContextHandlerInterface* GetInputContextHandler() const = 0;
+
+ // Updates current InputContextHandler. If there is no active input context,
+ // pass NULL for |handler|. Caller must release |handler|.
+ virtual void SetInputContextHandler(
+ IBusInputContextHandlerInterface* handler) = 0;
+
+ // Returns current EngineHandler. This function returns NULL if current engine
+ // is not ready to use.
+ virtual IBusEngineHandlerInterface* GetEngineHandler() const = 0;
+
+ // Updates current EngineHandler. If there is no active engine service, pass
+ // NULL for |handler|. Caller must release |handler|.
+ virtual void SetEngineHandler(IBusEngineHandlerInterface* handler) = 0;
+
+ // Returns current CandidateWindowHandler. This function returns NULL if
+ // current candidate window is not ready to use.
+ virtual IBusPanelCandidateWindowHandlerInterface*
+ GetCandidateWindowHandler() const = 0;
+
+ // Updates current CandidatWindowHandler. If there is no active candidate
+ // window service, pass NULL for |handler|. Caller must release |handler|.
+ virtual void SetCandidateWindowHandler(
+ IBusPanelCandidateWindowHandlerInterface* handler) = 0;
+
+ // Returns current PropertyHandler. This function returns NULL if panel window
+ // is not ready to use.
+ virtual IBusPanelPropertyHandlerInterface* GetPanelHandler() const = 0;
+
+ // Updates current PropertyHandler. If there is no active property service,
+ // pass NULL for |handler|. Caller must release |handler|.
+ virtual void SetPanelHandler(IBusPanelPropertyHandlerInterface* handler) = 0;
+
+ protected:
+ IBusBridge();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(IBusBridge);
+};
+
+} // namespace chromeos
+
+#endif // CHROMEOS_IME_IBUS_BRIDGE_H_