• 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
  • common
languagelistmodel.h
Go to the documentation of this file.
1 /* ****************************************************************************
2  This file is part of Lokalize
3 
4  Copyright (C) 2009 by Nick Shaforostoff <shafff@ukr.net>
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License as
8  published by the Free Software Foundation; either version 2 of
9  the License or (at your option) version 3 or any later version
10  accepted by the membership of KDE e.V. (or its successor approved
11  by the membership of KDE e.V.), which shall act as a proxy
12  defined in Section 14 of version 3 of the license.
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, see <http://www.gnu.org/licenses/>.
21 
22 **************************************************************************** */
23 
24 
25 #ifndef LANGUAGELISTMODEL_H
26 #define LANGUAGELISTMODEL_H
27 
28 #include <QStringListModel>
29 class QSortFilterProxyModel;
30 
31 
32 class LanguageListModel: public QStringListModel
33 {
34  enum ModelType
35  {
36  Default,
37  EmptyLang
38  };
39 public:
40  static LanguageListModel* instance();
41  static LanguageListModel* emptyLangInstance();
42 
43 private:
44  static LanguageListModel * _instance;
45  static LanguageListModel * _emptyLangInstance;
46  static void cleanupLanguageListModel();
47 
48  LanguageListModel(ModelType type=Default, QObject* parent=0);
49  QSortFilterProxyModel* m_sortModel;
50 
51 public:
52  QVariant data(const QModelIndex& index, int role) const;
53  QFlags< Qt::ItemFlag > flags(const QModelIndex& index) const;
54 
55  QSortFilterProxyModel* sortModel() const{return m_sortModel;};
56  int sortModelRowForLangCode(const QString&);
57  QString langCodeForSortModelRow(int);
58 };
59 
60 #endif // LANGUAGELISTMODEL_H
LanguageListModel::instance
static LanguageListModel * instance()
Definition: languagelistmodel.cpp:46
LanguageListModel::sortModel
QSortFilterProxyModel * sortModel() const
Definition: languagelistmodel.h:55
QModelIndex
LanguageListModel::langCodeForSortModelRow
QString langCodeForSortModelRow(int)
Definition: languagelistmodel.cpp:124
LanguageListModel::data
QVariant data(const QModelIndex &index, int role) const
Definition: languagelistmodel.cpp:76
LanguageListModel
Definition: languagelistmodel.h:32
QFlags
QObject
QAbstractListModel::index
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const
QString
QStringListModel
LanguageListModel::sortModelRowForLangCode
int sortModelRowForLangCode(const QString &)
Definition: languagelistmodel.cpp:119
QSortFilterProxyModel
LanguageListModel::flags
QFlags< Qt::ItemFlag > flags(const QModelIndex &index) const
Definition: languagelistmodel.cpp:114
LanguageListModel::emptyLangInstance
static LanguageListModel * emptyLangInstance()
Definition: languagelistmodel.cpp:56
QObject::parent
QObject * parent() const
QVariant
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