1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Qt Toolkit - QTranslatorMessage Class</title><style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }body { background: white; color: black; }
--></style>
</head><body bgcolor="#ffffff">
<table width="100%">
<tr><td><a href="index.html">
<img width="100" height="100" src="qtlogo.png"
alt="Home" border="0"><img width="100"
height="100" src="face.png" alt="Home" border="0">
</a><td valign=top><div align=right><img src="dochead.png" width="472" height="27"><br>
<a href="classes.html"><b>Classes</b></a>
-<a href="annotated.html">Annotated</a>
- <a href="hierarchy.html">Tree</a>
-<a href="functions.html">Functions</a>
-<a href="index.html">Home</a>
-<a href="topicals.html"><b>Structure</b></a>
</div>
</table>
<h1 align=center>QTranslatorMessage Class Reference</h1><br clear="all">
<p>
The QTranslatorMessage class contains a translator message and its properties.
<a href="#details">More...</a>
<p>
<code>#include <<a href="qtranslator-h.html">qtranslator.h</a>></code>
<p><a href="qtranslatormessage-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class="fn"><a href="#56a587"><b>QTranslatorMessage</b></a>()</div>
<li><div class="fn"><a href="#f549b4"><b>QTranslatorMessage</b></a>(constchar*context, constchar*sourceText, constchar*comment, constQString&translation=QString::null)</div>
<li><div class="fn"><a href="#034404"><b>QTranslatorMessage</b></a>(QDataStream&)</div>
<li><div class="fn"><a href="#9f5219"><b>QTranslatorMessage</b></a>(constQTranslatorMessage&m)</div>
<li><div class="fn">QTranslatorMessage&<a href="#71a3e2"><b>operator=</b></a>(constQTranslatorMessage&m)</div>
<li><div class="fn">uint<a href="#c905a8"><b>hash</b></a>()const</div>
<li><div class="fn">constchar*<a href="#ceae6d"><b>context</b></a>()const</div>
<li><div class="fn">constchar*<a href="#96eff7"><b>sourceText</b></a>()const</div>
<li><div class="fn">constchar*<a href="#840482"><b>comment</b></a>()const</div>
<li><div class="fn">void<a href="#9600e8"><b>setTranslation</b></a>(constQString&translation)</div>
<li><div class="fn">QString<a href="#d30c72"><b>translation</b></a>()const</div>
<li><div class="fn">enum<a href="#Prefix"><b>Prefix</b></a>{NoPrefix, Hash, HashContext, HashContextSourceText, HashContextSourceTextComment}</div>
<li><div class="fn">void<a href="#bb7382"><b>write</b></a>(QDataStream&s, boolstrip, Prefixprefix=HashContextSourceTextComment)const</div>
<li><div class="fn">Prefix<a href="#5415e4"><b>commonPrefix</b></a>(constQTranslatorMessage&)const</div>
<li><div class="fn">bool<a href="#39174a"><b>operator==</b></a>(constQTranslatorMessage&m)const</div>
<li><div class="fn">bool<a href="#1aa1cf"><b>operator!=</b></a>(constQTranslatorMessage&m)const</div>
<li><div class="fn">bool<a href="#f263a8"><b>operator<</b></a>(constQTranslatorMessage&m)const</div>
<li><div class="fn">bool<a href="#09b119"><b>operator<=</b></a>(constQTranslatorMessage&m)const</div>
<li><div class="fn">bool<a href="#13ac81"><b>operator></b></a>(constQTranslatorMessage&m)const</div>
<li><div class="fn">bool<a href="#ef047d"><b>operator>=</b></a>(constQTranslatorMessage&m)const</div>
</ul>
<hr><h2><a name="details"></a>Detailed Description</h2>
The QTranslatorMessage class contains a translator message and its properties.
<p>
This class is of no interest to most applications, just for
translation tools, e.g.
<a href="http://www.trolltech.com/linguist/">Qt Linguist.</a> It is
provided simply to make the API complete and regular.
<p>For a <a href="qtranslator.html">QTranslator</a> object, a lookup key is a triple ( <em>context, source text, comment</em> ) that uniquely identifies a message. An
extended key is a quadruple ( <em>hash, context, source text, comment</em> ), where <em>hash</em> is computed from the source text
and the comment. Unless you plan to read and write messages
yourself, you need not worry about the hash value.
<p>QTranslatorMessage stores theis triple or quadruple, the relevant
translation if there is any, and the status of the message.
<p>See also <a href="qtranslator.html">QTranslator</a>.
<hr><h2>Member Type Documentation</h2>
<h3 class="fn"><a name="Prefix">QTranslatorMessage::Prefix</a></h3>
Let ( <em>h, c, s, m</em> ) be the extended key. The possible prefixes are
<p><ul>
<li> <code>NoPrefix</code> - no prefix
<li> <code>Hash</code> - only ( <em>h</em> )
<li> <code>HashContext</code> - only ( <em>h, c</em> )
<li> <code>HashContextSourceText</code> - only ( <em>h, c, s</em> )
<li> <code>HashContextSourceTextComment</code> - the whole extended key, ( <em>h, c, s, m</em> )
</ul>
<p>See also <a href="#bb7382">write</a>() and <a href="#5415e4">commonPrefix</a>().
<hr><h2>Member Function Documentation</h2>
<h3 class="fn"><a name="56a587"></a>QTranslatorMessage::QTranslatorMessage()</h3>
<p>Constructs a translator message with extended key ( 0, "", "", "" ) and
QString::null as translation.
<h3 class="fn"><a name="034404"></a>QTranslatorMessage::QTranslatorMessage(<a href="qdatastream.html">QDataStream</a>&stream)</h3>
<p>Constructs a translator message read from a <em>stream.</em> The resulting
message may have any combination of content.
<p>See also save().
<h3 class="fn"><a name="9f5219"></a>QTranslatorMessage::QTranslatorMessage(constQTranslatorMessage&m)</h3>
<p>Constructs a copy of translator message <em>m.</em>
<h3 class="fn"><a name="f549b4"></a>QTranslatorMessage::QTranslatorMessage(constchar*context, constchar*sourceText, constchar*comment, const<a href="qstring.html">QString</a>&translation=QString::null)</h3>
<p>Constructs an translator message with extended key
( <em>h, context, sourceText, comment</em> ), where <em>h</em> is computed from
<em>sourceText</em> and <em>comment,</em> and possibly with a <em>translation.</em>
<h3 class="fn">constchar*<a name="840482"></a>QTranslatorMessage::comment()const</h3>
<p>Returns the comment for this message (e.g., "File > Save").
<h3 class="fn">QTranslatorMessage::Prefix<a name="5415e4"></a>QTranslatorMessage::commonPrefix(constQTranslatorMessage&m)const</h3>
<p>Returns the widest lookup prefix that is common to this translator message
and message <em>m.</em>
<p>For example, if the extended key is for this message is ( 42, "FunnyDialog",
"Yes", "Funny?" ) and that for <em>m</em> is ( 42, "FunnyDialog", "No", "Funny?" ),
returns <code>HashContext.</code>
<p>See also <a href="#bb7382">write</a>().
<h3 class="fn">constchar*<a name="ceae6d"></a>QTranslatorMessage::context()const</h3>
<p>Returns the context for this message (e.g., "FunnyDialog").
<h3 class="fn">uint<a name="c905a8"></a>QTranslatorMessage::hash()const</h3>
<p>Returns the hash value used internally to represent the lookup key. This
value is zero only if this translator message was constructed from a stream
containing invalid data.
<p>The hashing function is unspecified, but it will remain unchanged in future
versions of Qt.
<h3 class="fn">bool<a name="1aa1cf"></a>QTranslatorMessage::operator!=(constQTranslatorMessage&m)const</h3>
<p>Returns TRUE if the extended key of this object is different from that of
<em>m,</em> otherwise FALSE.
<h3 class="fn">bool<a name="f263a8"></a>QTranslatorMessage::operator<(constQTranslatorMessage&m)const</h3>
<p>Returns TRUE if the extended key of this object is lexicographically before
than that of <em>m,</em> otherwise FALSE.
<h3 class="fn">bool<a name="09b119"></a>QTranslatorMessage::operator<=(constQTranslatorMessage&m)const</h3>
<p>Returns TRUE if the extended key of this object is lexicographically before
that of <em>m</em> or if they are equal, otherwise FALSE.
<h3 class="fn">QTranslatorMessage&<a name="71a3e2"></a>QTranslatorMessage::operator=(constQTranslatorMessage&m)</h3>
<p>Assigns <em>m</em> to this translator message and returns a reference to this
translator message.
<h3 class="fn">bool<a name="39174a"></a>QTranslatorMessage::operator==(constQTranslatorMessage&m)const</h3>
<p>Returns TRUE if the extended key of this object is equal to that of <em>m,</em>
otherwise FALSE.
<h3 class="fn">bool<a name="13ac81"></a>QTranslatorMessage::operator>(constQTranslatorMessage&m)const</h3>
<p>Returns TRUE if the extended key of this object is lexicographically after
that of <em>m,</em> otherwise FALSE.
<h3 class="fn">bool<a name="ef047d"></a>QTranslatorMessage::operator>=(constQTranslatorMessage&m)const</h3>
<p>Returns TRUE if the extended key of this object is lexicographically after
that of <em>m</em> or if they are equal, otherwise FALSE.
<h3 class="fn">void<a name="9600e8"></a>QTranslatorMessage::setTranslation(const<a href="qstring.html">QString</a>&translation)</h3>
<p>Sets the translation of the source text.
<p>See also <a href="#d30c72">translation</a>().
<h3 class="fn">constchar*<a name="96eff7"></a>QTranslatorMessage::sourceText()const</h3>
<p>Returns the source text of this message (e.g., "&Save").
<h3 class="fn"><a href="qstring.html">QString</a><a name="d30c72"></a>QTranslatorMessage::translation()const</h3>
<p>Returns the translation of the source text (e.g., "&Sauvegarder").
<p>See also <a href="#9600e8">setTranslation</a>().
<h3 class="fn">void<a name="bb7382"></a>QTranslatorMessage::write(<a href="qdatastream.html">QDataStream</a>&stream, boolstrip, <a href="qtranslatormessage.html#Prefix">Prefix</a>prefix=HashContextSourceTextComment)const</h3>
<p>Writes this translator message to a <em>stream.</em> If <em>strip</em> is FALSE (the
default), all the information in the message is written. If <em>strip</em> is TRUE,
only the part of the extended key specified by <em>prefix</em> is written with the
translation (<code>HashContextSourceTextComment</code> by default).
<p>See also <a href="#5415e4">commonPrefix</a>().
<hr><p>
Search the documentation, FAQ, qt-interest archive and more (uses
<a href="http://www.trolltech.com">www.trolltech.com</a>):<br>
<form method=post action="http://www.trolltech.com/search.cgi">
<input type=hidden name="version" value="2.3.2"><nobr>
<input size="50" name="search"><input type=submit value="Search">
</nobr></form><hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>,
copyright © 1995-2001
<a href="http://www.trolltech.com">Trolltech</a>, all rights reserved.<p><address><hr><div align="center">
<table width="100%" cellspacing="0" border="0"><tr>
<td>Copyright 2001 Trolltech<td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align="right"><div align="right">Qt version 2.3.2</div>
</table></div></address></body></html>
|