summaryrefslogtreecommitdiff
path: root/development/translation/shared/metatranslator.h
authorzecke <zecke>2004-01-09 19:13:35 (UTC)
committer zecke <zecke>2004-01-09 19:13:35 (UTC)
commit56bb9961db1158250bbfe971f4556b56c0bd6581 (patch) (unidiff)
treea4f40da98f695b5aadd845b68aaab41ac3d81826 /development/translation/shared/metatranslator.h
parent6875988077013544246ae0df7cc2e5d538a7f152 (diff)
downloadopie-56bb9961db1158250bbfe971f4556b56c0bd6581.zip
opie-56bb9961db1158250bbfe971f4556b56c0bd6581.tar.gz
opie-56bb9961db1158250bbfe971f4556b56c0bd6581.tar.bz2
Update lupdate and shared to Qt3.3 qt-copy sources
Some special replacement for $$(OPIEDIR) to make ar_* happy
Diffstat (limited to 'development/translation/shared/metatranslator.h') (more/less context) (show whitespace changes)
-rw-r--r--development/translation/shared/metatranslator.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/development/translation/shared/metatranslator.h b/development/translation/shared/metatranslator.h
index d35b202..a13f462 100644
--- a/development/translation/shared/metatranslator.h
+++ b/development/translation/shared/metatranslator.h
@@ -1,26 +1,32 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qt Linguist. 4** This file is part of Qt Linguist.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
12** licenses may use this file in accordance with the Qt Commercial License
13** Agreement provided with the Software.
14**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 15** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 16** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 17**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 18** See http://www.trolltech.com/gpl/ for GPL licensing information.
19** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
20** information about Qt Commercial License Agreements.
15** 21**
16** Contact info@trolltech.com if any conditions of this licensing are 22** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 23** not clear to you.
18** 24**
19**********************************************************************/ 25**********************************************************************/
20 26
21#ifndef METATRANSLATOR_H 27#ifndef METATRANSLATOR_H
22#define METATRANSLATOR_H 28#define METATRANSLATOR_H
23 29
24#include <qmap.h> 30#include <qmap.h>
25#include <qstring.h> 31#include <qstring.h>
26#include <qtranslator.h> 32#include <qtranslator.h>
@@ -61,39 +67,47 @@ private:
61 bool utfeight; 67 bool utfeight;
62 Type ty; 68 Type ty;
63}; 69};
64 70
65class MetaTranslator 71class MetaTranslator
66{ 72{
67public: 73public:
68 MetaTranslator(); 74 MetaTranslator();
69 MetaTranslator( const MetaTranslator& tor ); 75 MetaTranslator( const MetaTranslator& tor );
70 76
71 MetaTranslator& operator=( const MetaTranslator& tor ); 77 MetaTranslator& operator=( const MetaTranslator& tor );
72 78
79 void clear();
73 bool load( const QString& filename ); 80 bool load( const QString& filename );
74 bool save( const QString& filename ) const; 81 bool save( const QString& filename ) const;
75 bool release( const QString& filename, bool verbose = FALSE ) const; 82 bool release( const QString& filename, bool verbose = FALSE,
83 QTranslator::SaveMode mode = QTranslator::Stripped ) const;
76 84
77 bool contains( const char *context, const char *sourceText, 85 bool contains( const char *context, const char *sourceText,
78 const char *comment ) const; 86 const char *comment ) const;
79 void insert( const MetaTranslatorMessage& m ); 87 void insert( const MetaTranslatorMessage& m );
80 88
81 void stripObsoleteMessages(); 89 void stripObsoleteMessages();
82 void stripEmptyContexts(); 90 void stripEmptyContexts();
83 91
84 void setCodec( const char *name ); 92 void setCodec( const char *name );
85 QString toUnicode( const char *str, bool utf8 ) const; 93 QString toUnicode( const char *str, bool utf8 ) const;
86 94
87 QValueList<MetaTranslatorMessage> messages() const; 95 QValueList<MetaTranslatorMessage> messages() const;
88 QValueList<MetaTranslatorMessage> translatedMessages() const; 96 QValueList<MetaTranslatorMessage> translatedMessages() const;
89 97
90private: 98private:
91 typedef QMap<MetaTranslatorMessage, int> TMM; 99 typedef QMap<MetaTranslatorMessage, int> TMM;
92 typedef QMap<int, MetaTranslatorMessage> TMMInv; 100 typedef QMap<int, MetaTranslatorMessage> TMMInv;
93 101
94 TMM mm; 102 TMM mm;
95 QCString codecName; 103 QCString codecName;
96 QTextCodec *codec; 104 QTextCodec *codec;
97}; 105};
98 106
107/*
108 This is a quick hack. The proper way to handle this would be
109 to extend MetaTranslator's interface.
110*/
111#define ContextComment "QT_LINGUIST_INTERNAL_CONTEXT_COMMENT"
112
99#endif 113#endif