2
* Copyright 2015 Canonical Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License as published by
6
* the Free Software Foundation; version 3.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
#ifndef UCPAGETREENODE_H
17
#define UCPAGETREENODE_H
19
#include "ucstyleditembase.h"
21
class UCPageTreeNodePrivate;
22
class UCPageTreeNode : public UCStyledItemBase
25
Q_PROPERTY(bool isLeaf READ isLeaf WRITE setIsLeaf NOTIFY isLeafChanged)
26
Q_PROPERTY(QQuickItem* toolbar READ toolbar WRITE setToolbar NOTIFY toolbarChanged)
27
Q_PROPERTY(QQuickItem* activeLeafNode READ activeLeafNode NOTIFY activeLeafNodeChanged)
28
Q_PROPERTY(bool active READ active WRITE setActive NOTIFY activeChanged)
29
Q_PROPERTY(UCPageTreeNode* parentNode READ parentNode WRITE setParentNode NOTIFY parentNodeChanged)
30
Q_PROPERTY(QQuickItem* pageStack READ pageStack WRITE setPageStack NOTIFY pageStackChanged)
32
Q_PROPERTY(bool __isPageTreeNode READ isPageTreeNode NOTIFY isPageTreeNodeChanged)
33
Q_PROPERTY(QObject* __propagated READ propagated WRITE setPropagated NOTIFY propagatedChanged)
35
UCPageTreeNode(QQuickItem *parent = 0);
37
void setIsLeaf(bool isLeaf);
40
void setParentNode(UCPageTreeNode *parentNode);
41
UCPageTreeNode *parentNode() const;
43
void setActive(bool active);
46
void setPageStack(QQuickItem *pageStack);
47
QQuickItem *pageStack() const;
49
QQuickItem *activeLeafNode() const;
51
QObject *propagated() const;
52
void setPropagated(QObject *propagated);
53
void resetPropagated();
55
QQuickItem *toolbar() const;
56
void setToolbar(QQuickItem *toolbar);
58
bool isPageTreeNode() const;
60
// QQmlParserStatus interface
61
virtual void componentComplete() override;
63
Q_INVOKABLE void dumpNodeTree ();
66
void isLeafChanged(bool isLeaf);
67
void activeChanged(bool active);
68
void parentNodeChanged(UCPageTreeNode *parentNode);
69
void pageStackChanged(QQuickItem* pageStack);
70
void activeLeafNodeChanged(QQuickItem* activeLeafNode);
71
void propagatedChanged(QObject* propagated);
72
void toolbarChanged(QQuickItem* toolbar);
73
void isPageTreeNodeChanged(bool isPageTreeNode);
76
UCPageTreeNode(UCPageTreeNodePrivate &, QQuickItem *parent);
78
void setActiveLeafNode(QQuickItem* activeLeafNode);
80
// QQuickItem interface
81
virtual void itemChange(ItemChange change, const ItemChangeData &value) override;
84
Q_DECLARE_PRIVATE(UCPageTreeNode)
85
Q_PRIVATE_SLOT(d_func(), void _q_activeBinding(bool active))
86
Q_PRIVATE_SLOT(d_func(), void _q_pageStackBinding (QQuickItem *pageStack))
87
Q_PRIVATE_SLOT(d_func(), void _q_propagatedBinding (QObject *propagated))
90
#endif // UCPAGETREENODE_H