summaryrefslogtreecommitdiff
path: root/src/widgetinfo.h
blob: b5f46fe1a08a2063d93d352f9e9cd450cc93d858 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef WIDGETINFO_H
#define WIDGETINFO_H

#include <QtCore/QMetaType>
#include <QtCore/QSharedData>
#include <QtCore/QUrl>

class WidgetInfoData;

class WidgetInfo
{
	Q_GADGET
	Q_ENUMS(WidgetSize WidgetPosition)

public:
	WidgetInfo();
	WidgetInfo(const WidgetInfo &other);
	~WidgetInfo();

	WidgetInfo& operator=(const WidgetInfo &other);

	enum WidgetSize
	{
		Size1Q = 0,
		Size2QHorizontal = 1,
		Size2QVertical = 2,
		Size4Q = 3
	};

	enum WidgetPosition
	{
		PosNW = 0,
		PosNE = 1,
		PosSW = 2,
		PosSE = 3
	};

	bool valid() const;

	int builtinClockfaceId() const;

	QUrl url() const;
	void setUrl(const QUrl &url);

	QString description() const;
	void setDescription(const QString &desc);

	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);

private:
	QSharedDataPointer<WidgetInfoData> d;
};

Q_DECLARE_METATYPE(WidgetInfo::WidgetSize)
Q_DECLARE_METATYPE(WidgetInfo::WidgetPosition)

#endif // WIDGETINFO_H