• 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
  • project
projectwidget.h
Go to the documentation of this file.
1 /* ****************************************************************************
2  This file is part of Lokalize
3 
4  Copyright (C) 2007-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 #ifndef PROJECTWIDGET_H
25 #define PROJECTWIDGET_H
26 
27 #include <kurl.h>
28 
29 #include <QTreeView>
30 
31 #include "projectmodel.h"
32 
33 class SortFilterProxyModel;
34 class QSortFilterProxyModel;
35 
41 class ProjectWidget: public QTreeView
42 {
43  Q_OBJECT
44 public:
45  ProjectWidget(QWidget* parent);
46  ~ProjectWidget();
47 
48  void setCurrentItem(const KUrl&);
49  KUrl currentItem() const;
50  KUrl::List selectedItems() const;
51  bool currentIsTranslationFile() const;
52 
53  QSortFilterProxyModel* proxyModel();
54  void expandItems(const QModelIndex& parent=QModelIndex());
55 
56  void gotoPrevFuzzyUntr();
57  void gotoNextFuzzyUntr();
58  void gotoPrevFuzzy();
59  void gotoNextFuzzy();
60  void gotoPrevUntranslated();
61  void gotoNextUntranslated();
62  void gotoPrevTemplateOnly();
63  void gotoNextTemplateOnly();
64  void gotoPrevTransOnly();
65  void gotoNextTransOnly();
66 
67 signals:
68  void fileOpenRequested(const KUrl&);
69  void newWindowOpenRequested(const KUrl&);
70 
71 private slots:
72  void slotItemActivated(const QModelIndex&);
73 
74 private:
75  enum gotoIndexResult {gotoIndex_end = -1, gotoIndex_notfound = 0, gotoIndex_found = 1};
76 
77  bool gotoIndexCheck(const QModelIndex& currentIndex, ProjectModel::AdditionalRoles role);
78  QModelIndex gotoIndexPrevNext(const QModelIndex& currentIndex, int direction) const;
79  gotoIndexResult gotoIndexFind(const QModelIndex& currentIndex, ProjectModel::AdditionalRoles role, int direction);
80  gotoIndexResult gotoIndex(const QModelIndex& currentIndex, ProjectModel::AdditionalRoles role, int direction);
81 
82  QWidget* m_parent;
83  SortFilterProxyModel* m_proxyModel;
84 };
85 
86 
87 
88 #endif
QModelIndex
QWidget
ProjectWidget::gotoNextFuzzyUntr
void gotoNextFuzzyUntr()
Definition: projectwidget.cpp:474
ProjectWidget::setCurrentItem
void setCurrentItem(const KUrl &)
Definition: projectwidget.cpp:316
ProjectModel::AdditionalRoles
AdditionalRoles
Definition: projectmodel.h:134
ProjectWidget::currentIsTranslationFile
bool currentIsTranslationFile() const
Definition: projectwidget.cpp:334
ProjectWidget::selectedItems
KUrl::List selectedItems() const
Definition: projectwidget.cpp:375
ProjectWidget::expandItems
void expandItems(const QModelIndex &parent=QModelIndex())
Definition: projectwidget.cpp:387
ProjectWidget::currentItem
KUrl currentItem() const
Definition: projectwidget.cpp:325
ProjectWidget::gotoPrevTransOnly
void gotoPrevTransOnly()
Definition: projectwidget.cpp:481
ProjectWidget::gotoNextFuzzy
void gotoNextFuzzy()
Definition: projectwidget.cpp:476
ProjectWidget::gotoPrevTemplateOnly
void gotoPrevTemplateOnly()
Definition: projectwidget.cpp:479
ProjectWidget::~ProjectWidget
~ProjectWidget()
Definition: projectwidget.cpp:308
ProjectWidget::gotoPrevUntranslated
void gotoPrevUntranslated()
Definition: projectwidget.cpp:477
ProjectWidget::newWindowOpenRequested
void newWindowOpenRequested(const KUrl &)
ProjectWidget::gotoNextTemplateOnly
void gotoNextTemplateOnly()
Definition: projectwidget.cpp:480
ProjectWidget::proxyModel
QSortFilterProxyModel * proxyModel()
Definition: projectwidget.cpp:484
ProjectWidget::gotoPrevFuzzy
void gotoPrevFuzzy()
Definition: projectwidget.cpp:475
QSortFilterProxyModel
projectmodel.h
ProjectWidget::gotoNextUntranslated
void gotoNextUntranslated()
Definition: projectwidget.cpp:478
ProjectWidget::ProjectWidget
ProjectWidget(QWidget *parent)
Definition: projectwidget.cpp:273
QTreeView
ProjectWidget
This class is considered a 'view', and ProjectWindow + ProjectView are its controllers the data is pr...
Definition: projectwidget.h:41
ProjectWidget::fileOpenRequested
void fileOpenRequested(const KUrl &)
ProjectWidget::gotoNextTransOnly
void gotoNextTransOnly()
Definition: projectwidget.cpp:482
QAbstractItemView::currentIndex
QModelIndex currentIndex() const
QObject::parent
QObject * parent() const
ProjectWidget::gotoPrevFuzzyUntr
void gotoPrevFuzzyUntr()
Definition: projectwidget.cpp:473
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