summaryrefslogtreecommitdiffstats
path: root/doc/man/man3/qtranslatormessage.3qt
blob: 82c0471e0e3987f651da50cc3637c7ed52c8e659 (plain)
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
'\" t
.TH QTranslatorMessage 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA.  All rights reserved.  See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
QTranslatorMessage \- Translator message and its properties
.SH SYNOPSIS
\fC#include <ntqtranslator.h>\fR
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBQTranslatorMessage\fR ()"
.br
.ti -1c
.BI "\fBQTranslatorMessage\fR ( const char * context, const char * sourceText, const char * comment, const QString & translation = QString::null )"
.br
.ti -1c
.BI "\fBQTranslatorMessage\fR ( QDataStream & stream )"
.br
.ti -1c
.BI "\fBQTranslatorMessage\fR ( const QTranslatorMessage & m )"
.br
.ti -1c
.BI "QTranslatorMessage & \fBoperator=\fR ( const QTranslatorMessage & m )"
.br
.ti -1c
.BI "uint \fBhash\fR () const"
.br
.ti -1c
.BI "const char * \fBcontext\fR () const"
.br
.ti -1c
.BI "const char * \fBsourceText\fR () const"
.br
.ti -1c
.BI "const char * \fBcomment\fR () const"
.br
.ti -1c
.BI "void \fBsetTranslation\fR ( const QString & translation )"
.br
.ti -1c
.BI "QString \fBtranslation\fR () const"
.br
.ti -1c
.BI "enum \fBPrefix\fR { NoPrefix, Hash, HashContext, HashContextSourceText, HashContextSourceTextComment }"
.br
.ti -1c
.BI "void \fBwrite\fR ( QDataStream & stream, bool strip = FALSE, Prefix prefix = HashContextSourceTextComment ) const"
.br
.ti -1c
.BI "Prefix \fBcommonPrefix\fR ( const QTranslatorMessage & m ) const"
.br
.ti -1c
.BI "bool \fBoperator==\fR ( const QTranslatorMessage & m ) const"
.br
.ti -1c
.BI "bool \fBoperator!=\fR ( const QTranslatorMessage & m ) const"
.br
.ti -1c
.BI "bool \fBoperator<\fR ( const QTranslatorMessage & m ) const"
.br
.ti -1c
.BI "bool \fBoperator<=\fR ( const QTranslatorMessage & m ) const"
.br
.ti -1c
.BI "bool \fBoperator>\fR ( const QTranslatorMessage & m ) const"
.br
.ti -1c
.BI "bool \fBoperator>=\fR ( const QTranslatorMessage & m ) const"
.br
.in -1c
.SH DESCRIPTION
The QTranslatorMessage class contains a translator message and its properties.
.PP
This class is of no interest to most applications. It is useful for translation tools such as Qt Linguist. It is provided simply to make the API complete and regular.
.PP
For a QTranslator object, a lookup key is a triple (\fIcontext\fR, \fIsource text\fR, \fIcomment\fR) that uniquely identifies a message. An extended key is a quadruple (\fIhash\fR, \fIcontext\fR, \fIsource text\fR, \fIcomment\fR), where \fIhash\fR 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.
.PP
QTranslatorMessage stores this triple or quadruple and the relevant translation if there is any.
.PP
See also QTranslator, Environment Classes, and Internationalization with Qt.
.SS "Member Type Documentation"
.SH "QTranslatorMessage::Prefix"
Let (\fIh\fR, \fIc\fR, \fIs\fR, \fIm\fR) be the extended key. The possible prefixes are
.TP
\fCQTranslatorMessage::NoPrefix\fR - no prefix
.TP
\fCQTranslatorMessage::Hash\fR - only (\fIh\fR)
.TP
\fCQTranslatorMessage::HashContext\fR - only (\fIh\fR, \fIc\fR)
.TP
\fCQTranslatorMessage::HashContextSourceText\fR - only (\fIh\fR, \fIc\fR, \fIs\fR)
.TP
\fCQTranslatorMessage::HashContextSourceTextComment\fR - the whole extended key, (\fIh\fR, \fIc\fR, \fIs\fR, \fIm\fR)
.PP
See also write() and commonPrefix().
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QTranslatorMessage::QTranslatorMessage ()"
Constructs a translator message with the extended key (0, 0, 0, 0) and QString::null as translation.
.SH "QTranslatorMessage::QTranslatorMessage ( const char * context, const char * sourceText, const char * comment, const QString & translation = QString::null )"
Constructs an translator message with the extended key (\fIh\fR, \fIcontext\fR, \fIsourceText\fR, \fIcomment\fR), where \fIh\fR is computed from \fIsourceText\fR and \fIcomment\fR, and possibly with a \fItranslation\fR.
.SH "QTranslatorMessage::QTranslatorMessage ( QDataStream & stream )"
Constructs a translator message read from the \fIstream\fR. The resulting message may have any combination of content.
.PP
See also QTranslator::save().
.SH "QTranslatorMessage::QTranslatorMessage ( const QTranslatorMessage & m )"
Constructs a copy of translator message \fIm\fR.
.SH "const char * QTranslatorMessage::comment () const"
Returns the comment for this message (e.g. "File|Save").
.PP
\fBWarning:\fR This may return 0 if the QTranslator object is stripped (compressed).
.SH "Prefix QTranslatorMessage::commonPrefix ( const QTranslatorMessage & m ) const"
Returns the widest lookup prefix that is common to this translator message and to message \fIm\fR.
.PP
For example, if the extended key is for this message is (71," PrintDialog", "Yes", "Print?") and that for \fIm\fR is (71," PrintDialog", "No", "Print?"), this function returns HashContext.
.PP
See also write().
.SH "const char * QTranslatorMessage::context () const"
Returns the context for this message (e.g. "MyDialog").
.PP
\fBWarning:\fR This may return 0 if the QTranslator object is stripped (compressed).
.SH "uint QTranslatorMessage::hash () const"
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.
.PP
The hashing function is unspecified, but it will remain unchanged in future versions of Qt.
.SH "bool QTranslatorMessage::operator!= ( const QTranslatorMessage & m ) const"
Returns TRUE if the extended key of this object is different from that of \fIm\fR; otherwise returns FALSE.
.SH "bool QTranslatorMessage::operator< ( const QTranslatorMessage & m ) const"
Returns TRUE if the extended key of this object is lexicographically before than that of \fIm\fR; otherwise returns FALSE.
.SH "bool QTranslatorMessage::operator<= ( const QTranslatorMessage & m ) const"
Returns TRUE if the extended key of this object is lexicographically before that of \fIm\fR or if they are equal; otherwise returns FALSE.
.SH "QTranslatorMessage & QTranslatorMessage::operator= ( const QTranslatorMessage & m )"
Assigns message \fIm\fR to this translator message and returns a reference to this translator message.
.SH "bool QTranslatorMessage::operator== ( const QTranslatorMessage & m ) const"
Returns TRUE if the extended key of this object is equal to that of \fIm\fR; otherwise returns FALSE.
.SH "bool QTranslatorMessage::operator> ( const QTranslatorMessage & m ) const"
Returns TRUE if the extended key of this object is lexicographically after that of \fIm\fR; otherwise returns FALSE.
.SH "bool QTranslatorMessage::operator>= ( const QTranslatorMessage & m ) const"
Returns TRUE if the extended key of this object is lexicographically after that of \fIm\fR or if they are equal; otherwise returns FALSE.
.SH "void QTranslatorMessage::setTranslation ( const QString & translation )"
Sets the translation of the source text to \fItranslation\fR.
.PP
See also translation().
.SH "const char * QTranslatorMessage::sourceText () const"
Returns the source text of this message (e.g. "&Save").
.PP
\fBWarning:\fR This may return 0 if the QTranslator object is stripped (compressed).
.SH "QString QTranslatorMessage::translation () const"
Returns the translation of the source text (e.g., "&Sauvegarder").
.PP
See also setTranslation().
.SH "void QTranslatorMessage::write ( QDataStream & stream, bool strip = FALSE, Prefix prefix = HashContextSourceTextComment ) const"
Writes this translator message to the \fIstream\fR. If \fIstrip\fR is FALSE (the default), all the information in the message is written. If \fIstrip\fR is TRUE, only the part of the extended key specified by \fIprefix\fR is written with the translation (HashContextSourceTextComment by default).
.PP
See also commonPrefix().

.SH "SEE ALSO"
.BR http://doc.trolltech.com/qtranslatormessage.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive Qt documentation is provided in HTML format; it is
located at $QTDIR/doc/html and can be read using Qt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech. 
.P
If you find errors in this manual page, please report them to
.BR [email protected] .
Please include the name of the manual page (qtranslatormessage.3qt) and the Qt
version (3.3.8).