Bug 401766 Starting Debug SeaMonkey with autoconfig file gives Assertion failure...
[mozilla-central.git] / widget / public / nsIKBStateControl.h
blobea555ceb959c85d48f1d870d801c23de087bb9a4
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
23 * Frank Tang <ftang@netscape.com>
25 * Alternatively, the contents of this file may be used under the terms of
26 * either the GNU General Public License Version 2 or later (the "GPL"), or
27 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 * in which case the provisions of the GPL or the LGPL are applicable instead
29 * of those above. If you wish to allow use of your version of this file only
30 * under the terms of either the GPL or the LGPL, and not to allow others to
31 * use your version of this file under the terms of the MPL, indicate your
32 * decision by deleting the provisions above and replace them with the notice
33 * and other provisions required by the GPL or the LGPL. If you do not delete
34 * the provisions above, a recipient may use your version of this file under
35 * the terms of any one of the MPL, the GPL or the LGPL.
37 * ***** END LICENSE BLOCK ***** */
39 #ifndef nsIKBStateControl_h__
40 #define nsIKBStateControl_h__
42 #include "nsISupports.h"
44 // {AC4EBF71-86B6-4dab-A7FD-177501ADEC98}
45 #define NS_IKBSTATECONTROL_IID \
46 { 0xac4ebf71, 0x86b6, 0x4dab, \
47 { 0xa7, 0xfd, 0x17, 0x75, 0x01, 0xad, 0xec, 0x98 } }
50 #if defined(XP_MACOSX)
52 * If the all applications use same context for IME, i.e., When gecko changes
53 * the state of IME, the same changes can be on other processes.
54 * Then, NS_KBSC_USE_SHARED_CONTEXT should be defined.
56 #define NS_KBSC_USE_SHARED_CONTEXT 1
57 #endif
59 /**
60 * interface to control keyboard input state
62 class nsIKBStateControl : public nsISupports {
64 public:
66 NS_DECLARE_STATIC_IID_ACCESSOR(NS_IKBSTATECONTROL_IID)
69 * Force Input Method Editor to commit the uncommited input
71 NS_IMETHOD ResetInputState()=0;
74 * Following methods relates to IME 'Opened'/'Closed' state.
75 * 'Opened' means the user can input any character. I.e., users can input Japanese
76 * and other characters. The user can change the state to 'Closed'.
77 * 'Closed' means the user can input ASCII characters only. This is the same as a
78 * non-IME environment. The user can change the state to 'Opened'.
79 * For more information is here.
80 * http://bugzilla.mozilla.org/show_bug.cgi?id=16940#c48
84 * Set the state to 'Opened' or 'Closed'.
85 * If aState is TRUE, IME open state is set to 'Opened'.
86 * If aState is FALSE, set to 'Closed'.
88 NS_IMETHOD SetIMEOpenState(PRBool aState) = 0;
91 * Get IME is 'Opened' or 'Closed'.
92 * If IME is 'Opened', aState is set PR_TRUE.
93 * If IME is 'Closed', aState is set PR_FALSE.
95 NS_IMETHOD GetIMEOpenState(PRBool* aState) = 0;
98 * IME enabled states, the aState value of SetIMEEnabled/GetIMEEnabled
99 * should be one value of following values.
101 enum {
103 * 'Disabled' means the user cannot use IME. So, the open state should be
104 * 'closed' during 'disabled'.
106 IME_STATUS_DISABLED = 0,
108 * 'Enabled' means the user can use IME.
110 IME_STATUS_ENABLED = 1,
112 * 'Password' state is a special case for the password editors.
113 * E.g., on mac, the password editors should disable the non-Roman
114 * keyboard layouts at getting focus. Thus, the password editor may have
115 * special rules on some platforms.
117 IME_STATUS_PASSWORD = 2
121 * Set the state to 'Enabled' or 'Disabled' or 'Password'.
123 NS_IMETHOD SetIMEEnabled(PRUint32 aState) = 0;
126 * Get IME is 'Enabled' or 'Disabled' or 'Password'.
128 NS_IMETHOD GetIMEEnabled(PRUint32* aState) = 0;
131 * Destruct and don't commit the IME composition string.
133 NS_IMETHOD CancelIMEComposition() = 0;
136 * Get toggled key states.
137 * aKeyCode should be NS_VK_CAPS_LOCK or NS_VK_NUM_LOCK or
138 * NS_VK_SCROLL_LOCK.
139 * aLEDState is the result for current LED state of the key.
140 * If the LED is 'ON', it returns TRUE, otherwise, FALSE.
141 * If the platform doesn't support the LED state (or we cannot get the
142 * state), this method returns NS_ERROR_NOT_IMPLEMENTED.
144 NS_IMETHOD GetToggledKeyState(PRUint32 aKeyCode, PRBool* aLEDState) = 0;
147 NS_DEFINE_STATIC_IID_ACCESSOR(nsIKBStateControl, NS_IKBSTATECONTROL_IID)
149 #endif // nsIKBStateControl_h__