Revert previous commit, was incorrect
[amarok.git] / src / actionclasses.h
blobc251f90597ef8a6c17a284239d98fc15c0b2fff6
1 // Maintainer: Max Howell <max.howell@methylblue.com>, (C) 2004
2 // Copyright: See COPYING file that comes with this distribution
3 //
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"
14 #include <KAction>
15 #include <KToggleAction>
16 #include <KSelectAction>
18 #include <QPointer>
20 class KActionCollection;
21 class KHelpMenu;
24 namespace Amarok
26 class Menu : public PrettyPopupMenu
28 Q_OBJECT
29 public:
30 static Menu *instance();
31 static KMenu *helpMenu( QWidget *parent = 0 );
33 private:
34 Menu();
36 static KHelpMenu *s_helpMenu;
40 class MenuAction : public KAction
42 public:
43 MenuAction( KActionCollection* );
44 virtual int plug( QWidget*, int index = -1 );
48 class PlayPauseAction : public KToggleAction, public EngineObserver
50 public:
51 PlayPauseAction( KActionCollection* );
52 virtual void engineStateChanged( Engine::State, Engine::State = Engine::Empty );
55 class ToggleAction : public KToggleAction
57 public:
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 );
64 private:
65 void ( *m_function ) ( bool );
68 class SelectAction : public KSelectAction
70 public:
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;
80 private:
81 void ( *m_function ) ( int );
82 QStringList m_icons;
86 class RandomAction : public SelectAction
88 public:
89 RandomAction( KActionCollection *ac );
90 virtual void setCurrentItem( int n );
93 class FavorAction : public SelectAction
95 public:
96 FavorAction( KActionCollection *ac );
99 class RepeatAction : public SelectAction
101 public:
102 RepeatAction( KActionCollection *ac );
105 class BurnMenu : public KMenu
107 Q_OBJECT
109 public:
110 static KMenu *instance();
112 private:
113 BurnMenu();
115 private slots:
116 void slotBurnCurrentPlaylist();
117 void slotBurnSelectedTracks();
121 class BurnMenuAction : public KAction
123 public:
124 BurnMenuAction( KActionCollection* );
125 virtual QWidget* createWidget( QWidget* );
128 class StopMenu : public KMenu
130 Q_OBJECT
132 public:
133 static KMenu *instance();
135 private slots:
136 void slotAboutToShow();
137 void slotStopNow();
138 void slotStopAfterTrack();
139 void slotStopAfterQueue();
141 private:
142 StopMenu();
143 QAction *m_stopNow;
144 QAction *m_stopAfterTrack;
145 QAction *m_stopAfterQueue;
149 class StopAction : public KAction
151 public:
152 StopAction( KActionCollection* );
153 virtual int plug( QWidget*, int index = -1 );
156 } /* namespace Amarok */
159 #endif /* AMAROK_ACTIONCLASSES_H */