~zsombi/ubuntu-ui-toolkit/asyncAPL

« back to all changes in this revision

Viewing changes to src/Ubuntu/Components/plugin/privates/ucpagewrapper_p.h

  • Committer: Zsombor Egri
  • Date: 2016-02-10 14:15:02 UTC
  • mfrom: (1834.1.8 staging)
  • Revision ID: zsombor.egri@canonical.com-20160210141502-9c06nihxmplbkudv
staging sync

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2016 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
 
 
17
#ifndef UCPAGEWRAPPER_P_H
 
18
#define UCPAGEWRAPPER_P_H
 
19
 
 
20
#include "ucpagetreenode_p.h"
 
21
 
 
22
class UCPageWrapper;
 
23
class UCPageWrapperIncubator;
 
24
class UCPageWrapperPrivate : public UCPageTreeNodePrivate
 
25
{
 
26
    Q_DECLARE_PUBLIC(UCPageWrapper)
 
27
 
 
28
public:
 
29
    UCPageWrapperPrivate ();
 
30
    ~UCPageWrapperPrivate ();
 
31
    void init();
 
32
 
 
33
    enum PropertyFlags {
 
34
        CustomVisible = LastPageTreeNodeFlag
 
35
    };
 
36
 
 
37
    enum State {
 
38
        Waiting, LoadingComponent, CreatingObject, NotifyPageLoaded, Ready, Error
 
39
    };
 
40
 
 
41
    void initPage();
 
42
    void reset ();
 
43
    void activate   ();
 
44
    void deactivate ();
 
45
    QQuickItem *toItem (QObject *theObject);
 
46
    void initItem (QQuickItem *theItem);
 
47
    void copyProperties (QObject *target);
 
48
 
 
49
    void createIncubator  ();
 
50
    void destroyIncubator ();
 
51
    void onActiveChanged();
 
52
 
 
53
    void setCanDestroy(bool canDestroy);
 
54
 
 
55
    //state machine functions
 
56
    void nextStep ();
 
57
    void loadComponentState ();
 
58
    void createObjectState ();
 
59
    void initializeObjectIfReady ();
 
60
 
 
61
    QVariant m_reference;
 
62
    QVariant m_properties;
 
63
    QQuickItem* m_object;
 
64
    QQuickItem* m_parentPage;
 
65
    QQuickItem* m_parentWrapper;
 
66
    QQuickItem* m_pageHolder;
 
67
    UCPageWrapperIncubator* m_incubator;
 
68
    QQmlComponent *m_component;
 
69
    QQmlContext *m_itemContext;
 
70
    State m_state;
 
71
    int m_column;
 
72
    bool m_canDestroy:1;
 
73
    bool m_synchronous:1;
 
74
    bool m_ownsComponent:1;
 
75
};
 
76
 
 
77
#endif // UCPAGEWRAPPER_P_H