summaryrefslogtreecommitdiff
path: root/src/widgetinfo.h
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2014-09-04 01:55:14 +0200
committerJavier <dev.git@javispedro.com>2014-09-04 01:55:14 +0200
commit1adf7f1bcde493ccaacedb0d9778911ad69ff335 (patch)
tree2a1c4cffb09a4406a59df25853a726a7aa86fb28 /src/widgetinfo.h
downloadsalmeta-1adf7f1bcde493ccaacedb0d9778911ad69ff335.tar.gz
salmeta-1adf7f1bcde493ccaacedb0d9778911ad69ff335.zip
Initial import
Diffstat (limited to 'src/widgetinfo.h')
-rw-r--r--src/widgetinfo.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/src/widgetinfo.h b/src/widgetinfo.h
new file mode 100644
index 0000000..06a6149
--- /dev/null
+++ b/src/widgetinfo.h
@@ -0,0 +1,72 @@
+#ifndef WIDGETINFO_H
+#define WIDGETINFO_H
+
+#include <QtCore/QObject>
+#include <QtCore/QUrl>
+
+class WidgetInfo : public QObject
+{
+ Q_OBJECT
+ Q_ENUMS(WidgetSize WidgetPosition)
+
+ Q_PROPERTY(bool valid READ valid NOTIFY validChanged)
+ Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged)
+ Q_PROPERTY(bool invert READ invert WRITE setInvert NOTIFY invertChanged)
+ Q_PROPERTY(int page READ page WRITE setPage NOTIFY pageChanged)
+ Q_PROPERTY(WidgetSize size READ size WRITE setSize NOTIFY sizeChanged)
+ Q_PROPERTY(WidgetPosition position READ position WRITE setPosition NOTIFY positionChanged)
+
+public:
+ explicit WidgetInfo(QObject *parent = 0);
+
+ enum WidgetSize
+ {
+ Size1Q = 0,
+ Size2QHorizontal = 1,
+ Size2QVertical = 2,
+ Size4Q = 3
+ };
+
+ enum WidgetPosition
+ {
+ PosNW = 0,
+ PosNE = 1,
+ PosSW = 2,
+ PosSE = 3
+ };
+
+ bool valid() const;
+
+ QUrl url() const;
+ void setUrl(const QUrl &url);
+
+ bool invert() const;
+ void setInvert(bool invert);
+
+ int page() const;
+ void setPage(int page);
+
+ WidgetSize size() const;
+ void setSize(const WidgetSize &size);
+
+ WidgetPosition position() const;
+ void setPosition(const WidgetPosition &pos);
+
+signals:
+ void validChanged();
+ void urlChanged();
+ void invertChanged();
+ void pageChanged();
+ void sizeChanged();
+ void positionChanged();
+
+private:
+ QUrl _url;
+ bool _invert;
+ short _page;
+ WidgetSize _size;
+ WidgetPosition _pos;
+
+};
+
+#endif // WIDGETINFO_H