• 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
catalogitem.h
Go to the documentation of this file.
1 /* ****************************************************************************
2  This file is part of Lokalize
3  This file is based on the one from KBabel
4 
5  Copyright (C) 1999-2000 by Matthias Kiefer <matthias.kiefer@gmx.de>
6  Copyright (C) 2002-2003 by Stanislav Visnovsky <visnovsky@kde.org>
7  Copyright (C) 2006 by Nicolas GOUTTE <goutte@kde.org>
8  Copyright (C) 2007-2011 by Nick Shaforostoff <shafff@ukr.net>
9 
10  This program is free software; you can redistribute it and/or modify
11  it under the terms of the GNU General Public License as published by
12  the Free Software Foundation; either version 2 of the License, or
13  (at your option) any later version.
14 
15  This program is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with this program; if not, write to the Free Software
22  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 
24  In addition, as a special exception, the copyright holders give
25  permission to link the code of this program with any edition of
26  the Qt library by Trolltech AS, Norway (or with modified versions
27  of Qt that use the same license as Qt), and distribute linked
28  combinations including the two. You must obey the GNU General
29  Public License in all respects for all of the code used other than
30  Qt. If you modify this file, you may extend this exception to
31  your version of the file, but you are not obligated to do so. If
32  you do not wish to do so, delete this exception statement from
33  your version.
34 
35 **************************************************************************** */
36 #ifndef CATALOGITEM_H
37 #define CATALOGITEM_H
38 
39 #include <QStringList>
40 
41 namespace GettextCatalog {
42 
43 class CatalogItemPrivate;
44 
55 class CatalogItem
56 {
57 
58 public:
59  explicit CatalogItem();
60  CatalogItem(const CatalogItem&);
61  ~CatalogItem();
62 
63  bool isFuzzy() const; //", fuzzy" in comment
64  bool isCformat() const; //", c-format" or possible-c-format in comment (from the debug parameter of xgettext)
65  bool isNoCformat() const; //", no-c-format" in comment
66  bool isQtformat() const; //", qt-format" in comment
67  bool isNoQtformat() const; //", no-qt-format" in comment
68  bool isUntranslated() const;
69  bool isUntranslated(uint form) const;
70 
71 
72  bool isPlural() const;
73  void setPlural(bool plural=true);
74 
75  void setSyntaxError(bool);
76 
78  int totalLines() const;
79 
81  void clear();
82 
83  QString comment() const;
84  const QString& msgctxt(const bool noNewlines = false) const;
85  const QString& msgid(const int form=0) const;
86  const QString& msgstr(const int form=0) const;
87  const QVector<QString>& msgstrPlural() const;
88  enum Part {Source, Target};
89  QStringList allPluralForms(CatalogItem::Part, bool stripNewLines=false) const;
90  bool prependEmptyForMsgid(const int form=0) const;
91  bool prependEmptyForMsgstr(const int form=0) const;
92  bool keepEmptyMsgCtxt() const;
93 
94  QStringList msgstrAsList() const;
95  void setComment(const QString& com);
96  void setMsgctxt(const QString& msg);
97  void setMsgid(const QString& msg, const int form=0);
98  void setMsgid(const QStringList& msg);
99  void setMsgid(const QStringList& msg, bool prependEmptyLine);
100  void setMsgid(const QVector<QString>& msg);
101  void setMsgstr(const QString& msg, const int form=0);
102  void setMsgstr(const QStringList& msg);
103  void setMsgstr(const QStringList& msg, bool prependEmptyLine);
104  void setMsgstr(const QVector<QString>& msg);
105 
106  void setValid(bool);
107  bool isValid() const;
108 #if 0
109 
112  QStringList errors() const;
113 
114  QString nextError() const;
115  void clearErrors();
116  void removeError(const QString& error);
117  void appendError(const QString& error);
118 
131  int checkErrors(QChar accelMarker, const QRegExp& contextInfo
132  , const QRegExp& singularPlural, const int neededLines);
133 
134 #endif
135  void operator=(const CatalogItem& rhs);
136 
137 private:
138  CatalogItemPrivate* const d;
139 
140  friend class GettextStorage;
141  void setFuzzy();
142  void unsetFuzzy();
143 
144 };
145 
146 }
147 
148 #endif // CATALOGITEM_H
GettextCatalog::CatalogItem::isValid
bool isValid() const
Definition: catalogitem.cpp:112
GettextCatalog::CatalogItem::msgstrAsList
QStringList msgstrAsList() const
Definition: catalogitem.cpp:313
GettextCatalog::CatalogItem::isQtformat
bool isQtformat() const
GettextCatalog::CatalogItem::clear
void clear()
cleares the item
Definition: catalogitem.cpp:302
GettextCatalog::CatalogItem::setMsgid
void setMsgid(const QString &msg, const int form=0)
Definition: catalogitem.cpp:134
GettextCatalog::CatalogItem::setSyntaxError
void setSyntaxError(bool)
GettextCatalog::CatalogItem::msgid
const QString & msgid(const int form=0) const
Definition: catalogitem.cpp:73
QChar
GettextCatalog::CatalogItem::operator=
void operator=(const CatalogItem &rhs)
Definition: catalogitem.cpp:307
GettextCatalog::CatalogItem
This class represents an entry in a catalog.
Definition: catalogitem.h:55
GettextCatalog::CatalogItem::isFuzzy
bool isFuzzy() const
Definition: catalogitem.cpp:207
GettextCatalog::CatalogItem::prependEmptyForMsgid
bool prependEmptyForMsgid(const int form=0) const
Definition: catalogitem.cpp:86
GettextCatalog::CatalogItem::CatalogItem
CatalogItem()
Definition: catalogitem.cpp:44
GettextCatalog::CatalogItem::keepEmptyMsgCtxt
bool keepEmptyMsgCtxt() const
Definition: catalogitem.cpp:129
GettextCatalog::CatalogItem::totalLines
int totalLines() const
returns the number of lines, the entry will need in a file
QRegExp
GettextCatalog::CatalogItem::setPlural
void setPlural(bool plural=true)
Definition: catalogitem.cpp:197
GettextCatalog::CatalogItem::Source
Definition: catalogitem.h:88
GettextCatalog::CatalogItem::prependEmptyForMsgstr
bool prependEmptyForMsgstr(const int form=0) const
Definition: catalogitem.cpp:91
GettextCatalog::CatalogItem::setMsgctxt
void setMsgctxt(const QString &msg)
Definition: catalogitem.cpp:122
GettextCatalog::CatalogItem::isNoQtformat
bool isNoQtformat() const
QString
QStringList
GettextCatalog::CatalogItem::isUntranslated
bool isUntranslated() const
Definition: catalogitem.cpp:212
GettextCatalog::CatalogItem::comment
QString comment() const
Definition: catalogitem.cpp:62
GettextCatalog::CatalogItem::msgstrPlural
const QVector< QString > & msgstrPlural() const
Definition: catalogitem.cpp:96
GettextCatalog::CatalogItem::allPluralForms
QStringList allPluralForms(CatalogItem::Part, bool stripNewLines=false) const
Definition: catalogitem.cpp:101
GettextCatalog::CatalogItem::~CatalogItem
~CatalogItem()
Definition: catalogitem.cpp:55
QVector< QString >
GettextCatalog::CatalogItem::setComment
void setComment(const QString &com)
Definition: catalogitem.cpp:187
GettextCatalog::CatalogItem::msgstr
const QString & msgstr(const int form=0) const
Definition: catalogitem.cpp:78
GettextCatalog::CatalogItem::setValid
void setValid(bool)
Definition: catalogitem.cpp:117
GettextCatalog::CatalogItem::msgctxt
const QString & msgctxt(const bool noNewlines=false) const
Definition: catalogitem.cpp:67
GettextCatalog::CatalogItem::setMsgstr
void setMsgstr(const QString &msg, const int form=0)
Definition: catalogitem.cpp:163
GettextCatalog::CatalogItem::isCformat
bool isCformat() const
GettextCatalog::CatalogItem::Part
Part
Definition: catalogitem.h:88
GettextCatalog::CatalogItem::isPlural
bool isPlural() const
Definition: catalogitem.cpp:202
GettextCatalog::GettextStorage
Implementation of storage for Gettext PO.
Definition: gettextstorage.h:39
GettextCatalog::CatalogItemPrivate
This class represents data for an entry in a catalog.
Definition: catalogitem_private.h:57
GettextCatalog::CatalogItem::isNoCformat
bool isNoCformat() const
GettextCatalog::CatalogItem::Target
Definition: catalogitem.h:88
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