Not crap after all...
[amarok.git] / src / app.h
blob36ba34f9afed5b59453dd9dc673be6a3787adf0e
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 <kapplication.h> //baseclass
26 #include <kurl.h>
28 #include <QByteArray>
30 namespace Amarok {
31 class TrayIcon;
35 namespace KIO { class Job; }
37 class KJob;
38 class KActionCollection;
39 class KConfig;
40 class MetaBundle;
41 class Playlist;
42 class PlaylistWindow;
43 class MediaDeviceManager;
45 class AMAROK_EXPORT App : public KApplication, public EngineObserver
47 Q_OBJECT
48 public:
49 App();
50 ~App();
52 static App *instance() { return static_cast<App*>( kapp ); }
54 static void handleCliArgs();
55 static void initCliArgs( int argc, char *argv[] );
57 static int mainThreadId;
59 PlaylistWindow *playlistWindow() const { return m_pPlaylistWindow; }
61 // FRIENDS ------
62 friend class PlaylistWindow; //requires access to applySettings()
64 signals:
65 void useScores( bool use );
66 void useRatings( bool use );
67 void moodbarPrefs( bool show, bool moodier, int alter, bool withMusic );
68 void prepareToQuit();
69 protected: /* for OSD, tray, and dcop */
70 void engineStateChanged( Engine::State state, Engine::State oldState = Engine::Empty );
71 void engineNewMetaData( const MetaBundle &bundle, bool trackChanged );
72 void engineTrackPositionChanged( long position, bool /*userSeek*/ );
73 void engineVolumeChanged( int );
75 private slots:
76 void setRating1() { setRating( 1 ); }
77 void setRating2() { setRating( 2 ); }
78 void setRating3() { setRating( 3 ); }
79 void setRating4() { setRating( 4 ); }
80 void setRating5() { setRating( 5 ); }
81 void continueInit();
84 public slots:
85 void applySettings( bool firstTime = false );
86 void slotConfigAmarok( const QByteArray& page = QByteArray() );
87 void slotNewConfigAmarok( const QByteArray& page = QByteArray() );
88 void slotConfigShortcuts();
89 void slotConfigToolBars();
90 void slotConfigEqualizer();
91 void setUseScores( bool use );
92 void setUseRatings( bool use );
93 void setMoodbarPrefs( bool show, bool moodier, int alter, bool withMusic );
94 KIO::Job *trashFiles( const KUrl::List &files );
95 void quit();
97 private slots:
98 void slotTrashResult( KJob *job );
100 private:
101 void initGlobalShortcuts();
102 void firstRunWizard();
104 /** returns the playlistWindow */
105 QWidget *mainWindow() const;
107 void setRating( int n );
109 // ATTRIBUTES ------
110 PlaylistWindow *m_pPlaylistWindow;
111 #ifndef Q_WS_MAC
112 Amarok::TrayIcon *m_pTray;
113 #endif
114 MediaDeviceManager *m_pMediaDeviceManager;
117 #define pApp static_cast<App*>(kapp)
120 #endif // AMAROK_APP_H