Warning, file /multimedia/amarok/src/playlist/PlaylistDefines.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /**************************************************************************************** 0002 * Copyright (c) 2008 - 2009 Nikolaj Hald Nielsen <nhn@kde.org> * 0003 * Copyright (c) 2009 Téo Mrnjavac <teo@kde.org> * 0004 * Copyright (c) 2012 Ralf Engels <ralf-engels@gmx.de> * 0005 * * 0006 * This program is free software; you can redistribute it and/or modify it under * 0007 * the terms of the GNU General Public License as published by the Free Software * 0008 * Foundation; either version 2 of the License, or (at your option) any later * 0009 * version. * 0010 * * 0011 * This program is distributed in the hope that it will be useful, but WITHOUT ANY * 0012 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * 0013 * PARTICULAR PURPOSE. See the GNU General Public License for more details. * 0014 * * 0015 * You should have received a copy of the GNU General Public License along with * 0016 * this program. If not, see <http://www.gnu.org/licenses/>. * 0017 ****************************************************************************************/ 0018 0019 #ifndef AMAROK_PLAYLISTDEFINES_H 0020 #define AMAROK_PLAYLISTDEFINES_H 0021 0022 #include <QString> 0023 #include <QStringList> 0024 0025 namespace Playlist 0026 { 0027 0028 /** A enum used by playlist and layouts to identify a token. 0029 We should have used the varTitle numbers for that. 0030 */ 0031 enum Column 0032 { 0033 PlaceHolder = 0, 0034 Album, 0035 AlbumArtist, 0036 Artist, 0037 Bitrate, 0038 Bpm, 0039 Comment, 0040 Composer, 0041 CoverImage, 0042 Directory, 0043 DiscNumber, 0044 Divider, 0045 Filename, 0046 Filesize, 0047 Genre, 0048 GroupLength, 0049 GroupTracks, 0050 Labels, 0051 LastPlayed, 0052 Length, 0053 LengthInSeconds, 0054 Mood, 0055 Moodbar, 0056 PlayCount, 0057 Rating, 0058 SampleRate, 0059 Score, 0060 Source, 0061 SourceEmblem, 0062 Title, 0063 TitleWithTrackNum, 0064 TrackNumber, 0065 Type, 0066 Year, 0067 NUM_COLUMNS 0068 }; 0069 //when sorting, Random is -1 0070 0071 enum SearchFields 0072 { 0073 MatchTrack = 1, 0074 MatchArtist = 2, 0075 MatchAlbum = 4, 0076 MatchGenre = 8, 0077 MatchComposer = 16, 0078 MatchYear = 32, 0079 MatchRating = 64 0080 }; 0081 0082 enum DataRoles 0083 { 0084 TrackRole = Qt::UserRole, 0085 StateRole, 0086 UniqueIdRole, 0087 ActiveTrackRole, 0088 QueuePositionRole, 0089 InCollectionRole, 0090 MultiSourceRole, 0091 StopAfterTrackRole 0092 }; 0093 0094 /** 0095 * A singleton class used to store translated names of playlist columns. 0096 * Use the global function columnNames to access them. 0097 * 0098 * @author Alexander Potashev <aspotashev@gmail.com> 0099 */ 0100 class PlaylistColumnInfos 0101 { 0102 public: 0103 static const QStringList &internalNames(); 0104 static const QStringList &names(); 0105 static const QStringList &icons(); 0106 static const QList<Column> &groups(); 0107 0108 private: 0109 PlaylistColumnInfos(); 0110 0111 static QStringList *s_internalNames; 0112 static QStringList *s_names; 0113 static QStringList *s_icons; 0114 static QList<Column> *s_groups; 0115 }; 0116 0117 inline Column columnForName( const QString &internalName ) 0118 { 0119 return static_cast<Column>(Playlist::PlaylistColumnInfos::internalNames(). 0120 indexOf( internalName )); 0121 } 0122 0123 inline const QString &internalColumnName( Column c ) 0124 { 0125 return Playlist::PlaylistColumnInfos::internalNames().at( static_cast<int>(c) ); 0126 } 0127 0128 inline const QString &columnName( Column c ) 0129 { 0130 return Playlist::PlaylistColumnInfos::names().at( static_cast<int>(c) ); 0131 } 0132 0133 inline const QString &iconName( Column c ) 0134 { 0135 return Playlist::PlaylistColumnInfos::icons().at( static_cast<int>(c) ); 0136 } 0137 0138 inline const QList<Playlist::Column> &groupableCategories() 0139 { 0140 return Playlist::PlaylistColumnInfos::groups(); 0141 } 0142 0143 /** these are the columns that can be directly edited by the user. */ 0144 bool isEditableColumn( Column c ); 0145 0146 //FIXME: disabled sorting by File size, Group length, Group tracks, Length because 0147 // it doesn't work. 0148 bool isSortableColumn( Column c ); 0149 0150 0151 } 0152 0153 // Q_DECLARE_METATYPE(Playlist::Column) 0154 0155 0156 #endif