Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 112b0974ad288f6cd55bf971ee6026a9 > files > 1982

libqt3-devel-3.0.2-2mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /tmp/qt-3.0-reggie-28534/qt-x11-free-3.0.2/src/kernel/qtranslator.cpp:1009 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>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: #ffffff; color: black; }
--></style>
</head>
<body>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
 <a href="index.html">
<font color="#004faf">Home</font></a>
 | <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
 | <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
 | <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
 | <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
 | <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<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>

<p><center><font color="red"><b>The API for this class is under development and is subject to change.</b><br>
 We do not recommend the use of this class for production work at this time.</font></center>
<p>The QTranslatorMessage class contains a translator message and its
properties.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qtranslator-h.html">qtranslator.h</a>&gt;</tt>
<p><a href="qtranslatormessage-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class=fn><a href="#QTranslatorMessage"><b>QTranslatorMessage</b></a> ()</div></li>
<li><div 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 )</div></li>
<li><div class=fn><a href="#QTranslatorMessage-3"><b>QTranslatorMessage</b></a> ( QDataStream&nbsp;&amp;&nbsp;stream )</div></li>
<li><div class=fn><a href="#QTranslatorMessage-4"><b>QTranslatorMessage</b></a> ( const&nbsp;QTranslatorMessage&nbsp;&amp;&nbsp;m )</div></li>
<li><div class=fn>QTranslatorMessage &amp; <a href="#operator-eq"><b>operator=</b></a> ( const&nbsp;QTranslatorMessage&nbsp;&amp;&nbsp;m )</div></li>
<li><div class=fn>uint <a href="#hash"><b>hash</b></a> () const</div></li>
<li><div class=fn>const char * <a href="#context"><b>context</b></a> () const</div></li>
<li><div class=fn>const char * <a href="#sourceText"><b>sourceText</b></a> () const</div></li>
<li><div class=fn>const char * <a href="#comment"><b>comment</b></a> () const</div></li>
<li><div class=fn>void <a href="#setTranslation"><b>setTranslation</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;translation )</div></li>
<li><div class=fn>QString <a href="#translation"><b>translation</b></a> () const</div></li>
<li><div class=fn>enum <a href="#Prefix-enum"><b>Prefix</b></a> { NoPrefix, Hash, HashContext, HashContextSourceText, HashContextSourceTextComment }</div></li>
<li><div class=fn>void <a href="#write"><b>write</b></a> ( QDataStream&nbsp;&amp;&nbsp;stream, bool&nbsp;strip = FALSE, Prefix&nbsp;prefix = HashContextSourceTextComment ) const</div></li>
<li><div class=fn>Prefix <a href="#commonPrefix"><b>commonPrefix</b></a> ( const&nbsp;QTranslatorMessage&nbsp;&amp;&nbsp;m ) const</div></li>
<li><div class=fn>bool <a href="#operator-eq-eq"><b>operator==</b></a> ( const&nbsp;QTranslatorMessage&nbsp;&amp;&nbsp;m ) const</div></li>
<li><div class=fn>bool <a href="#operator!-eq"><b>operator!=</b></a> ( const&nbsp;QTranslatorMessage&nbsp;&amp;&nbsp;m ) const</div></li>
<li><div class=fn>bool <a href="#operator-lt"><b>operator&lt;</b></a> ( const&nbsp;QTranslatorMessage&nbsp;&amp;&nbsp;m ) const</div></li>
<li><div class=fn>bool <a href="#operator-lt-eq"><b>operator&lt;=</b></a> ( const&nbsp;QTranslatorMessage&nbsp;&amp;&nbsp;m ) const</div></li>
<li><div class=fn>bool <a href="#operator-gt"><b>operator&gt;</b></a> ( const&nbsp;QTranslatorMessage&nbsp;&amp;&nbsp;m ) const</div></li>
<li><div class=fn>bool <a href="#operator-gt-eq"><b>operator&gt;=</b></a> ( const&nbsp;QTranslatorMessage&nbsp;&amp;&nbsp;m ) const</div></li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>
 
<p> 
<p> The QTranslatorMessage class contains a translator message and its
properties.
<p> 

<p> This class is of no interest to most applications, just for
translation tools such as
<a href="linguist-manual.html">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</em>, <em>source text</em>, <em>comment</em>) that uniquely identifies a message.  An
extended 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
and the comment.  Unless you plan to read and write messages
yourself, you need not worry about the hash value.
<p> QTranslatorMessage stores this triple or quadruple and the relevant
translation if there is any.
<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>.

<hr><h2>Member Type Documentation</h2>
<h3 class=fn><a name="Prefix-enum"></a>QTranslatorMessage::Prefix</h3> 
<p> Let (<em>h</em>, <em>c</em>, <em>s</em>, <em>m</em>) be the extended key.  The possible prefixes are
<ul>
<li><tt>QTranslatorMessage::NoPrefix</tt> - no prefix
<li><tt>QTranslatorMessage::Hash</tt> - only (<em>h</em>)
<li><tt>QTranslatorMessage::HashContext</tt> - only (<em>h</em>, <em>c</em>)
<li><tt>QTranslatorMessage::HashContextSourceText</tt> - only (<em>h</em>, <em>c</em>, <em>s</em>)
<li><tt>QTranslatorMessage::HashContextSourceTextComment</tt> - the whole extended key, (<em>h</em>, <em>c</em>,
<em>s</em>, <em>m</em>)
</ul><p> <p>See also <a href="#write">write</a>() and <a href="#commonPrefix">commonPrefix</a>().

<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="QTranslatorMessage"></a>QTranslatorMessage::QTranslatorMessage ()
</h3>  Constructs a translator message with the extended key (0, 0, 0, 0) and
<a href="qstring.html#QString-null">QString::null</a> as translation.

<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 )
</h3>  Constructs 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
<em>sourceText</em> and <em>comment</em>, and possibly with a <em>translation</em>.

<h3 class=fn><a name="QTranslatorMessage-3"></a>QTranslatorMessage::QTranslatorMessage ( <a href="qdatastream.html">QDataStream</a>&nbsp;&amp;&nbsp;stream )
</h3>  Constructs a translator message read from a <em>stream</em>.  The resulting
message may have any combination of content.
<p> <p>See also <a href="qtranslator.html#save">QTranslator::save</a>().

<h3 class=fn><a name="QTranslatorMessage-4"></a>QTranslatorMessage::QTranslatorMessage ( const&nbsp;<a href="qtranslatormessage.html">QTranslatorMessage</a>&nbsp;&amp;&nbsp;m )
</h3>  Constructs a copy of translator message <em>m</em>.

<h3 class=fn>const char * <a name="comment"></a>QTranslatorMessage::comment () const
</h3> 
<p> Returns the comment for this message (e.g. "File|Save").

<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
</h3>  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, "PrintDialog",
"Yes", "Print?") and that for <em>m</em> is (42, "PrintDialog", "No", "Print?"),
this function returns <a href="#Prefix-enum">HashContext</a>.
<p> <p>See also <a href="#write">write</a>().

<h3 class=fn>const char * <a name="context"></a>QTranslatorMessage::context () const
</h3> 
<p> Returns the context for this message (e.g. "MyDialog").

<h3 class=fn>uint <a name="hash"></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="operator!-eq"></a>QTranslatorMessage::operator!= ( const&nbsp;<a href="qtranslatormessage.html">QTranslatorMessage</a>&nbsp;&amp;&nbsp;m ) const
</h3> 
<p> Returns TRUE if the extended key of this object is different from that of
<em>m</em>; otherwise returns FALSE.

<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
</h3>  Returns TRUE if the extended key of this object is lexicographically before
than that of <em>m</em>; otherwise returns FALSE.

<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
</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 returns FALSE.

<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 )
</h3>  Assigns message <em>m</em> to this translator message and returns a
reference to this translator message.

<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
</h3>  Returns TRUE if the extended key of this object is equal to that of <em>m</em>;
otherwise returns FALSE.

<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
</h3> 
<p> Returns TRUE if the extended key of this object is lexicographically after
that of <em>m</em>; otherwise returns FALSE.

<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
</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 returns FALSE.

<h3 class=fn>void <a name="setTranslation"></a>QTranslatorMessage::setTranslation ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;translation )
</h3> 
<p> Sets the translation of the source text to <em>translation</em>.
<p> <p>See also <a href="#translation">translation</a>().

<h3 class=fn>const char * <a name="sourceText"></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="translation"></a>QTranslatorMessage::translation () const
</h3> 
<p> Returns the translation of the source text (e.g., "&Sauvegarder").
<p> <p>See also <a href="#setTranslation">setTranslation</a>().

<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
</h3>
Writes this translator message to the <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 (<a href="#Prefix-enum">HashContextSourceTextComment</a> by default).
<p> <p>See also <a href="#commonPrefix">commonPrefix</a>().

<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>.
Copyright &copy; 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 &copy; 2001 
<a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align=right><div align=right>Qt version 3.0.2</div>
</table></div></address></body>
</html>