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

lokalize

  • GettextCatalog
  • CatalogImportPlugin
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
GettextCatalog::CatalogImportPlugin Class Referenceabstract

#include <catalogfileplugin.h>

Inheritance diagram for GettextCatalog::CatalogImportPlugin:
Inheritance graph
[legend]

Public Member Functions

 CatalogImportPlugin ()
 
virtual ~CatalogImportPlugin ()
 
virtual ConversionStatus load (QIODevice *)=0
 
ConversionStatus open (QIODevice *, GettextStorage *catalog, int *errorLine)
 

Protected Member Functions

void appendCatalogItem (const CatalogItem &item, const bool obsolete=false)
 
void commitTransaction ()
 
void setCatalogExtraData (const QStringList &data)
 
void setCodec (QTextCodec *codec)
 
void setErrorIndex (const QList< int > &errors)
 
void setGeneratedFromDocbook (const bool fromDocbook)
 
void setHeader (const CatalogItem &header)
 
void startTransaction ()
 

Protected Attributes

int _errorLine
 
short _maxLineLength
 
short _trailingNewLines
 

Detailed Description

HISTORY: this was a base class for Catalog import plugins in KBabel, but this architecture isn't not suitable for XML-based files (when whole DOM-tree is stored in memory to prevent file clashes)

This class is the base for import plugins for catalogs. It provides "transactional behavior", so the changes are stored in catalog only if the import process finishes successfully.

To use it, just subclass and redefine load() and id() methods. When importing, you can use the protected methods for setting the catalog. New catalog items can be added using appendCatalogItem.

Base class for GettextCatalog import plugins

Author
Stanislav Visnovsky visno.nosp@m.vsky.nosp@m.@kde..nosp@m.org

Definition at line 85 of file catalogfileplugin.h.

Constructor & Destructor Documentation

GettextCatalog::CatalogImportPlugin::CatalogImportPlugin ( )

Definition at line 51 of file importplugin.cpp.

GettextCatalog::CatalogImportPlugin::~CatalogImportPlugin ( )
virtual

Definition at line 57 of file importplugin.cpp.

Member Function Documentation

void GettextCatalog::CatalogImportPlugin::appendCatalogItem ( const CatalogItem &  item,
const bool  obsolete = false 
)
protected

Append a new catalog item, either as normal or as an obsolete one.

Parameters
itemthe new item
obsoleteflag that the item is obsolete

Definition at line 62 of file importplugin.cpp.

void GettextCatalog::CatalogImportPlugin::commitTransaction ( )
protected

commit the data in the current transaction.

You should never call this method.

Definition at line 125 of file importplugin.cpp.

virtual ConversionStatus GettextCatalog::CatalogImportPlugin::load ( QIODevice *  )
pure virtual

Reimplement this method to load the local file passed as an argument.

Throughout the run, you can use the protected methods for setting the contents of the resulting catalog. This method must call

See also
setMimeTypes to setup correct MIME types for the loaded file. Also, it should use
isStopped to abort loading and the signals for providing user feedback.
Parameters
filefile to be loaded
mimetypethe expected MIME type (the type used for plugin selection

Implemented in GettextCatalog::GettextImportPlugin.

ConversionStatus GettextCatalog::CatalogImportPlugin::open ( QIODevice *  device,
GettextStorage *  catalog,
int *  errorLine 
)

Load the file and fill the corresponding catalog.

The file is considered to be of mimetype MIME type.

Parameters
filelocal file name to be opened
mimetypethe MIME type is should be handled as
catalogthe catalog to be filled
Returns
result of the operation

Definition at line 101 of file importplugin.cpp.

void GettextCatalog::CatalogImportPlugin::setCatalogExtraData ( const QStringList &  data)
protected

set extra data for the catalog, which can't be stored in CatalogItem.

The format can be arbitrary

Definition at line 72 of file importplugin.cpp.

void GettextCatalog::CatalogImportPlugin::setCodec ( QTextCodec *  codec)
protected

Set the character encoding used in the catalog file.

Definition at line 96 of file importplugin.cpp.

void GettextCatalog::CatalogImportPlugin::setErrorIndex ( const QList< int > &  errors)
protected

set the list of parse error indexes

Definition at line 84 of file importplugin.cpp.

void GettextCatalog::CatalogImportPlugin::setGeneratedFromDocbook ( const bool  fromDocbook)
protected

set flag that the file is generated from DocBook

Definition at line 78 of file importplugin.cpp.

void GettextCatalog::CatalogImportPlugin::setHeader ( const CatalogItem &  header)
protected

set the header catalog item

Definition at line 90 of file importplugin.cpp.

void GettextCatalog::CatalogImportPlugin::startTransaction ( )
protected

start a new transaction.

You should never call this method.

Definition at line 115 of file importplugin.cpp.

Member Data Documentation

int GettextCatalog::CatalogImportPlugin::_errorLine
protected

Definition at line 142 of file catalogfileplugin.h.

short GettextCatalog::CatalogImportPlugin::_maxLineLength
protected

Definition at line 140 of file catalogfileplugin.h.

short GettextCatalog::CatalogImportPlugin::_trailingNewLines
protected

Definition at line 141 of file catalogfileplugin.h.


The documentation for this class was generated from the following files:
  • catalogfileplugin.h
  • importplugin.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:40:07 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