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

Side by Side Diff: chromeos/dbus/ibus/ibus_engine_service.h

Issue 10968056: Fix crash bug of IME extension API. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix nits Created 8 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROMEOS_DBUS_IBUS_IBUS_ENGINE_SERVICE_H_ 5 #ifndef CHROMEOS_DBUS_IBUS_IBUS_ENGINE_SERVICE_H_
6 #define CHROMEOS_DBUS_IBUS_IBUS_ENGINE_SERVICE_H_ 6 #define CHROMEOS_DBUS_IBUS_IBUS_ENGINE_SERVICE_H_
7 7
8 #include <string> 8 #include <string>
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/memory/scoped_vector.h" 11 #include "base/memory/scoped_vector.h"
12 #include "chromeos/chromeos_export.h" 12 #include "chromeos/chromeos_export.h"
13 #include "chromeos/dbus/dbus_client_implementation_type.h" 13 #include "chromeos/dbus/dbus_client_implementation_type.h"
14 14
15 namespace dbus { 15 namespace dbus {
16 class Bus; 16 class Bus;
17 class ObjectPath; 17 class ObjectPath;
18 } // namespace dbus 18 } // namespace dbus
19 19
20 namespace chromeos { 20 namespace chromeos {
21 21
22 // TODO(nona): Remove ibus namespace after complete libibus removal. 22 // TODO(nona): Remove ibus namespace after complete libibus removal.
23 namespace ibus { 23 namespace ibus {
24 class IBusLookupTable; 24 class IBusLookupTable;
25 class IBusProperty; 25 class IBusProperty;
26 class IBusText; 26 class IBusText;
27 typedef ScopedVector<IBusProperty> IBusPropertyList; 27 typedef ScopedVector<IBusProperty> IBusPropertyList;
28 } // namespace 28 } // namespace
29 29
30 // A interface to handle the engine client method call. 30 // A interface to handle the engine handler method call.
31 class CHROMEOS_EXPORT IBusEngineHandlerInterface { 31 class CHROMEOS_EXPORT IBusEngineHandlerInterface {
32 public: 32 public:
33 typedef base::Callback<void (bool consumed)> KeyEventDoneCallback; 33 typedef base::Callback<void (bool consumed)> KeyEventDoneCallback;
34 34
35 // Following capability mask is introduced from 35 // Following capability mask is introduced from
36 // http://ibus.googlecode.com/svn/docs/ibus-1.4/ibus-ibustypes.html#IBusCapabi lite 36 // http://ibus.googlecode.com/svn/docs/ibus-1.4/ibus-ibustypes.html#IBusCapabi lite
37 // TODO(nona): Move to ibus_contants and merge one in ui/base/ime/* 37 // TODO(nona): Move to ibus_contants and merge one in ui/base/ime/*
38 enum IBusCapability { 38 enum IBusCapability {
39 IBUS_CAPABILITY_PREEDIT_TEXT = 1U, 39 IBUS_CAPABILITY_PREEDIT_TEXT = 1U,
40 IBUS_CAPABILITY_FOCUS = 8U, 40 IBUS_CAPABILITY_FOCUS = 8U,
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 public: 123 public:
124 // Following value should be same in 124 // Following value should be same in
125 // http://ibus.googlecode.com/svn/docs/ibus-1.4/ibus-ibustypes.html#IBusPreedi tFocusMode 125 // http://ibus.googlecode.com/svn/docs/ibus-1.4/ibus-ibustypes.html#IBusPreedi tFocusMode
126 enum IBusEnginePreeditFocusOutMode { 126 enum IBusEnginePreeditFocusOutMode {
127 IBUS_ENGINE_PREEEDIT_FOCUS_OUT_MODE_CLEAR = 0, 127 IBUS_ENGINE_PREEEDIT_FOCUS_OUT_MODE_CLEAR = 0,
128 IBUS_ENGINE_PREEEDIT_FOCUS_OUT_MODE_COMMIT = 1, 128 IBUS_ENGINE_PREEEDIT_FOCUS_OUT_MODE_COMMIT = 1,
129 }; 129 };
130 130
131 virtual ~IBusEngineService(); 131 virtual ~IBusEngineService();
132 132
133 // Initializes the engine client. This class takes the ownership of |handler|. 133 // Sets a new IBus engine handler and old handler will be overridden.
134 virtual void Initialize(IBusEngineHandlerInterface* handler) = 0; 134 // This class doesn't take the ownership of |handler|.
135 virtual void SetEngine(IBusEngineHandlerInterface* handler) = 0;
136
137 // Unsets the current IBus engine hanlder.
138 virtual void UnsetEngine() = 0;
135 139
136 // Emits RegisterProperties signal. 140 // Emits RegisterProperties signal.
137 virtual void RegisterProperties( 141 virtual void RegisterProperties(
138 const ibus::IBusPropertyList& property_list) = 0; 142 const ibus::IBusPropertyList& property_list) = 0;
139 // Emits UpdatePreedit signal. 143 // Emits UpdatePreedit signal.
140 virtual void UpdatePreedit(const ibus::IBusText& ibus_text, 144 virtual void UpdatePreedit(const ibus::IBusText& ibus_text,
141 uint32 cursor_pos, 145 uint32 cursor_pos,
142 bool is_visible, 146 bool is_visible,
143 IBusEnginePreeditFocusOutMode mode) = 0; 147 IBusEnginePreeditFocusOutMode mode) = 0;
144 // Emits UpdateAuxiliaryText signal. 148 // Emits UpdateAuxiliaryText signal.
(...skipping 22 matching lines...) Expand all
167 // Create() should be used instead. 171 // Create() should be used instead.
168 IBusEngineService(); 172 IBusEngineService();
169 173
170 private: 174 private:
171 DISALLOW_COPY_AND_ASSIGN(IBusEngineService); 175 DISALLOW_COPY_AND_ASSIGN(IBusEngineService);
172 }; 176 };
173 177
174 } // namespace chromeos 178 } // namespace chromeos
175 179
176 #endif // CHROMEOS_DBUS_IBUS_IBUS_ENGINE_SERVICE_H_ 180 #endif // CHROMEOS_DBUS_IBUS_IBUS_ENGINE_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/input_method/input_method_engine_ibus.cc ('k') | chromeos/dbus/ibus/ibus_engine_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698