Changeset View
Changeset View
Standalone View
Standalone View
import/package.h
- This file was added.
1 | /*************************************************************************** | ||||
---|---|---|---|---|---|
2 | * Copyright 2011 Marco Martin <mart@kde.org> * | ||||
3 | * * | ||||
4 | * This program is free software; you can redistribute it and/or modify * | ||||
5 | * it under the terms of the GNU Library General Public License as published by * | ||||
6 | * the Free Software Foundation; either version 2 of the License, or * | ||||
7 | * (at your option) any later version. * | ||||
8 | * * | ||||
9 | * This program is distributed in the hope that it will be useful, * | ||||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||||
12 | * GNU Library General Public License for more details. * | ||||
13 | * * | ||||
14 | * You should have received a copy of the GNU Library General Public License * | ||||
15 | * along with this program; if not, write to the * | ||||
16 | * Free Software Foundation, Inc., * | ||||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * | ||||
18 | ***************************************************************************/ | ||||
19 | #ifndef PACKAGE_H | ||||
20 | #define PACKAGE_H | ||||
21 | | ||||
22 | #include <QQuickItem> | ||||
23 | #include <QUrl> | ||||
24 | #include <Plasma/Package> | ||||
25 | | ||||
26 | namespace Plasma { | ||||
27 | class Package; | ||||
28 | } | ||||
29 | | ||||
30 | | ||||
31 | class QTimer; | ||||
32 | | ||||
33 | class Package : public QObject | ||||
34 | { | ||||
35 | Q_OBJECT | ||||
36 | Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) | ||||
37 | Q_PROPERTY(QString visibleName READ visibleName NOTIFY visibleNameChanged) | ||||
38 | | ||||
39 | public: | ||||
40 | Package(QObject *parent = 0); | ||||
41 | ~Package(); | ||||
42 | | ||||
43 | QString name() const; | ||||
44 | void setName(const QString &name); | ||||
45 | | ||||
46 | Q_INVOKABLE QString filePath(const QString &fileType, const QString &filename) const; | ||||
47 | Q_INVOKABLE QString filePath(const QString &fileType) const; | ||||
48 | | ||||
49 | QString visibleName() const; | ||||
50 | | ||||
51 | Q_SIGNALS: | ||||
52 | void nameChanged(const QString &); | ||||
53 | void visibleNameChanged(); | ||||
54 | | ||||
55 | private: | ||||
56 | QString m_name; | ||||
57 | Plasma::Package m_package; | ||||
58 | }; | ||||
59 | | ||||
60 | #endif |