source: trunk/doc/html/qtranslatormessage.html

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

reference documentation added

File size: 12.9 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/qtranslator.cpp:1118 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QTranslatorMessage 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>QTranslatorMessage Class Reference</h1>
33
34<p>The QTranslatorMessage class contains a translator message and its
35properties.
36<a href="#details">More...</a>
37<p><tt>#include &lt;<a href="qtranslator-h.html">qtranslator.h</a>&gt;</tt>
38<p><a href="qtranslatormessage-members.html">List of all member functions.</a>
39<h2>Public Members</h2>
40<ul>
41<li class=fn><a href="#QTranslatorMessage"><b>QTranslatorMessage</b></a> ()</li>
42<li class=fn><a href="#QTranslatorMessage-2"><b>QTranslatorMessage</b></a> ( const&nbsp;char&nbsp;*&nbsp;context, const&nbsp;char&nbsp;*&nbsp;sourceText, const&nbsp;char&nbsp;*&nbsp;comment, const&nbsp;QString&nbsp;&amp;&nbsp;translation = QString::null )</li>
43<li class=fn><a href="#QTranslatorMessage-3"><b>QTranslatorMessage</b></a> ( QDataStream&nbsp;&amp;&nbsp;stream )</li>
44<li class=fn><a href="#QTranslatorMessage-4"><b>QTranslatorMessage</b></a> ( const&nbsp;QTranslatorMessage&nbsp;&amp;&nbsp;m )</li>
45<li class=fn>QTranslatorMessage &amp; <a href="#operator-eq"><b>operator=</b></a> ( const&nbsp;QTranslatorMessage&nbsp;&amp;&nbsp;m )</li>
46<li class=fn>uint <a href="#hash"><b>hash</b></a> () const</li>
47<li class=fn>const char * <a href="#context"><b>context</b></a> () const</li>
48<li class=fn>const char * <a href="#sourceText"><b>sourceText</b></a> () const</li>
49<li class=fn>const char * <a href="#comment"><b>comment</b></a> () const</li>
50<li class=fn>void <a href="#setTranslation"><b>setTranslation</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;translation )</li>
51<li class=fn>QString <a href="#translation"><b>translation</b></a> () const</li>
52<li class=fn>enum <a href="#Prefix-enum"><b>Prefix</b></a> { NoPrefix, Hash, HashContext, HashContextSourceText, HashContextSourceTextComment }</li>
53<li class=fn>void <a href="#write"><b>write</b></a> ( QDataStream&nbsp;&amp;&nbsp;stream, bool&nbsp;strip = FALSE, Prefix&nbsp;prefix = HashContextSourceTextComment ) const</li>
54<li class=fn>Prefix <a href="#commonPrefix"><b>commonPrefix</b></a> ( const&nbsp;QTranslatorMessage&nbsp;&amp;&nbsp;m ) const</li>
55<li class=fn>bool <a href="#operator-eq-eq"><b>operator==</b></a> ( const&nbsp;QTranslatorMessage&nbsp;&amp;&nbsp;m ) const</li>
56<li class=fn>bool <a href="#operator!-eq"><b>operator!=</b></a> ( const&nbsp;QTranslatorMessage&nbsp;&amp;&nbsp;m ) const</li>
57<li class=fn>bool <a href="#operator-lt"><b>operator&lt;</b></a> ( const&nbsp;QTranslatorMessage&nbsp;&amp;&nbsp;m ) const</li>
58<li class=fn>bool <a href="#operator-lt-eq"><b>operator&lt;=</b></a> ( const&nbsp;QTranslatorMessage&nbsp;&amp;&nbsp;m ) const</li>
59<li class=fn>bool <a href="#operator-gt"><b>operator&gt;</b></a> ( const&nbsp;QTranslatorMessage&nbsp;&amp;&nbsp;m ) const</li>
60<li class=fn>bool <a href="#operator-gt-eq"><b>operator&gt;=</b></a> ( const&nbsp;QTranslatorMessage&nbsp;&amp;&nbsp;m ) const</li>
61</ul>
62<hr><a name="details"></a><h2>Detailed Description</h2>
63
64
65<p> The QTranslatorMessage class contains a translator message and its
66properties.
67<p>
68
69<p> This class is of no interest to most applications. It is useful
70for translation tools such as <a href="linguist-manual.html">Qt
71 Linguist</a>. It is provided simply to make the API complete
72and regular.
73<p> For a <a href="qtranslator.html">QTranslator</a> object, a lookup key is a triple (<em>context</em>, <em>source text</em>, <em>comment</em>) that uniquely identifies a message. An
74extended key is a quadruple (<em>hash</em>, <em>context</em>, <em>source text</em>, <em>comment</em>), where <em>hash</em> is computed from the source text
75and the comment. Unless you plan to read and write messages
76yourself, you need not worry about the hash value.
77<p> QTranslatorMessage stores this triple or quadruple and the relevant
78translation if there is any.
79<p> <p>See also <a href="qtranslator.html">QTranslator</a>, <a href="environment.html">Environment Classes</a>, and <a href="i18n.html">Internationalization with Qt</a>.
80
81<hr><h2>Member Type Documentation</h2>
82<h3 class=fn><a name="Prefix-enum"></a>QTranslatorMessage::Prefix</h3>
83
84<p> Let (<em>h</em>, <em>c</em>, <em>s</em>, <em>m</em>) be the extended key. The possible
85prefixes are
86<ul>
87<li><tt>QTranslatorMessage::NoPrefix</tt> - no prefix
88<li><tt>QTranslatorMessage::Hash</tt> - only (<em>h</em>)
89<li><tt>QTranslatorMessage::HashContext</tt> - only (<em>h</em>, <em>c</em>)
90<li><tt>QTranslatorMessage::HashContextSourceText</tt> - only (<em>h</em>, <em>c</em>, <em>s</em>)
91<li><tt>QTranslatorMessage::HashContextSourceTextComment</tt> - the whole extended key, (<em>h</em>, <em>c</em>, <em>s</em>, <em>m</em>)
92</ul><p> <p>See also <a href="#write">write</a>() and <a href="#commonPrefix">commonPrefix</a>().
93
94<hr><h2>Member Function Documentation</h2>
95<h3 class=fn><a name="QTranslatorMessage"></a>QTranslatorMessage::QTranslatorMessage ()
96</h3>
97Constructs a translator message with the extended key (0, 0, 0, 0)
98and <a href="qstring.html#QString-null">QString::null</a> as translation.
99
100<h3 class=fn><a name="QTranslatorMessage-2"></a>QTranslatorMessage::QTranslatorMessage ( const&nbsp;char&nbsp;*&nbsp;context, const&nbsp;char&nbsp;*&nbsp;sourceText, const&nbsp;char&nbsp;*&nbsp;comment, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;translation = QString::null )
101</h3>
102Constructs an translator message with the extended key (<em>h</em>, <em>context</em>, <em>sourceText</em>, <em>comment</em>), where <em>h</em> is computed from
103<em>sourceText</em> and <em>comment</em>, and possibly with a <em>translation</em>.
104
105<h3 class=fn><a name="QTranslatorMessage-3"></a>QTranslatorMessage::QTranslatorMessage ( <a href="qdatastream.html">QDataStream</a>&nbsp;&amp;&nbsp;stream )
106</h3>
107Constructs a translator message read from the <em>stream</em>. The
108resulting message may have any combination of content.
109<p> <p>See also <a href="qtranslator.html#save">QTranslator::save</a>().
110
111<h3 class=fn><a name="QTranslatorMessage-4"></a>QTranslatorMessage::QTranslatorMessage ( const&nbsp;<a href="qtranslatormessage.html">QTranslatorMessage</a>&nbsp;&amp;&nbsp;m )
112</h3>
113Constructs a copy of translator message <em>m</em>.
114
115<h3 class=fn>const char * <a name="comment"></a>QTranslatorMessage::comment () const
116</h3>
117
118<p> Returns the comment for this message (e.g. "File|Save").
119<p> <b>Warning:</b> This may return 0 if the <a href="qtranslator.html">QTranslator</a> object is stripped
120(compressed).
121
122<h3 class=fn><a href="qtranslatormessage.html#Prefix-enum">Prefix</a> <a name="commonPrefix"></a>QTranslatorMessage::commonPrefix ( const&nbsp;<a href="qtranslatormessage.html">QTranslatorMessage</a>&nbsp;&amp;&nbsp;m ) const
123</h3>
124Returns the widest lookup prefix that is common to this translator
125message and to message <em>m</em>.
126<p> For example, if the extended key is for this message is (71,
127"PrintDialog", "Yes", "Print?") and that for <em>m</em> is (71,
128"PrintDialog", "No", "Print?"), this function returns <a href="#Prefix-enum">HashContext</a>.
129<p> <p>See also <a href="#write">write</a>().
130
131<h3 class=fn>const char * <a name="context"></a>QTranslatorMessage::context () const
132</h3>
133
134<p> Returns the context for this message (e.g. "MyDialog").
135<p> <b>Warning:</b> This may return 0 if the <a href="qtranslator.html">QTranslator</a> object is stripped
136(compressed).
137
138<h3 class=fn>uint <a name="hash"></a>QTranslatorMessage::hash () const
139</h3>
140
141<p> Returns the hash value used internally to represent the lookup
142key. This value is zero only if this translator message was
143constructed from a stream containing invalid data.
144<p> The hashing function is unspecified, but it will remain unchanged
145in future versions of Qt.
146
147<h3 class=fn>bool <a name="operator!-eq"></a>QTranslatorMessage::operator!= ( const&nbsp;<a href="qtranslatormessage.html">QTranslatorMessage</a>&nbsp;&amp;&nbsp;m ) const
148</h3>
149
150<p> Returns TRUE if the extended key of this object is different from
151that of <em>m</em>; otherwise returns FALSE.
152
153<h3 class=fn>bool <a name="operator-lt"></a>QTranslatorMessage::operator&lt; ( const&nbsp;<a href="qtranslatormessage.html">QTranslatorMessage</a>&nbsp;&amp;&nbsp;m ) const
154</h3>
155Returns TRUE if the extended key of this object is
156lexicographically before than that of <em>m</em>; otherwise returns
157FALSE.
158
159<h3 class=fn>bool <a name="operator-lt-eq"></a>QTranslatorMessage::operator&lt;= ( const&nbsp;<a href="qtranslatormessage.html">QTranslatorMessage</a>&nbsp;&amp;&nbsp;m ) const
160</h3>
161
162<p> Returns TRUE if the extended key of this object is
163lexicographically before that of <em>m</em> or if they are equal;
164otherwise returns FALSE.
165
166<h3 class=fn><a href="qtranslatormessage.html">QTranslatorMessage</a>&nbsp;&amp; <a name="operator-eq"></a>QTranslatorMessage::operator= ( const&nbsp;<a href="qtranslatormessage.html">QTranslatorMessage</a>&nbsp;&amp;&nbsp;m )
167</h3>
168Assigns message <em>m</em> to this translator message and returns a
169reference to this translator message.
170
171<h3 class=fn>bool <a name="operator-eq-eq"></a>QTranslatorMessage::operator== ( const&nbsp;<a href="qtranslatormessage.html">QTranslatorMessage</a>&nbsp;&amp;&nbsp;m ) const
172</h3>
173Returns TRUE if the extended key of this object is equal to that of
174<em>m</em>; otherwise returns FALSE.
175
176<h3 class=fn>bool <a name="operator-gt"></a>QTranslatorMessage::operator&gt; ( const&nbsp;<a href="qtranslatormessage.html">QTranslatorMessage</a>&nbsp;&amp;&nbsp;m ) const
177</h3>
178
179<p> Returns TRUE if the extended key of this object is
180lexicographically after that of <em>m</em>; otherwise returns FALSE.
181
182<h3 class=fn>bool <a name="operator-gt-eq"></a>QTranslatorMessage::operator&gt;= ( const&nbsp;<a href="qtranslatormessage.html">QTranslatorMessage</a>&nbsp;&amp;&nbsp;m ) const
183</h3>
184
185<p> Returns TRUE if the extended key of this object is
186lexicographically after that of <em>m</em> or if they are equal;
187otherwise returns FALSE.
188
189<h3 class=fn>void <a name="setTranslation"></a>QTranslatorMessage::setTranslation ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;translation )
190</h3>
191
192<p> Sets the translation of the source text to <em>translation</em>.
193<p> <p>See also <a href="#translation">translation</a>().
194
195<h3 class=fn>const char * <a name="sourceText"></a>QTranslatorMessage::sourceText () const
196</h3>
197
198<p> Returns the source text of this message (e.g. "&Save").
199<p> <b>Warning:</b> This may return 0 if the <a href="qtranslator.html">QTranslator</a> object is stripped
200(compressed).
201
202<h3 class=fn><a href="qstring.html">QString</a> <a name="translation"></a>QTranslatorMessage::translation () const
203</h3>
204
205<p> Returns the translation of the source text (e.g., "&Sauvegarder").
206<p> <p>See also <a href="#setTranslation">setTranslation</a>().
207
208<h3 class=fn>void <a name="write"></a>QTranslatorMessage::write ( <a href="qdatastream.html">QDataStream</a>&nbsp;&amp;&nbsp;stream, bool&nbsp;strip = FALSE, <a href="qtranslatormessage.html#Prefix-enum">Prefix</a>&nbsp;prefix = HashContextSourceTextComment ) const
209</h3>
210Writes this translator message to the <em>stream</em>. If <em>strip</em> is
211FALSE (the default), all the information in the message is
212written. If <em>strip</em> is TRUE, only the part of the extended key
213specified by <em>prefix</em> is written with the translation (<a href="#Prefix-enum">HashContextSourceTextComment</a> by default).
214<p> <p>See also <a href="#commonPrefix">commonPrefix</a>().
215
216<!-- eof -->
217<hr><p>
218This file is part of the <a href="index.html">Qt toolkit</a>.
219Copyright &copy; 1995-2007
220<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
221<table width=100% cellspacing=0 border=0><tr>
222<td>Copyright &copy; 2007
223<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
224<td align=right><div align=right>Qt 3.3.8</div>
225</table></div></address></body>
226</html>
Note: See TracBrowser for help on using the repository browser.