1 // Maintainer: Max Howell <max.howell@methylblue.com>, (C) 2004
2 // Copyright: See COPYING file that comes with this distribution
4 // Description: a popupmenu to control various features of Amarok
5 // also provides Amarok's helpMenu
7 #ifndef AMAROK_ACTIONCLASSES_H
8 #define AMAROK_ACTIONCLASSES_H
10 #include "engineobserver.h"
11 #include "prettypopupmenu.h"
12 #include "widgets/sliderwidget.h"
15 #include <KToggleAction>
16 #include <KSelectAction>
20 class KActionCollection
;
26 class Menu
: public PrettyPopupMenu
30 static Menu
*instance();
31 static KMenu
*helpMenu( QWidget
*parent
= 0 );
36 static KHelpMenu
*s_helpMenu
;
40 class MenuAction
: public KAction
43 MenuAction( KActionCollection
* );
44 virtual int plug( QWidget
*, int index
= -1 );
48 class PlayPauseAction
: public KToggleAction
, public EngineObserver
51 PlayPauseAction( KActionCollection
* );
52 virtual void engineStateChanged( Engine::State
, Engine::State
= Engine::Empty
);
55 class ToggleAction
: public KToggleAction
58 ToggleAction( const QString
&text
, void ( *f
) ( bool ), KActionCollection
* const ac
, const char *name
);
60 virtual void setChecked( bool b
);
62 virtual void setEnabled( bool b
);
65 void ( *m_function
) ( bool );
68 class SelectAction
: public KSelectAction
71 SelectAction( const QString
&text
, void ( *f
) ( int ), KActionCollection
* const ac
, const char *name
);
73 virtual void setCurrentItem( int n
);
74 virtual void setEnabled( bool b
);
75 virtual void setIcons( QStringList icons
);
76 virtual QString
currentText() const;
77 QStringList
icons() const;
78 QString
currentIcon() const;
81 void ( *m_function
) ( int );
86 class RandomAction
: public SelectAction
89 RandomAction( KActionCollection
*ac
);
90 virtual void setCurrentItem( int n
);
93 class FavorAction
: public SelectAction
96 FavorAction( KActionCollection
*ac
);
99 class RepeatAction
: public SelectAction
102 RepeatAction( KActionCollection
*ac
);
105 class BurnMenu
: public KMenu
110 static KMenu
*instance();
116 void slotBurnCurrentPlaylist();
117 void slotBurnSelectedTracks();
121 class BurnMenuAction
: public KAction
124 BurnMenuAction( KActionCollection
* );
125 virtual QWidget
* createWidget( QWidget
* );
128 class StopMenu
: public KMenu
133 static KMenu
*instance();
136 void slotAboutToShow();
138 void slotStopAfterTrack();
139 void slotStopAfterQueue();
144 QAction
*m_stopAfterTrack
;
145 QAction
*m_stopAfterQueue
;
149 class StopAction
: public KAction
152 StopAction( KActionCollection
* );
153 virtual int plug( QWidget
*, int index
= -1 );
156 } /* namespace Amarok */
159 #endif /* AMAROK_ACTIONCLASSES_H */