1 // Copyright 2013 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.
5 #ifndef UI_BASE_IME_LINUX_LINUX_INPUT_METHOD_CONTEXT_FACTORY_H_
6 #define UI_BASE_IME_LINUX_LINUX_INPUT_METHOD_CONTEXT_FACTORY_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "ui/base/ui_base_export.h"
13 class LinuxInputMethodContext
;
14 class LinuxInputMethodContextDelegate
;
16 // An interface that lets different Linux platforms override the
17 // CreateInputMethodContext function declared here to return native input method
19 class UI_BASE_EXPORT LinuxInputMethodContextFactory
{
21 // Returns the current active factory or NULL.
22 static const LinuxInputMethodContextFactory
* instance();
24 // Sets the dynamically loaded singleton that creates an input method context.
25 // This pointer is not owned, and if this method is called a second time,
26 // the first instance is not deleted.
27 static void SetInstance(const LinuxInputMethodContextFactory
* instance
);
29 virtual ~LinuxInputMethodContextFactory() {}
31 // Returns a native input method context.
32 virtual scoped_ptr
<LinuxInputMethodContext
> CreateInputMethodContext(
33 LinuxInputMethodContextDelegate
* delegate
) const = 0;
38 #endif // UI_BASE_IME_LINUX_LINUX_INPUT_METHOD_CONTEXT_FACTORY_H_