Scribus
Open source desktop publishing at your fingertips
guidesmodel.h
1 /*
2 For general Scribus (>=1.3.2) copyright and licensing information please refer
3 to the COPYING file provided with the program. Following this notice may exist
4 a copyright and/or license notice that predates the release of Scribus 1.3.2
5 for which a new license (GPL+exception) is in place.
6 */
7 #ifndef GUIDESMODEL_H
8 #define GUIDESMODEL_H
9 
10 #include <QAbstractTableModel>
11 #include "scribusstructs.h"
12 
13 
22 class GuidesModel : public QAbstractTableModel
23 {
24  Q_OBJECT
25 
26  public:
27  GuidesModel(QObject * parent = 0);
28  ~GuidesModel();
29 
30  int rowCount(const QModelIndex & parent = QModelIndex()) const;
31  int columnCount(const QModelIndex & parent = QModelIndex()) const;
32 
33  QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
34  bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole);
35 
36  Qt::ItemFlags flags(const QModelIndex & index) const;
37 
38  QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
39 
40  void removeValues(const Guides & v);
41  // qt4 api is "wrokarounded" with insertRow() and removeValues()
42  // these removeRows() and insertRows() does not handle margin items correctly
43 // bool removeRows(int row, int count, const QModelIndex & parent = QModelIndex());
44 // bool insertRows( int row, int count, const QModelIndex & parent = QModelIndex());
45  void insertRow();
46 
48  void setValues(Guides values);
50  Guides values();
51 
52  void unitChange(int docUnitIndex, int docUnitDecimals, double offset);
53 #if 0
54  void printValues();
56 #endif
57 
58  signals:
61  void valueChanged();
62 
63  private:
64  Guides m_values;
65  int m_docUnitIndex;
66  int m_docUnitDecimals;
67  double rule;
68 };
69 
70 #endif
Guides values()
Get values back to the app.
Definition: guidesmodel.cpp:139
void setValues(Guides values)
Set new values into the model.
Definition: guidesmodel.cpp:131
void valueChanged()
Signal emmitted when the user finish the editation of one value.
A model for guides lists. It holds guides as a double QList (it will be expanded later because of RFE...
Definition: guidesmodel.h:22