~ubuntu-branches/ubuntu/intrepid/kdesdk/intrepid-updates

« back to all changes in this revision

Viewing changes to lokalize/src/catalog/gettext/gettextimport.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2008-05-28 10:11:43 UTC
  • mto: This revision was merged to the branch mainline in revision 37.
  • Revision ID: james.westby@ubuntu.com-20080528101143-gzc3styjz1b70zxu
Tags: upstream-4.0.80
ImportĀ upstreamĀ versionĀ 4.0.80

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ****************************************************************************
 
2
  This file is part of KAider
 
3
  This file is based on the one from KBabel
 
4
 
 
5
  Copyright;
 
6
                2007    by Nick Shaforostoff <shafff@ukr.net>
 
7
 
 
8
 
 
9
  This program is free software; you can redistribute it and/or modify
 
10
  it under the terms of the GNU General Public License as published by
 
11
  the Free Software Foundation; either version 2 of the License, or
 
12
;
 
13
 
 
14
  This program is distributed in the hope that it will be useful,
 
15
  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
  GNU General Public License for more details.
 
18
 
 
19
  You should have received a copy of the GNU General Public License
 
20
  along with this program; if not, write to the Free Software
 
21
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
22
 
 
23
  In addition, as a special exception, the copyright holders give
 
24
  permission to link the code of this program with any edition of
 
25
  the Qt library by Trolltech AS, Norway;
 
26
  of Qt that use the same license as Qt), and distribute linked
 
27
  combinations including the two.  You must obey the GNU General
 
28
  Public License in all respects for all of the code used other than
 
29
  Qt. If you modify this file, you may extend this exception to
 
30
  your version of the file, but you are not obligated to do so.  If
 
31
  you do not wish to do so, delete this exception statement from
 
32
  your version.
 
33
 
 
34
**************************************************************************** */
 
35
#ifndef GETTEXTIMPORTPLUGIN_H
 
36
#define GETTEXTIMPORTPLUGIN_H
 
37
 
 
38
#include "catalogfileplugin.h"
 
39
 
 
40
#include <kdebug.h>
 
41
 
 
42
#include <QStringList>
 
43
#include <QTextStream>
 
44
 
 
45
class QTextCodec;
 
46
 
 
47
/* ****************************************************************************
 
48
  The class for importing GNU gettext PO files. As an extra information,
 
49
  it stores the list of all obsolete entries.
 
50
**************************************************************************** */
 
51
 
 
52
class GettextImportPlugin: public CatalogImportPlugin
 
53
{
 
54
public:
 
55
    GettextImportPlugin();
 
56
    virtual ConversionStatus load(const QString& file);
 
57
    virtual const QString id() {return "GNU gettext";}
 
58
 
 
59
private:
 
60
    QTextCodec* codecForArray(QByteArray&/*, bool* hadCodec*/);
 
61
    ConversionStatus readHeader(QTextStream& stream);
 
62
    ConversionStatus readEntry(QTextStream& stream);
 
63
 
 
64
    // description of the last read entry
 
65
    QString _msgctxt;
 
66
    QStringList _msgid;
 
67
    QStringList _msgstr;
 
68
    QString _comment;
 
69
    bool _gettextPluralForm;
 
70
    bool _testBorked;
 
71
    bool _obsolete;
 
72
 
 
73
    QRegExp _rxMsgCtxt;
 
74
    QRegExp _rxMsgId;
 
75
    QRegExp _rxMsgIdPlural;
 
76
    QRegExp _rxMsgIdPluralBorked;
 
77
    QRegExp _rxMsgIdBorked;
 
78
    QRegExp _rxMsgIdRemQuotes;
 
79
    QRegExp _rxMsgLineRemEndQuote;
 
80
    QRegExp _rxMsgLineRemStartQuote;
 
81
    QRegExp _rxMsgLine;
 
82
    QRegExp _rxMsgLineBorked;
 
83
    QRegExp _rxMsgStr;
 
84
    QRegExp _rxMsgStrOther;
 
85
    QRegExp _rxMsgStrPluralStart;
 
86
    QRegExp _rxMsgStrPluralStartBorked;
 
87
    QRegExp _rxMsgStrPlural;
 
88
    QRegExp _rxMsgStrPluralBorked;
 
89
    QRegExp _rxMsgStrRemQuotes;
 
90
 
 
91
    QString _obsoleteStart;
 
92
    QString _msgctxtStart;
 
93
};
 
94
 
 
95
#endif