-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathWBackendIndex.h
More file actions
97 lines (65 loc) · 3.07 KB
/
WBackendIndex.h
File metadata and controls
97 lines (65 loc) · 3.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//=================================================================================================
/*
Copyright (C) 2015-2026 Sky kit authors. <http://omega.gg/Sky>
Author: Benjamin Arnaud. <http://bunjee.me> <bunjee@omega.gg>
This file is part of SkBackend.
- GNU Lesser General Public License Usage:
This file may be used under the terms of the GNU Lesser General Public License version 3 as
published by the Free Software Foundation and appearing in the LICENSE.md file included in the
packaging of this file. Please review the following information to ensure the GNU Lesser
General Public License requirements will be met: https://www.gnu.org/licenses/lgpl.html.
- Private License Usage:
Sky kit licensees holding valid private licenses may use this file in accordance with the
private license agreement provided with the Software or, alternatively, in accordance with the
terms contained in written agreement between you and Sky kit authors. For further information
contact us at contact@omega.gg.
*/
//=================================================================================================
#ifndef WBACKENDINDEX_H
#define WBACKENDINDEX_H
// Sk includes
#include <WBackendLoader>
#ifndef SK_NO_BACKENDINDEX
// Forward declarations
class WBackendIndexPrivate;
class WLibraryFolder;
class SK_BACKEND_EXPORT WBackendIndex : public WBackendLoader
{
Q_OBJECT
Q_PROPERTY(bool isLoaded READ isLoaded NOTIFY loadedChanged)
public:
WBackendIndex(const QString & url, QObject * parent = NULL);
public: // Interface
Q_INVOKABLE void update();
Q_INVOKABLE void reload();
public: // WBackendLoader reimplementation
/* Q_INVOKABLE virtual */ bool checkId(const QString & id) const;
/* Q_INVOKABLE virtual */ void createFolderItems(WLibraryFolder * folder,
WLibraryItem::Type type) const;
/* Q_INVOKABLE virtual */ QString searchId() const;
/* Q_INVOKABLE virtual */ QString coverFromId(const QString & id) const;
/* Q_INVOKABLE virtual */ QString hubFromId (const QString & id) const;
protected: // WBackendLoader reimplementation
/* Q_INVOKABLE virtual */ WBackendNet * createBackend(const QString & id) const;
/* Q_INVOKABLE virtual */ void checkBackend(WBackendNet * backend) const;
/* Q_INVOKABLE virtual */ QString getId(const QString & url) const;
/* Q_INVOKABLE virtual */ QStringList getCoverIds() const;
signals:
void loaded ();
void updated();
void backendUpdated(const QString & id);
void loadedChanged();
public: // Properties
bool isLoaded() const;
private:
W_DECLARE_PRIVATE(WBackendIndex)
Q_PRIVATE_SLOT(d_func(), void onLoad ())
Q_PRIVATE_SLOT(d_func(), void onUpdate())
Q_PRIVATE_SLOT(d_func(), void onData(const WBackendIndexData &))
Q_PRIVATE_SLOT(d_func(), void onBackendUpdate())
Q_PRIVATE_SLOT(d_func(), void onItemLoad(WRemoteData *))
Q_PRIVATE_SLOT(d_func(), void onActionComplete())
};
#include <private/WBackendIndex_p>
#endif // SK_NO_BACKENDINDEX
#endif // WBACKENDINDEX_H