Debian Codegraph @

src/imports/Layouts/plugin/ulconditionallayout.h

raw
1 /*
2 * Copyright 2013 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 * Author: Zsombor Egri <[email protected]>
17 */
18
19 #ifndef ULCONDITIONALLAYOUT_H
20 #define ULCONDITIONALLAYOUT_H
21
22 #include <QtCore/QStringList>
23 #include <QtQml/QQmlComponent>
24 #include <QtQml/QQmlScriptString>
25
26 class QQmlBinding;
27 class ULConditionalLayoutPrivate;
28 class ULConditionalLayout : public QObject
29 {
30 Q_OBJECT
31 Q_DISABLE_COPY(ULConditionalLayout)
32
33 Q_PROPERTY(QString name READ layoutName WRITE setLayoutName)
34 Q_PROPERTY(bool when READ when WRITE setWhen)
35 Q_PROPERTY(QQmlComponent *layout READ layout WRITE setLayout)
36 Q_CLASSINFO("DefaultProperty", "layout")
37 public:
38 explicit ULConditionalLayout(QObject *parent = 0);
39 ~ULConditionalLayout();
40
41 // getter/setter
42 QString layoutName() const;
43 void setLayoutName(const QString &name);
44 bool when() const;
45 void setWhen(bool when);
46 QQmlComponent *layout() const;
47 void setLayout(QQmlComponent *component);
48
49 private:
50 Q_DECLARE_PRIVATE(ULConditionalLayout)
51 QScopedPointer<ULConditionalLayoutPrivate> d_ptr;
52 };
53
54 #endif // ULCONDITIONALLAYOUT_H