/usr/include/libtomahawk/Query.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 | /* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2010-2012, Jeff Mitchell <jeff@tomahawk-player.org>
* Copyright 2013, Uwe L. Korn <uwelk@xhochy.com>
*
* 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 TOMAHAWK_QUERY_H
#define TOMAHAWK_QUERY_H
#include <QObject>
#include <QList>
#include <QVariant>
#include "DllMacro.h"
#include "Typedefs.h"
namespace Tomahawk
{
class DatabaseCommand_LoadPlaylistEntries;
class Resolver;
class QueryPrivate;
class DLLEXPORT Query : public QObject
{
Q_OBJECT
friend class DatabaseCommand_LoadPlaylistEntries;
friend class Pipeline;
public:
static query_ptr get( const QString& artist, const QString& title, const QString& album, const QID& qid = QString(), bool autoResolve = true );
static query_ptr get( const Tomahawk::track_ptr& track, const QID& qid = QString() );
static query_ptr get( const QString& query, const QID& qid );
/**
* Get a Query object with a fixed Result reference which is not re-resolved.
*/
static query_ptr getFixed( const Tomahawk::track_ptr& track, const Tomahawk::result_ptr& result );
virtual ~Query();
bool equals( const Tomahawk::query_ptr& other, bool ignoreCase = false, bool ignoreAlbum = false ) const;
float howSimilar( const Tomahawk::result_ptr& r );
QVariant toVariant() const;
QString toString() const;
QID id() const;
track_ptr queryTrack() const;
track_ptr track() const;
/// returns list of all results so far
QList< result_ptr > results() const;
/// how many results found so far?
unsigned int numResults( bool onlyPlayableResults = false ) const;
bool resolvingFinished() const;
/// true when a perfect result has been found (score of 1.0)
bool solved() const;
/// true when any result has been found (score may be less than 1.0)
bool playable() const;
Tomahawk::Resolver* currentResolver() const;
QList< QPointer< Tomahawk::Resolver > > resolvedBy() const;
QString fullTextQuery() const;
bool isFullTextQuery() const;
void setResolveFinished( bool resolved );
/**
* Allow contacting the Pipeline if the state of this Query changes to
* not solved.
*/
void allowReresolve();
/**
* Disallow contacting the Pipeline if the state of this Query changes to
* not solved.
*/
void disallowReresolve();
void setSaveHTTPResultHint( bool saveResultHint );
bool saveHTTPResultHint() const;
QString resultHint() const;
void setResultHint( const QString& resultHint );
QWeakPointer< Tomahawk::Query > weakRef();
void setWeakRef( QWeakPointer< Tomahawk::Query > weakRef );
/// sorter for list of results
static bool resultSorter( const result_ptr& left, const result_ptr& right );
signals:
void resultsAdded( const QList<Tomahawk::result_ptr>& );
void resultsRemoved( const Tomahawk::result_ptr& );
void albumsAdded( const QList<Tomahawk::album_ptr>& );
void artistsAdded( const QList<Tomahawk::artist_ptr>& );
void resultsChanged();
void solvedStateChanged( bool state );
void playableStateChanged( bool state );
void resolvingFinished( bool hasResults );
public slots:
/// (indirectly) called by resolver plugins when results are found
void addResults( const QList< Tomahawk::result_ptr >& );
void removeResult( const Tomahawk::result_ptr& );
void addAlbums( const QList< Tomahawk::album_ptr >& );
void addArtists( const QList< Tomahawk::artist_ptr >& );
void onResolvingFinished();
void onResolverAdded();
protected:
QScopedPointer<QueryPrivate> d_ptr;
private slots:
void onResultStatusChanged();
void refreshResults();
private:
Query();
explicit Query( const track_ptr& track, const QID& qid, bool autoResolve );
/**
* Respective constructor for getFixed
*/
explicit Query( const track_ptr& track, const result_ptr& result );
explicit Query( const QString& query, const QID& qid );
Q_DECLARE_PRIVATE( Query )
void init();
void setCurrentResolver( Tomahawk::Resolver* resolver );
void clearResults();
void checkResults();
};
} //ns
Q_DECLARE_METATYPE( Tomahawk::query_ptr )
#endif // TOMAHAWK_QUERY_H
|