| 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_ENGINE_FACTORY_SERVICE_H_ | |
| 6 #define CHROMEOS_DBUS_IBUS_IBUS_ENGINE_FACTORY_SERVICE_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 #include "base/bind.h" | |
| 10 #include "base/callback.h" | |
| 11 #include "chromeos/chromeos_export.h" | |
| 12 | |
| 13 namespace dbus { | |
| 14 class Bus; | |
| 15 class ObjectPath; | |
| 16 } // namespace dbus | |
| 17 | |
| 18 namespace chromeos { | |
| 19 | |
| 20 // A class to make the actual DBus method call handling for IBusEngineFactory | |
| 21 // service. The exported method call is used by ibus-daemon to create engine | |
| 22 // service if the extension IME is enabled. | |
| 23 class CHROMEOS_EXPORT IBusEngineFactoryService { | |
| 24 public: | |
| 25 typedef base::Callback<void(const dbus::ObjectPath& path)> | |
| 26 CreateEngineResponseSender; | |
| 27 typedef base::Callback<void(const CreateEngineResponseSender& sender)> | |
| 28 CreateEngineHandler; | |
| 29 | |
| 30 virtual ~IBusEngineFactoryService(); | |
| 31 | |
| 32 // Sets CreateEngine method call handler for |engine_id|. If ibus-daemon calls | |
| 33 // CreateEngine message with |engine_id|, the |create_engine_handler| will be | |
| 34 // called. | |
| 35 virtual void SetCreateEngineHandler( | |
| 36 const std::string& engine_id, | |
| 37 const CreateEngineHandler& create_engine_handler) = 0; | |
| 38 | |
| 39 // Unsets CreateEngine method call handler for |engine_id|. | |
| 40 virtual void UnsetCreateEngineHandler(const std::string& engine_id) = 0; | |
| 41 | |
| 42 // Generates object path which is unique among all EngineServices. | |
| 43 virtual dbus::ObjectPath GenerateUniqueObjectPath() = 0; | |
| 44 | |
| 45 // Factory function, creates a new instance and returns ownership. | |
| 46 // For normal usage, accesses the singleton via DBusThreadManager::Get(). | |
| 47 static CHROMEOS_EXPORT IBusEngineFactoryService* Create(); | |
| 48 | |
| 49 protected: | |
| 50 // Create() should be used instead. | |
| 51 IBusEngineFactoryService(); | |
| 52 | |
| 53 private: | |
| 54 DISALLOW_COPY_AND_ASSIGN(IBusEngineFactoryService); | |
| 55 }; | |
| 56 | |
| 57 } // namespace chromeos | |
| 58 | |
| 59 #endif // CHROMEOS_DBUS_IBUS_IBUS_ENGINE_FACTORY_SERVICE_H_ | |
| OLD | NEW |