Debian Codegraph @

src/core/capabilities/FindInSourceCapability.h

raw
1 /****************************************************************************************
2 * Copyright (c) 2010 Nikolaj Hald Nielsen <[email protected]> *
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 #ifndef FINDINSOURCECAPABILITY_H
18 #define FINDINSOURCECAPABILITY_H
19
20 #include "core/amarokcore_export.h"
21 #include "core/capabilities/Capability.h"
22
23 namespace Capabilities {
24
25 /**
26 This capability exposes a method that shows this track (or the closest possible parent, such as album) in the source where it was added from.
27
28 @author Nikolaj Hald Nielsen <[email protected]>
29 */
30
31 class AMAROKCORE_EXPORT FindInSourceCapability : public Capabilities::Capability
32 {
33 Q_OBJECT
34 Q_FLAGS( TargetTag TargetTags )
35
36 public:
37 enum TargetTag
38 {
39 Artist = 0x01,
40 Album = 0x02,
41 Composer = 0x04,
42 Genre = 0x08,
43 Track = 0x10,
44 Year = 0x20
45 };
46
47 ~FindInSourceCapability() override;
48
49 virtual void findInSource( QFlags<TargetTag> tag = Album ) = 0;
50
51 /**
52 * Get the capabilityInterfaceType of this capability
53 * @return The capabilityInterfaceType ( always Capabilities::Capability::FindInSource; )
54 */
55 static Type capabilityInterfaceType() { return Capabilities::Capability::FindInSource; }
56
57 Q_DECLARE_FLAGS( TargetTags, TargetTag )
58 };
59
60 } // namespace Capabilities
61
62 Q_DECLARE_OPERATORS_FOR_FLAGS( Capabilities::FindInSourceCapability::TargetTags )
63
64 #endif // FINDINSOURCECAPABILITY_H