/usr/include/libtomahawk/utils/TomahawkUtils.h is in libtomahawk-dev 0.8.4+dfsg1-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 | /* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
* Copyright 2010-2012, Jeff Mitchell <jeff@tomahawk-player.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Tomahawk is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifndef TOMAHAWKUTILS_H
#define TOMAHAWKUTILS_H
#include "DllMacro.h"
#include <QtCore/QThread>
#include <QtNetwork/QNetworkProxy>
#include <QtCore/QStringList>
#include <Typedefs.h>
#define RESPATH ":/data/"
class QDir;
class QNetworkAccessManager;
namespace TomahawkUtils
{
enum MediaType
{
MediaTypeArtist,
MediaTypeAlbum,
MediaTypeTrack
};
enum ImageType
{
DefaultAlbumCover,
DefaultArtistImage,
DefaultTrackImage,
DefaultSourceAvatar,
DefaultCollection,
DefaultResolver,
NowPlayingSpeaker,
NowPlayingSpeakerDark,
InfoIcon,
PlayButton,
PlayButtonPressed,
PauseButton,
PauseButtonPressed,
PrevButton,
PrevButtonPressed,
NextButton,
NextButtonPressed,
ShuffleOff,
ShuffleOffPressed,
ShuffleOn,
ShuffleOnPressed,
RepeatOne,
RepeatOnePressed,
RepeatAll,
RepeatAllPressed,
RepeatOff,
RepeatOffPressed,
Volume,
Share,
NotLoved,
Loved,
Configure,
GreenDot,
AddContact,
SubscribeOn,
SubscribeOff,
JumpLink,
ProcessStop,
HeadphonesOn,
HeadphonesOff,
PadlockClosed,
PadlockOpen,
Downloading,
Uploading,
ViewRefresh,
SuperCollection,
LovedPlaylist,
NewReleases,
NewAdditions,
RecentlyPlayed,
Queue,
AutomaticPlaylist,
Charts,
Station,
Playlist,
Search,
ListRemove,
ListAdd,
AdvancedSettings,
AccountSettings,
MusicSettings,
Add,
DropSong,
DropAlbum,
DropAllSongs,
DropLocalSongs,
DropTopSongs,
LastfmIcon,
SpotifyIcon,
SoundcloudIcon,
AccountNone,
Starred,
Unstarred,
StarHovered,
SipPluginOnline,
SipPluginOffline,
ResolverBundle,
Inbox,
Invalid,
InboxNewItem,
Outbox,
NetworkActivity
};
enum ImageMode
{
Original,
CoverInCase,
DropShadow,
RoundedCorners
};
DLLEXPORT bool headless();
DLLEXPORT void setHeadless( bool headless );
DLLEXPORT QString appFriendlyVersion();
DLLEXPORT QDir appConfigDir();
DLLEXPORT QDir appDataDir();
DLLEXPORT QDir appLogDir();
DLLEXPORT const QString logFilePath();
DLLEXPORT void installTranslator( QObject* parent );
DLLEXPORT QString timeToString( int seconds );
DLLEXPORT QString ageToString( const QDateTime& time, bool appendAgoString = false );
DLLEXPORT QString filesizeToString( unsigned int size );
DLLEXPORT QByteArray percentEncode( const QUrl& url );
DLLEXPORT QStringList supportedExtensions();
DLLEXPORT QString extensionToMimetype( const QString& extension );
DLLEXPORT void msleep( unsigned int ms );
DLLEXPORT bool newerVersion( const QString& oldVersion, const QString& newVersion );
DLLEXPORT int levenshtein( const QString& source, const QString& target );
DLLEXPORT quint64 infosystemRequestId();
DLLEXPORT QString md5( const QByteArray& data );
DLLEXPORT bool removeDirectory( const QString& dir );
/**
* Check if this URL refers to a http-Result.
*
* Attention: This only checks for a http result, not a httpS result.
*/
DLLEXPORT bool isHttpResult( const QString& url );
DLLEXPORT bool isHttpsResult( const QString& url );
DLLEXPORT bool isLocalResult( const QString& url );
DLLEXPORT bool isRtmpResult( const QString& url );
DLLEXPORT bool verifyFile( const QString& filePath, const QString& signature );
DLLEXPORT QString extractScriptPayload( const QString& filename, const QString& resolverId, const QString& dirName = "atticaresolvers" );
DLLEXPORT bool unzipFileInFolder( const QString& zipFileName, const QDir& folder );
// Extracting may be asynchronous, pass in a receiver object with the following slots:
// extractSucceeded( const QString& path ) and extractFailed() to be notified/
DLLEXPORT void extractBinaryResolver( const QString& zipFilename, QObject* receiver );
// Used by the above, not exported
void copyWithAuthentication( const QString& srcFile, const QDir dest, QObject* receiver );
DLLEXPORT bool whitelistedHttpResultHint( const QUrl& url );
DLLEXPORT int compareVersionStrings( const QString& first, const QString& second );
/**
* This helper is designed to help "update" an existing playlist with a newer revision of itself.
* To avoid re-loading the whole playlist and re-resolving tracks that are the same in the old playlist,
* it goes through the new playlist and adds only new tracks.
*
* The new list of tracks is returned
*
* \return true if some changes were made, false if the new tracks are the same as the current tracks in \param orig
*/
DLLEXPORT QList< Tomahawk::query_ptr > mergePlaylistChanges( const QList< Tomahawk::query_ptr >& orig, const QList< Tomahawk::query_ptr >& newTracks, bool& changed );
DLLEXPORT void crash();
/**
* User-Agent header helpers
*/
DLLEXPORT const QString operatingSystemVersionDetail();
DLLEXPORT const QString userAgentString( const QString& applicationName, const QString& applicationVersion );
/**
* Qt4 / Qt5 compatibility layer
*/
/* QUrl */
DLLEXPORT void urlAddQueryItem( QUrl& url, const QString& key, const QString& value );
DLLEXPORT QString urlQueryItemValue( const QUrl& url, const QString& key );
DLLEXPORT bool urlHasQueryItem( const QUrl& url, const QString& key );
DLLEXPORT QList<QPair<QString, QString> > urlQueryItems( const QUrl& url );
DLLEXPORT void urlSetQuery( QUrl& url, const QString& query );
DLLEXPORT QByteArray encodedQuery( const QUrl& url );
}
#endif // TOMAHAWKUTILS_H
|