source: trunk/doc/html/qimevent.html@ 208

Last change on this file since 208 was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 8.1 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/kernel/qevent.cpp:1761 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QIMEvent Class</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { background: #ffffff; color: black; }
12--></style>
13</head>
14<body>
15
16<table border="0" cellpadding="0" cellspacing="0" width="100%">
17<tr bgcolor="#E5E5E5">
18<td valign=center>
19 <a href="index.html">
20<font color="#004faf">Home</font></a>
21 | <a href="classes.html">
22<font color="#004faf">All&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;Classes</font></a>
25 | <a href="annotated.html">
26<font color="#004faf">Annotated</font></a>
27 | <a href="groups.html">
28<font color="#004faf">Grouped&nbsp;Classes</font></a>
29 | <a href="functions.html">
30<font color="#004faf">Functions</font></a>
31</td>
32<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QIMEvent Class Reference</h1>
33
34<p>The QIMEvent class provides parameters for input method events.
35<a href="#details">More...</a>
36<p><tt>#include &lt;<a href="qevent-h.html">qevent.h</a>&gt;</tt>
37<p>Inherits <a href="qevent.html">QEvent</a>.
38<p><a href="qimevent-members.html">List of all member functions.</a>
39<h2>Public Members</h2>
40<ul>
41<li class=fn><a href="#QIMEvent"><b>QIMEvent</b></a> ( Type&nbsp;type, const&nbsp;QString&nbsp;&amp;&nbsp;text, int&nbsp;cursorPosition )</li>
42<li class=fn>const QString &amp; <a href="#text"><b>text</b></a> () const</li>
43<li class=fn>int <a href="#cursorPos"><b>cursorPos</b></a> () const</li>
44<li class=fn>bool <a href="#isAccepted"><b>isAccepted</b></a> () const</li>
45<li class=fn>void <a href="#accept"><b>accept</b></a> ()</li>
46<li class=fn>void <a href="#ignore"><b>ignore</b></a> ()</li>
47<li class=fn>int <a href="#selectionLength"><b>selectionLength</b></a> () const</li>
48</ul>
49<hr><a name="details"></a><h2>Detailed Description</h2>
50
51
52The QIMEvent class provides parameters for input method events.
53<p>
54<p> Input method events are sent to widgets when an input method is
55used to enter text into a widget. Input methods are widely used to
56enter text in Asian and other complex languages.
57<p> The events are of interest to widgets that accept keyboard input
58and want to be able to correctly handle complex languages. Text
59input in such languages is usually a three step process.
60<p> <ol type=1>
61<li> <b>Starting to Compose</b><br>
62When the user presses the first key on a keyboard an input context
63is created. This input context will contain a string with the
64typed characters.
65<p> <li> <b>Composing</b><br>
66With every new key pressed, the input method will try to create a
67matching string for the text typed so far. While the input context
68is active, the user can only move the cursor inside the string
69belonging to this input context.
70<p> <li> <b>Completing</b><br>
71At some point, e.g. when the user presses the Spacebar, they get
72to this stage, where they can choose from a number of strings that
73match the text they have typed so far. The user can press Enter to
74confirm their choice or Escape to cancel the input; in either case
75the input context will be closed.
76</ol>
77<p> Note that the particular key presses used for a given input
78context may differ from those we've mentioned here, i.e. they may
79not be Spacebar, Enter and Escape.
80<p> These three stages are represented by three different types of
81events. The IMStartEvent, IMComposeEvent and IMEndEvent. When a
82new input context is created, an IMStartEvent will be sent to the
83widget and delivered to the <a href="qwidget.html#imStartEvent">QWidget::imStartEvent</a>() function.
84The widget can then update internal data structures to reflect
85this.
86<p> After this, an IMComposeEvent will be sent to the widget for
87every key the user presses. It will contain the current
88composition string the widget has to show and the current cursor
89position within the composition string. This string is temporary
90and can change with every key the user types, so the widget will
91need to store the state before the composition started (the state
92it had when it received the IMStartEvent). IMComposeEvents will be
93delivered to the <a href="qwidget.html#imComposeEvent">QWidget::imComposeEvent</a>() function.
94<p> Usually, widgets try to mark the part of the text that is part of
95the current composition in a way that is visible to the user. A
96commonly used visual cue is to use a dotted underline.
97<p> After the user has selected the final string, an IMEndEvent will
98be sent to the widget. The event contains the final string the
99user selected, and could be empty if they canceled the
100composition. This string should be accepted as the final text the
101user entered, and the intermediate composition string should be
102cleared. These events are delivered to <a href="qwidget.html#imEndEvent">QWidget::imEndEvent</a>().
103<p> If the user clicks another widget, taking the focus out of the
104widget where the composition is taking place the IMEndEvent will
105be sent and the string it holds will be the result of the
106composition up to that point (which may be an empty string).
107<p>See also <a href="events.html">Event Classes</a>.
108
109<hr><h2>Member Function Documentation</h2>
110<h3 class=fn><a name="QIMEvent"></a>QIMEvent::QIMEvent ( <a href="qevent.html#Type-enum">Type</a>&nbsp;type, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;text, int&nbsp;cursorPosition )
111</h3>
112
113<p> Constructs a new QIMEvent with the accept flag set to FALSE. <em>type</em> can be one of QEvent::IMStartEvent, QEvent::IMComposeEvent
114or QEvent::IMEndEvent. <em>text</em> contains the current compostion
115string and <em>cursorPosition</em> the current position of the cursor
116inside <em>text</em>.
117
118<h3 class=fn>void <a name="accept"></a>QIMEvent::accept ()
119</h3>
120
121<p> Sets the accept flag of the input method event object.
122<p> Setting the accept parameter indicates that the receiver of the
123event processed the input method event.
124<p> The accept flag is not set by default.
125<p> <p>See also <a href="#ignore">ignore</a>().
126
127<h3 class=fn>int <a name="cursorPos"></a>QIMEvent::cursorPos () const
128</h3>
129
130<p> Returns the current cursor position inside the composition string.
131Will return -1 for IMStartEvent and IMEndEvent.
132
133<h3 class=fn>void <a name="ignore"></a>QIMEvent::ignore ()
134</h3>
135
136<p> Clears the accept flag parameter of the input method event object.
137<p> Clearing the accept parameter indicates that the event receiver
138does not want the input method event.
139<p> The accept flag is cleared by default.
140<p> <p>See also <a href="#accept">accept</a>().
141
142<h3 class=fn>bool <a name="isAccepted"></a>QIMEvent::isAccepted () const
143</h3>
144
145<p> Returns TRUE if the receiver of the event processed the event;
146otherwise returns FALSE.
147
148<h3 class=fn>int <a name="selectionLength"></a>QIMEvent::selectionLength () const
149</h3>
150
151<p> Returns the number of characters in the composition string (
152starting at <a href="#cursorPos">cursorPos</a>() ) that should be marked as selected by the
153input widget receiving the event.
154Will return 0 for IMStartEvent and IMEndEvent.
155
156<h3 class=fn>const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp; <a name="text"></a>QIMEvent::text () const
157</h3>
158
159<p> Returns the composition text. This is a null string for an
160IMStartEvent, and contains the final accepted string (which may be
161empty) in the IMEndEvent.
162
163<!-- eof -->
164<hr><p>
165This file is part of the <a href="index.html">Qt toolkit</a>.
166Copyright &copy; 1995-2007
167<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
168<table width=100% cellspacing=0 border=0><tr>
169<td>Copyright &copy; 2007
170<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
171<td align=right><div align=right>Qt 3.3.8</div>
172</table></div></address></body>
173</html>
Note: See TracBrowser for help on using the repository browser.