MyBooks
iteminterface.h
Go to the documentation of this file.
1 /***************************************************************************
2  * This file is part of the CuteReport project *
3  * Copyright (C) 2012-2017 by Alexander Mikhalov *
4  * alexander.mikhalov@gmail.com *
5  * *
6  ** GNU General Public License Usage **
7  * *
8  * This library is free software: you can redistribute it and/or modify *
9  * it under the terms of the GNU General Public License as published by *
10  * the Free Software Foundation, either version 3 of the License, or *
11  * (at your option) any later version. *
12  * You should have received a copy of the GNU General Public License *
13  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
14  * *
15  ** GNU Lesser General Public License **
16  * *
17  * This library is free software: you can redistribute it and/or modify *
18  * it under the terms of the GNU Lesser General Public License as *
19  * published by the Free Software Foundation, either version 3 of the *
20  * License, or (at your option) any later version. *
21  * You should have received a copy of the GNU Lesser General Public *
22  * License along with this library. *
23  * If not, see <http://www.gnu.org/licenses/>. *
24  * *
25  * This library is distributed in the hope that it will be useful, *
26  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
27  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
28  * GNU General Public License for more details. *
29  ****************************************************************************/
30 #ifndef ITEMINTERFACE_H
31 #define ITEMINTERFACE_H
32 
33 #include <QObject>
34 #include "baseiteminterface.h"
35 #include "cutereport_globals.h"
36 
37 namespace CuteReport
38 {
39 
40 class ItemInterfacePrivate;
41 
42 class CUTEREPORT_EXPORTS ItemInterface : public BaseItemInterface
43 {
44  Q_OBJECT
45 
46  Q_INTERFACES(CuteReport::BaseItemInterface)
47  Q_ENUMS(ShiftMode)
48 
49  Q_PROPERTY(QString shiftMode READ shiftModeStr WRITE setShiftModeStr NOTIFY shiftModeChanged)
50 
51  Q_PROPERTY(ShiftMode shiftMode READ shiftMode WRITE setShiftMode NOTIFY shiftModeChanged DESIGNABLE false)
52  Q_PROPERTY(QStringList _shiftMode_variants READ _shiftMode_variants DESIGNABLE false STORED false)
53 
54 public:
55  enum ShiftMode { AlwaysShift, DontShift, ShiftWhenOverlapped };
56 
57  explicit ItemInterface(QObject * parent);
58  virtual ~ItemInterface();
59 
60  virtual QByteArray serialize() const;
61  virtual void deserialize(QByteArray &data);
62 
63  virtual ShiftMode shiftMode() const;
64  virtual void setShiftMode(ItemInterface::ShiftMode shiftMode);
65  virtual QString shiftModeStr() const;
66  virtual void setShiftModeStr(const QString & shiftMode);
67 
68  virtual QString _current_property_description() const;
69  virtual QStringList _shiftMode_variants() const;
70 
71  static ShiftMode shiftModeFromString(const QString & mode);
72  static QString shiftModeToString(ShiftMode mode);
73 
74  virtual StdEditorPropertyList stdEditorList() const;
75 
76 signals:
77  void shiftModeChanged(ShiftMode shiftMode);
78  void shiftModeChanged(QString shiftMode);
79 
80 protected:
81  ItemInterface(ItemInterfacePrivate *dd, QObject * parent);
82 
83 private:
84  Q_DECLARE_PRIVATE(ItemInterface)
85 };
86 
87 } // namespace
88 
89 Q_DECLARE_INTERFACE(CuteReport::ItemInterface, "CuteReport.ItemInterface/1.0")
90 Q_DECLARE_METATYPE(CuteReport::ItemInterface::ShiftMode)
91 
92 #endif // ITEMINTERFACE_H
ShiftMode
Definition: iteminterface.h:55
Definition: abstractpainterdelegate.h:42
QList< StdEditorProperty > StdEditorPropertyList
Definition: cutereport_types.h:262
#define CUTEREPORT_EXPORTS
Definition: cutereport_globals.h:47
Definition: baseiteminterface.h:107
Definition: iteminterface.h:42