File indexing completed on 2024-05-19 04:49:26
0001 /**************************************************************************************** 0002 * Copyright (c) 2010 Nikolaj Hald Nielsen <nhn@kde.org> * 0003 * * 0004 * This program is free software; you can redistribute it and/or modify it under * 0005 * the terms of the GNU General Public License as published by the Free Software * 0006 * Foundation; either version 2 of the License, or (at your option) any later * 0007 * version. * 0008 * * 0009 * This program is distributed in the hope that it will be useful, but WITHOUT ANY * 0010 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * 0011 * PARTICULAR PURPOSE. See the GNU General Public License for more details. * 0012 * * 0013 * You should have received a copy of the GNU General Public License along with * 0014 * this program. If not, see <http://www.gnu.org/licenses/>. * 0015 ****************************************************************************************/ 0016 0017 #ifndef FINDINSOURCECAPABILITY_H 0018 #define FINDINSOURCECAPABILITY_H 0019 0020 #include "core/amarokcore_export.h" 0021 #include "core/capabilities/Capability.h" 0022 0023 namespace Capabilities { 0024 0025 /** 0026 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. 0027 0028 @author Nikolaj Hald Nielsen <nhn@kde.org> 0029 */ 0030 0031 class AMAROKCORE_EXPORT FindInSourceCapability : public Capabilities::Capability 0032 { 0033 Q_OBJECT 0034 Q_FLAGS( TargetTag TargetTags ) 0035 0036 public: 0037 enum TargetTag 0038 { 0039 Artist = 0x01, 0040 Album = 0x02, 0041 Composer = 0x04, 0042 Genre = 0x08, 0043 Track = 0x10, 0044 Year = 0x20 0045 }; 0046 0047 ~FindInSourceCapability() override; 0048 0049 virtual void findInSource( QFlags<TargetTag> tag = Album ) = 0; 0050 0051 /** 0052 * Get the capabilityInterfaceType of this capability 0053 * @return The capabilityInterfaceType ( always Capabilities::Capability::FindInSource; ) 0054 */ 0055 static Type capabilityInterfaceType() { return Capabilities::Capability::FindInSource; } 0056 0057 Q_DECLARE_FLAGS( TargetTags, TargetTag ) 0058 }; 0059 0060 } // namespace Capabilities 0061 0062 Q_DECLARE_OPERATORS_FOR_FLAGS( Capabilities::FindInSourceCapability::TargetTags ) 0063 0064 #endif // FINDINSOURCECAPABILITY_H