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

kig

  • sources
  • kde-4.12
  • kdeedu
  • kig
  • modes
typesdialog.h
Go to the documentation of this file.
1 /*
2  This file is part of Kig, a KDE program for Interactive Geometry...
3  Copyright (C) 2002 Dominique Devriese <devriese@kde.org>
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
18  USA
19 */
20 
21 #ifndef KIG_MODES_TYPESDIALOG_H
22 #define KIG_MODES_TYPESDIALOG_H
23 
24 #include <qabstractitemmodel.h>
25 
26 #include <kdialog.h>
27 
28 #include "../misc/lists.h"
29 
30 #include <vector>
31 
32 class QMenu;
33 class KigPart;
34 class Ui_TypesWidget;
35 class BaseListElement;
36 
40 class TypesModel
41  : public QAbstractTableModel
42 {
43  Q_OBJECT
44 
45  std::vector<BaseListElement*> melems;
46 
47 public:
48  TypesModel( QObject* parent = 0 );
49  virtual ~TypesModel();
50 
51  void addMacros( const std::vector<Macro*>& macros );
52  void removeElements( const QModelIndexList& elems );
53 
54  void clear();
55 
56  void elementChanged( const QModelIndex& index );
57 
58  bool isMacro( const QModelIndex& index ) const;
59  Macro* macroFromIndex( const QModelIndex& index ) const;
60 
61  // reimplementations from QAbstractTableModel
62  virtual int columnCount( const QModelIndex& parent = QModelIndex() ) const;
63  virtual QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const;
64  virtual QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
65  virtual QModelIndex index( int row, int column, const QModelIndex& parent = QModelIndex() ) const;
66  virtual int rowCount( const QModelIndex& parent = QModelIndex() ) const;
67 };
68 
72 class TypesDialog : public KDialog
73 {
74  Q_OBJECT
75 
76  // necessary because some MacroList functions need it..
77  KigPart& mpart;
78  QMenu* popup;
79  Ui_TypesWidget* mtypeswidget;
80  TypesModel* mmodel;
81 public:
82  TypesDialog( QWidget* parent, KigPart& );
83  ~TypesDialog();
84 
85 private slots:
86  void slotHelp();
87  void slotOk();
88  void slotCancel();
89 
90  void deleteType();
91  void exportType();
92  void importTypes();
93  void editType();
94 
95  void typeListContextMenu( const QPoint& );
96 
97 private:
98  QModelIndexList selectedRows() const;
99 };
100 
101 #endif
TypesModel
A model for representing the data.
Definition: typesdialog.h:40
TypesModel::index
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Definition: typesdialog.cpp:321
TypesModel::headerData
virtual QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Definition: typesdialog.cpp:300
QWidget
TypesModel::data
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Definition: typesdialog.cpp:244
KDialog
TypesModel::columnCount
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const
Definition: typesdialog.cpp:239
TypesModel::rowCount
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition: typesdialog.cpp:329
TypesDialog::~TypesDialog
~TypesDialog()
Definition: typesdialog.cpp:388
TypesModel::macroFromIndex
Macro * macroFromIndex(const QModelIndex &index) const
Definition: typesdialog.cpp:227
TypesDialog::TypesDialog
TypesDialog(QWidget *parent, KigPart &)
Definition: typesdialog.cpp:335
TypesModel::removeElements
void removeElements(const QModelIndexList &elems)
Definition: typesdialog.cpp:159
TypesModel::elementChanged
void elementChanged(const QModelIndex &index)
Definition: typesdialog.cpp:208
TypesModel::~TypesModel
virtual ~TypesModel()
Definition: typesdialog.cpp:139
TypesModel::addMacros
void addMacros(const std::vector< Macro * > &macros)
Definition: typesdialog.cpp:143
TypesModel::clear
void clear()
Definition: typesdialog.cpp:200
Macro
this is just a simple data struct.
Definition: lists.h:91
TypesDialog
Manage the macro types...
Definition: typesdialog.h:72
KigPart
This is a "Part".
Definition: kig_part.h:68
TypesModel::isMacro
bool isMacro(const QModelIndex &index) const
Definition: typesdialog.cpp:219
TypesModel::TypesModel
TypesModel(QObject *parent=0)
Definition: typesdialog.cpp:134
QAbstractTableModel
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:35:40 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kig

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

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

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