11e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved. 21e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 31e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// found in the LICENSE file. 41e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 51e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#ifndef UI_BASE_IME_LINUX_LINUX_INPUT_METHOD_CONTEXT_FACTORY_H_ 61e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#define UI_BASE_IME_LINUX_LINUX_INPUT_METHOD_CONTEXT_FACTORY_H_ 71e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 81e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#include "base/memory/scoped_ptr.h" 95d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "ui/base/ui_base_export.h" 101e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 111e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)namespace ui { 121e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 131e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)class LinuxInputMethodContext; 141e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)class LinuxInputMethodContextDelegate; 151e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 161e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// An interface that lets different Linux platforms override the 171e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// CreateInputMethodContext function declared here to return native input method 181e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// contexts. 195d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)class UI_BASE_EXPORT LinuxInputMethodContextFactory { 201e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) public: 211e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) // Returns the current active factory or NULL. 221e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) static const LinuxInputMethodContextFactory* instance(); 231e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 241e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) // Sets the dynamically loaded singleton that creates an input method context. 251e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) // This pointer is not owned, and if this method is called a second time, 261e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) // the first instance is not deleted. 271e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) static void SetInstance(const LinuxInputMethodContextFactory* instance); 281e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 291e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual ~LinuxInputMethodContextFactory() {} 301e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 311e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) // Returns a native input method context. 321e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) virtual scoped_ptr<LinuxInputMethodContext> CreateInputMethodContext( 331e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) LinuxInputMethodContextDelegate* delegate) const = 0; 341e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)}; 351e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 361e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)} // namespace ui 371e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 381e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)#endif // UI_BASE_IME_LINUX_LINUX_INPUT_METHOD_CONTEXT_FACTORY_H_ 39