make PlaylistModel observe albums for changes to the cover image (needed for services...
[amarok.git] / src / app.h
blobeb56c366e055636e8c982574045af406ca202f5f
1 /***************************************************************************
2 app.h - description
3 -------------------
4 begin : Mit Okt 23 14:35:18 CEST 2002
5 copyright : (C) 2002 by Mark Kretschmann
6 email : markey@web.de
7 ***************************************************************************/
9 /***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
18 #ifndef AMAROK_APP_H
19 #define AMAROK_APP_H
21 #include "config-amarok.h"
23 #include "amarok_export.h"
24 #include "engineobserver.h" //baseclass
25 #include <KUniqueApplication> //baseclass
26 #include <KUrl>
28 #include <QByteArray>
30 namespace Amarok {
31 class TrayIcon;
35 namespace KIO { class Job; }
37 class KJob;
38 class MetaBundle;
39 class Playlist;
40 class MainWindow;
41 class MediaDeviceManager;
42 class KSplashScreen;
44 class AMAROK_EXPORT App : public KUniqueApplication, public EngineObserver
46 Q_OBJECT
47 public:
48 App();
49 ~App();
51 static App *instance() { return static_cast<App*>( kapp ); }
53 static void handleCliArgs();
54 static void initCliArgs( int argc, char *argv[] );
56 static int mainThreadId;
58 inline MainWindow *mainWindow() const { return m_mainWindow; }
60 // FRIENDS ------
61 friend class MainWindow; //requires access to applySettings()
63 signals:
64 void useScores( bool use );
65 void useRatings( bool use );
66 void moodbarPrefs( bool show, bool moodier, int alter, bool withMusic );
67 void prepareToQuit();
68 protected: /* for OSD, tray, and dcop */
69 void engineStateChanged( Engine::State state, Engine::State oldState = Engine::Empty );
70 void engineNewMetaData( const MetaBundle &bundle, bool trackChanged );
71 void engineTrackPositionChanged( long position, bool /*userSeek*/ );
72 void engineVolumeChanged( int );
74 private slots:
75 void setRating1() { setRating( 1 ); }
76 void setRating2() { setRating( 2 ); }
77 void setRating3() { setRating( 3 ); }
78 void setRating4() { setRating( 4 ); }
79 void setRating5() { setRating( 5 ); }
80 void continueInit();
82 public slots:
83 void applySettings( bool firstTime = false );
84 void slotConfigAmarok( const QByteArray& page = QByteArray() );
85 void slotConfigShortcuts();
86 void slotConfigToolBars();
87 void slotConfigEqualizer();
88 void setUseScores( bool use );
89 void setUseRatings( bool use );
90 void setMoodbarPrefs( bool show, bool moodier, int alter, bool withMusic );
91 KIO::Job *trashFiles( const KUrl::List &files );
92 void quit();
94 private slots:
95 void slotTrashResult( KJob *job );
97 private:
98 void initGlobalShortcuts();
99 void firstRunWizard();
101 void setRating( int n );
103 // ATTRIBUTES ------
104 MainWindow *m_mainWindow;
105 #ifndef Q_WS_MAC
106 Amarok::TrayIcon *m_tray;
107 #endif
108 MediaDeviceManager *m_mediaDeviceManager;
109 KSplashScreen *m_splash;
112 #define pApp static_cast<App*>(kapp)
115 #endif // AMAROK_APP_H