• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

lokalize

  • sources
  • kde-4.14
  • kdesdk
  • lokalize
  • src
  • catalog
  • gettext
catalogfileplugin.h
Go to the documentation of this file.
1 /* ****************************************************************************
2  This file is part of KAider
3  This file contains parts of KBabel code
4 
5  Copyright (C) 2002-2003 by Stanislav Visnovsky
6  <visnovsky@kde.org>
7 
8  This program is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 2 of the License, or
11  (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program; if not, write to the Free Software
20  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 
22  In addition, as a special exception, the copyright holders give
23  permission to link the code of this program with any edition of
24  the Qt library by Trolltech AS, Norway (or with modified versions
25  of Qt that use the same license as Qt), and distribute linked
26  combinations including the two. You must obey the GNU General
27  Public License in all respects for all of the code used other than
28  Qt. If you modify this file, you may extend this exception to
29  your version of the file, but you are not obligated to do so. If
30  you do not wish to do so, delete this exception statement from
31  your version.
32 **************************************************************************** */
33 #ifndef KATALOGFILEPLUGIN_H
34 #define KATALOGFILEPLUGIN_H
35 
36 #include <kdemacros.h>
37 #include <QList>
38 #include <QTextCodec>
39 class QIODevice;
40 class QString;
41 class QStringList;
42 
43 namespace GettextCatalog {
44 
45 class GettextStorage;
46 class CatalogItem;
47 class CatalogImportPluginPrivate;
48 class CatalogExportPluginPrivate;
49 
53 enum ConversionStatus {
54  OK=0,
55  NOT_IMPLEMENTED,
56  NO_FILE,
57  NO_PERMISSIONS,
58  PARSE_ERROR,
59  RECOVERED_PARSE_ERROR,
60  OS_ERROR,
61  NO_PLUGIN,
62  UNSUPPORTED_TYPE,
63  RECOVERED_HEADER_ERROR,
64  STOPPED,
65  BUSY,
66  NO_ENTRY_ERROR
67 };
68 
85 class CatalogImportPlugin
86 {
87 public:
88  CatalogImportPlugin();
89  virtual ~CatalogImportPlugin();
90 
100  ConversionStatus open(QIODevice*, GettextStorage* catalog, int* errorLine);
101 
112  virtual ConversionStatus load(QIODevice*) = 0;
113 
114 protected:
119  void appendCatalogItem( const CatalogItem& item, const bool obsolete = false );
120 
122  void setGeneratedFromDocbook(const bool fromDocbook);
124  void setErrorIndex(const QList<int>& errors);
125 
128  void setCatalogExtraData( const QStringList& data );
130  void setHeader( const CatalogItem& header );
131 
133  void setCodec( QTextCodec* codec );
134 
136  void startTransaction();
138  void commitTransaction();
139 
140  short _maxLineLength;
141  short _trailingNewLines;
142  int _errorLine;
143 
144 private:
145  CatalogImportPluginPrivate* d;
146 };
147 
148 }
149 
150 #endif
QIODevice
GettextCatalog::BUSY
Definition: catalogfileplugin.h:65
GettextCatalog::CatalogImportPlugin::setCatalogExtraData
void setCatalogExtraData(const QStringList &data)
set extra data for the catalog, which can't be stored in CatalogItem.
Definition: importplugin.cpp:72
GettextCatalog::UNSUPPORTED_TYPE
Definition: catalogfileplugin.h:62
GettextCatalog::CatalogItem
This class represents an entry in a catalog.
Definition: catalogitem.h:55
GettextCatalog::PARSE_ERROR
Definition: catalogfileplugin.h:58
GettextCatalog::CatalogImportPlugin::~CatalogImportPlugin
virtual ~CatalogImportPlugin()
Definition: importplugin.cpp:57
GettextCatalog::STOPPED
Definition: catalogfileplugin.h:64
GettextCatalog::RECOVERED_PARSE_ERROR
Definition: catalogfileplugin.h:59
GettextCatalog::CatalogImportPlugin::load
virtual ConversionStatus load(QIODevice *)=0
Reimplement this method to load the local file passed as an argument.
GettextCatalog::CatalogImportPlugin::CatalogImportPlugin
CatalogImportPlugin()
Definition: importplugin.cpp:51
GettextCatalog::CatalogImportPlugin::commitTransaction
void commitTransaction()
commit the data in the current transaction.
Definition: importplugin.cpp:125
GettextCatalog::RECOVERED_HEADER_ERROR
Header error that could be recovered.
Definition: catalogfileplugin.h:63
GettextCatalog::CatalogImportPlugin::setErrorIndex
void setErrorIndex(const QList< int > &errors)
set the list of parse error indexes
Definition: importplugin.cpp:84
GettextCatalog::CatalogImportPlugin::appendCatalogItem
void appendCatalogItem(const CatalogItem &item, const bool obsolete=false)
Append a new catalog item, either as normal or as an obsolete one.
Definition: importplugin.cpp:62
GettextCatalog::NO_PLUGIN
Definition: catalogfileplugin.h:61
GettextCatalog::ConversionStatus
ConversionStatus
Result of the conversion.
Definition: catalogfileplugin.h:53
QString
QList< int >
QTextCodec
QStringList
GettextCatalog::CatalogImportPlugin::setCodec
void setCodec(QTextCodec *codec)
Set the character encoding used in the catalog file.
Definition: importplugin.cpp:96
GettextCatalog::CatalogImportPlugin
HISTORY: this was a base class for Catalog import plugins in KBabel, but this architecture isn't not ...
Definition: catalogfileplugin.h:85
GettextCatalog::CatalogImportPluginPrivate
Definition: importplugin_private.h:47
GettextCatalog::CatalogImportPlugin::_errorLine
int _errorLine
Definition: catalogfileplugin.h:142
GettextCatalog::CatalogImportPlugin::_maxLineLength
short _maxLineLength
Definition: catalogfileplugin.h:140
GettextCatalog::NOT_IMPLEMENTED
Definition: catalogfileplugin.h:55
GettextCatalog::CatalogImportPlugin::setGeneratedFromDocbook
void setGeneratedFromDocbook(const bool fromDocbook)
set flag that the file is generated from DocBook
Definition: importplugin.cpp:78
GettextCatalog::OS_ERROR
Definition: catalogfileplugin.h:60
GettextCatalog::NO_FILE
Definition: catalogfileplugin.h:56
GettextCatalog::NO_PERMISSIONS
Definition: catalogfileplugin.h:57
GettextCatalog::CatalogImportPlugin::setHeader
void setHeader(const CatalogItem &header)
set the header catalog item
Definition: importplugin.cpp:90
GettextCatalog::CatalogImportPlugin::startTransaction
void startTransaction()
start a new transaction.
Definition: importplugin.cpp:115
GettextCatalog::GettextStorage
Implementation of storage for Gettext PO.
Definition: gettextstorage.h:39
GettextCatalog::NO_ENTRY_ERROR
The loaded catalog has not any entry!
Definition: catalogfileplugin.h:66
GettextCatalog::CatalogImportPlugin::open
ConversionStatus open(QIODevice *, GettextStorage *catalog, int *errorLine)
Load the file and fill the corresponding catalog.
Definition: importplugin.cpp:101
GettextCatalog::CatalogImportPlugin::_trailingNewLines
short _trailingNewLines
Definition: catalogfileplugin.h:141
GettextCatalog::OK
Definition: catalogfileplugin.h:54
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:40:06 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

lokalize

Skip menu "lokalize"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal