diff options
Diffstat (limited to 'amarok/src/lastfm.h')
-rw-r--r-- | amarok/src/lastfm.h | 158 |
1 files changed, 79 insertions, 79 deletions
diff --git a/amarok/src/lastfm.h b/amarok/src/lastfm.h index 1948b2d6..5046da64 100644 --- a/amarok/src/lastfm.h +++ b/amarok/src/lastfm.h @@ -19,11 +19,11 @@ #include "metabundle.h" -#include <qhttp.h> -#include <qobject.h> -#include <qserversocket.h> -#include <qurl.h> -#include <qvaluelist.h> +#include <tqhttp.h> +#include <tqobject.h> +#include <tqserversocket.h> +#include <tqurl.h> +#include <tqvaluelist.h> #include <kconfigdialog.h> @@ -31,8 +31,8 @@ class KLineEdit; class KAction; class KProcIO; class KURL; -class QSocket; -class QTimer; +class TQSocket; +class TQTimer; namespace KIO { class Job; } @@ -43,27 +43,27 @@ class AmarokHttp : public QObject Q_OBJECT public: - AmarokHttp ( const QString & hostname, Q_UINT16 port = 80, QObject* parent = 0 ); - int get ( const QString & path ); - QHttp::State state() const; - QByteArray readAll (); - QHttp::Error error(); + AmarokHttp ( const TQString & hostname, Q_UINT16 port = 80, TQObject* parent = 0 ); + int get ( const TQString & path ); + TQHttp::State state() const; + TQByteArray readAll (); + TQHttp::Error error(); signals: void requestFinished ( int id, bool error ); protected slots: - void slotData(KIO::Job*, const QByteArray& ); + void slotData(KIO::Job*, const TQByteArray& ); void slotResult(KIO::Job*); protected: - QString m_hostname; + TQString m_hostname; Q_UINT16 m_port; - QString m_path; - QHttp::State m_state; - QHttp::Error m_error; + TQString m_path; + TQHttp::State m_state; + TQHttp::Error m_error; bool m_done; - QByteArray m_result; + TQByteArray m_result; }; @@ -78,16 +78,16 @@ namespace LastFm public: static Controller* instance(); - KURL getNewProxy( QString genreUrl, bool useProxy ); - int changeStation ( QString url ); + KURL getNewProxy( TQString genreUrl, bool useProxy ); + int changeStation ( TQString url ); bool isPlaying() const { return m_service != 0; } WebService* getService() const { return m_service; } - QString getGenreUrl() const { return m_genreUrl; } + TQString getGenreUrl() const { return m_genreUrl; } static bool checkCredentials(); - static QString createCustomStation(); - static QString stationDescription( QString url = QString::null ); // necessary for translation + static TQString createCustomStation(); + static TQString stationDescription( TQString url = TQString::null ); // necessary for translation public slots: void playbackStopped(); @@ -100,9 +100,9 @@ namespace LastFm void setActionsEnabled( bool enable ); static Controller *s_instance; - QPtrList<KAction> m_actionList; + TQPtrList<KAction> m_actionList; - QString m_genreUrl; + TQString m_genreUrl; WebService* m_service; }; @@ -113,45 +113,45 @@ namespace LastFm public: enum DataType { Artist, Album, Track }; - WebService( QObject* parent, bool useProxy ); + WebService( TQObject* parent, bool useProxy ); ~WebService(); - bool handshake( const QString& username, const QString& password ); + bool handshake( const TQString& username, const TQString& password ); - bool changeStation( QString url ); - QString currentUsername() const { return m_username; } - QString currentPassword() const { return m_password; } - QString currentStation() const { return m_station; } - QString session() const { return m_session; } - QUrl streamUrl() const { return m_streamUrl; } + bool changeStation( TQString url ); + TQString currentUsername() const { return m_username; } + TQString currentPassword() const { return m_password; } + TQString currentStation() const { return m_station; } + TQString session() const { return m_session; } + TQUrl streamUrl() const { return m_streamUrl; } - void friends( QString username ); - void neighbours( QString username ); + void friends( TQString username ); + void neighbours( TQString username ); - void recentTracks( QString username ); - void userTags( QString username ); + void recentTracks( TQString username ); + void userTags( TQString username ); - void recommend( int type, QString username, QString artist, QString token = QString() ); + void recommend( int type, TQString username, TQString artist, TQString token = TQString() ); - void recommendArtist( QString username, QString artist ) + void recommendArtist( TQString username, TQString artist ) { recommend( WebService::Artist, username, artist ); } - void recommendAlbum( QString username, QString artist, QString album ) + void recommendAlbum( TQString username, TQString artist, TQString album ) { recommend( WebService::Album, username, artist, album ); } - void recommendTrack( QString username, QString artist, QString track ) + void recommendTrack( TQString username, TQString artist, TQString track ) { recommend( WebService::Track, username, artist, track ); } /** Verify with server that a supplied user/pass combo is valid. Password should be MD5 hashed. **/ - void verifyUser( const QString& user, const QString& pass ); + void verifyUser( const TQString& user, const TQString& pass ); bool cancel(); bool wasCanceled() const { return m_wasCanceled; } - QString proxyUrl() { return m_proxyUrl; } + TQString proxyUrl() { return m_proxyUrl; } public slots: void requestMetaData(); @@ -165,7 +165,7 @@ namespace LastFm void actionStarted(); void actionFinished(); - void stationChanged( QString url, QString name ); + void stationChanged( TQString url, TQString name ); void songQueued(); void metaDataResult( const MetaBundle &bundle ); @@ -175,36 +175,36 @@ namespace LastFm void skipDone(); void banDone(); - void friendsResult( const QString& username, const QStringList& friends ); - void neighboursResult( const QString& username, const QStringList& friends ); + void friendsResult( const TQString& username, const TQStringList& friends ); + void neighboursResult( const TQString& username, const TQStringList& friends ); - void recentTracksResult( const QString& username, QValueList< QPair<QString, QString> > songs ); - void userTagsResult( const QString& username, const QStringList& tags ); + void recentTracksResult( const TQString& username, TQValueList< QPair<TQString, TQString> > songs ); + void userTagsResult( const TQString& username, const TQStringList& tags ); private: enum errorCode { E_NOCONTENT = 1, E_NOMEMBERS = 2, E_NOFANS = 3, E_NOAVAIL = 4, E_NOSUBSCRIBER = 5, E_NONEIGHBOURS = 6, E_NOSTOPPED = 7, E_OTHER = 0 }; - void showError( int code, QString message = QString::null ); + void showError( int code, TQString message = TQString::null ); bool m_useProxy; - QString parameter( const QString keyName, const QString data ) const; - QStringList parameterArray( const QString keyName, const QString data ) const; - QStringList parameterKeys( const QString keyName, const QString data ) const; - - QString m_username; // login username - QString m_password; // login password - QString m_station; // the url of the station - QString m_session; // session id that last.fm provides - QString m_baseHost; // who are we connecting to? - QString m_basePath; // where are we connecting to! - QUrl m_streamUrl; // last.fm webserver for direct connection (proxy connects to this) + TQString parameter( const TQString keyName, const TQString data ) const; + TQStringList parameterArray( const TQString keyName, const TQString data ) const; + TQStringList parameterKeys( const TQString keyName, const TQString data ) const; + + TQString m_username; // login username + TQString m_password; // login password + TQString m_station; // the url of the station + TQString m_session; // session id that last.fm provides + TQString m_baseHost; // who are we connecting to? + TQString m_basePath; // where are we connecting to! + TQUrl m_streamUrl; // last.fm webserver for direct connection (proxy connects to this) bool m_subscriber; // self explanatory KProcIO* m_server; - QString m_proxyUrl; + TQString m_proxyUrl; MetaBundle m_metaBundle; bool m_deletionUnsafe; @@ -234,33 +234,33 @@ namespace LastFm public: Bundle() {}; Bundle( const Bundle& bundle); - QString imageUrl() const { return m_imageUrl; } - void setImageUrl( const QString& imageUrl ) { m_imageUrl = imageUrl; } + TQString imageUrl() const { return m_imageUrl; } + void setImageUrl( const TQString& imageUrl ) { m_imageUrl = imageUrl; } - QString artistUrl() const { return m_artistUrl; } - void setArtistUrl( const QString& theValue ) { m_artistUrl = theValue; } + TQString artistUrl() const { return m_artistUrl; } + void setArtistUrl( const TQString& theValue ) { m_artistUrl = theValue; } - QString albumUrl() const { return m_albumUrl; } - void setAlbumUrl( const QString& theValue ) { m_albumUrl = theValue; } + TQString albumUrl() const { return m_albumUrl; } + void setAlbumUrl( const TQString& theValue ) { m_albumUrl = theValue; } - QString titleUrl() const { return m_titleUrl; } - void setTitleUrl( const QString& theValue ) { m_titleUrl = theValue; } + TQString titleUrl() const { return m_titleUrl; } + void setTitleUrl( const TQString& theValue ) { m_titleUrl = theValue; } - void detach(); // for being able to apply QDeepCopy<> + void detach(); // for being able to apply TQDeepCopy<> private: - QString m_imageUrl; - QString m_albumUrl; - QString m_artistUrl; - QString m_titleUrl; + TQString m_imageUrl; + TQString m_albumUrl; + TQString m_artistUrl; + TQString m_titleUrl; }; - // We must implement this because QServerSocket has one pure virtual method. + // We must implement this because TQServerSocket has one pure virtual method. // It's just used for finding a free port. class MyServerSocket : public QServerSocket { public: - MyServerSocket() : QServerSocket( Q_UINT16( 0 ) ) {} + MyServerSocket() : TQServerSocket( Q_UINT16( 0 ) ) {} private: void newConnection( int ) {} @@ -272,7 +272,7 @@ namespace LastFm Q_OBJECT public: - LoginDialog( QWidget *parent ); + LoginDialog( TQWidget *parent ); protected slots: void slotOk(); @@ -288,9 +288,9 @@ namespace LastFm Q_OBJECT public: - CustomStationDialog( QWidget *parent ); + CustomStationDialog( TQWidget *parent ); - QString text() const; + TQString text() const; private: KLineEdit *m_edit; |