1 /****************************************************************************************
2  * Copyright (c) 2010 Nikolaj Hald Nielsen <nhn@kde.org>                                *
3  *                                                                                      *
4  * This program is free software; you can redistribute it and/or modify it under        *
5  * the terms of the GNU General Public License as published by the Free Software        *
6  * Foundation; either version 2 of the License, or (at your option) any later           *
7  * version.                                                                             *
8  *                                                                                      *
9  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
10  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
11  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
12  *                                                                                      *
13  * You should have received a copy of the GNU General Public License along with         *
14  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
15  ****************************************************************************************/
16 
17 
18 #ifndef SERVICECAPABILITIES_H
19 #define SERVICECAPABILITIES_H
20 
21 
22 #include "amarok_export.h"
23 #include "amarokurls/AmarokUrl.h"
24 
25 #include "core/capabilities/BookmarkThisCapability.h"
26 #include "core/capabilities/ActionsCapability.h"
27 #include "core/capabilities/FindInSourceCapability.h"
28 #include "core/capabilities/SourceInfoCapability.h"
29 
30 
31 class BookmarkThisProvider;
32 class ActionsProvider;
33 class SourceInfoProvider;
34 
35 namespace Meta
36 {
37     class ServiceTrack;
38 }
39 
40 
41 /**
42 A service specific implementation of the BookmarkThisCapability
43 
44     @author Nikolaj Hald Nielsen <nhn@kde.org>
45 */
46 class AMAROK_EXPORT ServiceBookmarkThisCapability : public Capabilities::BookmarkThisCapability {
47 public:
48     explicit ServiceBookmarkThisCapability( BookmarkThisProvider * provider );
49 
50     ~ServiceBookmarkThisCapability() override;
51 
52     bool isBookmarkable() override;
53     QString browserName() override;
54     QString collectionName() override;
55     bool simpleFiltering() override;
56     QAction * bookmarkAction() const override;
57 
58 private:
59 
60     BookmarkThisProvider * m_provider;
61 };
62 
63 
64 class AMAROK_EXPORT ServiceActionsCapability : public Capabilities::ActionsCapability
65 {
66     Q_OBJECT
67 
68     public:
69         explicit ServiceActionsCapability( ActionsProvider * actionsProvider  );
70         ~ServiceActionsCapability() override;
71         QList< QAction * > actions() const override;
72 
73     private:
74         ActionsProvider * m_actionsProvider;
75 };
76 
77 
78 
79 class AMAROK_EXPORT ServiceSourceInfoCapability : public Capabilities::SourceInfoCapability
80 {
81 public:
82     explicit ServiceSourceInfoCapability( SourceInfoProvider * sourceInfoProvider );
83 
84     ~ServiceSourceInfoCapability() override;
85 
86     QString sourceName() override;
87     QString sourceDescription() override;
88     QPixmap emblem() override;
89     QString scalableEmblem() override;
90 
91 private:
92     SourceInfoProvider * m_sourceInfoProvider;
93 
94 };
95 
96 
97 
98 class AMAROK_EXPORT ServiceFindInSourceCapability : public Capabilities::FindInSourceCapability
99 {
100     Q_OBJECT
101     public:
102         explicit ServiceFindInSourceCapability( Meta::ServiceTrack *track );
103         void findInSource( QFlags<TargetTag> tag ) override;
104 
105     private:
106         Meta::ServiceTrack * m_track;
107 };
108 
109 
110 
111 #endif // SERVICECAPABILITIES_H
112