~ubuntu-sdk-team/ubuntu-ui-toolkit/trunk

« back to all changes in this revision

Viewing changes to src/Ubuntu/Components/plugin/ucpagetreenode.h

  • Committer: CI Train Bot
  • Author(s): Christian Dywan, Zsombor Egri, Zoltán Balogh, Tim Peeters, Albert Astals Cid, Michael Sheldon, Benjamin Zeller
  • Date: 2015-12-17 17:13:49 UTC
  • mfrom: (1000.739.27 OTA9-landing-2015-12-16)
  • Revision ID: ci-train-bot@canonical.com-20151217171349-8xwclnhnx8v9oz4m
OTA9-landing-2015-12-16
Approved by: Zoltan Balogh

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2015 Canonical Ltd.
 
3
 *
 
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.
 
7
 *
 
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.
 
12
 *
 
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/>.
 
15
 */
 
16
#ifndef UCPAGETREENODE_H
 
17
#define UCPAGETREENODE_H
 
18
 
 
19
#include "ucstyleditembase.h"
 
20
 
 
21
class UCPageTreeNodePrivate;
 
22
class UCPageTreeNode : public UCStyledItemBase
 
23
{
 
24
    Q_OBJECT
 
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)
 
31
 
 
32
    Q_PROPERTY(bool __isPageTreeNode READ isPageTreeNode NOTIFY isPageTreeNodeChanged)
 
33
    Q_PROPERTY(QObject* __propagated READ propagated WRITE setPropagated NOTIFY propagatedChanged)
 
34
public:
 
35
    UCPageTreeNode(QQuickItem *parent = 0);
 
36
 
 
37
    void setIsLeaf(bool isLeaf);
 
38
    bool isLeaf() const;
 
39
 
 
40
    void setParentNode(UCPageTreeNode *parentNode);
 
41
    UCPageTreeNode *parentNode() const;
 
42
 
 
43
    void setActive(bool active);
 
44
    bool active() const;
 
45
 
 
46
    void setPageStack(QQuickItem *pageStack);
 
47
    QQuickItem *pageStack() const;
 
48
 
 
49
    QQuickItem *activeLeafNode() const;
 
50
 
 
51
    QObject *propagated() const;
 
52
    void setPropagated(QObject *propagated);
 
53
    void resetPropagated();
 
54
 
 
55
    QQuickItem *toolbar() const;
 
56
    void setToolbar(QQuickItem *toolbar);
 
57
 
 
58
    bool isPageTreeNode() const;
 
59
 
 
60
    // QQmlParserStatus interface
 
61
    virtual void componentComplete() override;
 
62
 
 
63
    Q_INVOKABLE void dumpNodeTree ();
 
64
 
 
65
Q_SIGNALS:
 
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);
 
74
 
 
75
protected:
 
76
    UCPageTreeNode(UCPageTreeNodePrivate &, QQuickItem *parent);
 
77
 
 
78
    void setActiveLeafNode(QQuickItem* activeLeafNode);
 
79
 
 
80
    // QQuickItem interface
 
81
    virtual void itemChange(ItemChange change, const ItemChangeData &value) override;
 
82
 
 
83
private:
 
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))
 
88
};
 
89
 
 
90
#endif // UCPAGETREENODE_H