| 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_IBUS_IBUS_PANEL_SERVICE_H_ | |
| 6 #define CHROMEOS_DBUS_IBUS_IBUS_PANEL_SERVICE_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 #include "base/bind.h" | |
| 10 #include "base/callback.h" | |
| 11 #include "base/memory/scoped_vector.h" | |
| 12 #include "chromeos/chromeos_export.h" | |
| 13 #include "chromeos/dbus/dbus_client_implementation_type.h" | |
| 14 #include "chromeos/dbus/ibus/ibus_constants.h" | |
| 15 #include "chromeos/ime/ime_constants.h" | |
| 16 | |
| 17 namespace dbus { | |
| 18 class Bus; | |
| 19 class ObjectPath; | |
| 20 } // namespace dbus | |
| 21 | |
| 22 namespace chromeos { | |
| 23 class IBusInputContextClient; | |
| 24 | |
| 25 class IBusLookupTable; | |
| 26 class IBusProperty; | |
| 27 class IBusText; | |
| 28 class IBusPanelCandidateWindowHandlerInterface; | |
| 29 class IBusPanelPropertyHandlerInterface; | |
| 30 typedef ScopedVector<IBusProperty> IBusPropertyList; | |
| 31 | |
| 32 // A class to make the actual DBus method call handling for IBusPanel service. | |
| 33 // The exported method call is used by ibus-daemon to process candidate window | |
| 34 // related event, because Chrome works as candidate window. This class is | |
| 35 // managed by DBusThreadManager. | |
| 36 class CHROMEOS_EXPORT IBusPanelService { | |
| 37 public: | |
| 38 virtual ~IBusPanelService(); | |
| 39 | |
| 40 // Sets up candidate window panel service with |handler|. This function can be | |
| 41 // called multiple times and also can be passed |handler| as NULL. Caller must | |
| 42 // release |handler|. | |
| 43 virtual void SetUpCandidateWindowHandler( | |
| 44 IBusPanelCandidateWindowHandlerInterface* handler) = 0; | |
| 45 | |
| 46 // Sets up property panel service with |handler|. This function can be called | |
| 47 // multiple times and also can be passed |handler| as NULL. Caller must | |
| 48 // release |handler|. | |
| 49 virtual void SetUpPropertyHandler( | |
| 50 IBusPanelPropertyHandlerInterface* handler) = 0; | |
| 51 | |
| 52 // Emits CandidateClicked signal. | |
| 53 virtual void CandidateClicked(uint32 index, | |
| 54 ibus::IBusMouseButton button, | |
| 55 uint32 state) = 0; | |
| 56 | |
| 57 // Emits CursorUp signal. | |
| 58 virtual void CursorUp() = 0; | |
| 59 | |
| 60 // Emits CursorDown signal. | |
| 61 virtual void CursorDown() = 0; | |
| 62 | |
| 63 // Emits PageUp signal. | |
| 64 virtual void PageUp() = 0; | |
| 65 | |
| 66 // Emits PageDown signal. | |
| 67 virtual void PageDown() = 0; | |
| 68 | |
| 69 // Factory function, creates a new instance and returns ownership. | |
| 70 // For normal usage, access the singleton via DBusThreadManager::Get(). | |
| 71 // IBusPanelService does not take an ownership of |input_context|, so caller | |
| 72 // should release it. | |
| 73 static CHROMEOS_EXPORT IBusPanelService* Create( | |
| 74 DBusClientImplementationType type, | |
| 75 dbus::Bus* bus, | |
| 76 IBusInputContextClient* input_context); | |
| 77 | |
| 78 protected: | |
| 79 // Create() should be used instead. | |
| 80 IBusPanelService(); | |
| 81 | |
| 82 private: | |
| 83 DISALLOW_COPY_AND_ASSIGN(IBusPanelService); | |
| 84 }; | |
| 85 | |
| 86 } // namespace chromeos | |
| 87 | |
| 88 #endif // CHROMEOS_DBUS_IBUS_IBUS_PANEL_SERVICE_H_ | |
| OLD | NEW |