summaryrefslogtreecommitdiffstats
path: root/noatun/library/noatun/stdaction.h
blob: b0e30098d5897b26071d53cab4ffac4d2ea66cf2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
#ifndef _NOATUNSTDACTION_H_
#define _NOATUNSTDACTION_H_

#include <kaction.h>
#include <kactionclasses.h>
#include <kdemacros.h>
class KPopupMenu;

/**
 * Holds all noatun related actions
 * @short noatun specific actions
 * @author Charles Samuels
 **/
namespace NoatunStdAction
{

/**
 * An action starting noatun playback
 **/
class PlayAction : public KAction
{
Q_OBJECT
  TQ_OBJECT
public:
	PlayAction(TQObject *parent, const char *name);
private slots:
	void playing();
	void notplaying();
};

/**
 * An action starting/stopping noatun playback
 **/
class PlaylistAction : public KToggleAction
{
Q_OBJECT
  TQ_OBJECT
public:
	PlaylistAction(TQObject *parent, const char *name);
private slots:
	void shown();
	void hidden();
};

/**
 * actionmenu that holds all plugin defined actions
 * @author Stefan Gehn
 */
class PluginActionMenu : public KActionMenu
{
Q_OBJECT
  TQ_OBJECT
public:
	PluginActionMenu(TQObject *parent, const char *name);
	/**
	 * inserts the given @p action into the action-menu
	 * @param action the action to insert
	 * @param index defines the place where the action gets displayed in
	 */
	virtual void insert (KAction *action, int index=-1);
	/**
	 * removes the given @p action into the action-menu
	 */
	virtual void remove(KAction *action);
	/**
	 * Wrapper method for old Noatun API
	 * <b>DON'T USE</b>
	 **/
	int menuAdd(const TQString &text, const TQObject *receiver, const char *member);
	/**
	 * Wrapper method for old Noatun API
	 * <b>DON'T USE</b>
	 **/
	void menuRemove(int id);
private:
	int mCount;
};

/**
 * actionmenu that holds all vis-plugins for easier enabling/disabling
 * @author Stefan Gehn
 */
class VisActionMenu : public KActionMenu
{
Q_OBJECT
  TQ_OBJECT
public:
	VisActionMenu(TQObject *parent, const char *name);
private slots:
	void fillPopup();
	void toggleVisPlugin(int);
private:
	TQMap<int, TQString>mSpecMap;
};


/**
 * actionmenu that holds all looping modes
 * @author Stefan Gehn
 */
class LoopActionMenu : public KActionMenu
{
Q_OBJECT
  TQ_OBJECT
public:
	LoopActionMenu(TQObject *parent, const char *name);
private slots:
	void updateLooping(int);
	void loopNoneSelected();
	void loopSongSelected();
	void loopPlaylistSelected();
	void loopRandomSelected();
private:
	KRadioAction *mLoopNone;
	KRadioAction *mLoopSong;
	KRadioAction *mLoopPlaylist;
	KRadioAction *mLoopRandom;
};


/**
 * @return pointer to a KAction which opens the effects dialog on activation
 */
KDE_EXPORT KAction *effects(TQObject *parent = 0, const char *name = 0);

/**
 * @return pointer to a KAction which opens the equalizer dialog on activation
 */
KDE_EXPORT KAction *equalizer(TQObject *parent = 0, const char *name = 0);

/**
 * @return pointer to a KAction which goes back one track on activation
 */
KDE_EXPORT KAction *back(TQObject *parent = 0, const char *name = 0);
/**
 * @return pointer to a KAction which stops playback on activation
 */
KDE_EXPORT KAction *stop(TQObject *parent = 0, const char *name = 0);
/**
 * @return pointer to a KAction which starts/pauses playback on activation
 */
KDE_EXPORT KAction *playpause(TQObject *parent = 0, const char *name = 0);
/**
 * @return pointer to a KAction which advances one track on activation
 */
KDE_EXPORT KAction *forward(TQObject *parent = 0, const char *name = 0);
/**
 * @return pointer to a KToggleAction which shows/hides the playlist
 */
KDE_EXPORT KToggleAction *playlist(TQObject *parent = 0, const char *name = 0);

/**
 * loop action
 **/
KDE_EXPORT LoopActionMenu *loop(TQObject *parent, const char *name);

/**
 * play action
 */
KDE_EXPORT KAction *play(TQObject *parent = 0, const char *name = 0);

/**
 * pause action
 */
KDE_EXPORT KAction *pause(TQObject *parent = 0, const char *name = 0);

/**
 * @return pointer to the global PluginActionMenu object (there is only one instance)
 */
KDE_EXPORT PluginActionMenu *actions();

/**
 * @return pointer to a VisActionMenu object
 */
KDE_EXPORT VisActionMenu *visualizations(TQObject *parent = 0, const char *name = 0);

/**
 * The global popupmenu of noatun, there's not two or three but only one of these :)
 * @author Charles Samuels
 **/
class KDE_EXPORT ContextMenu
{
public:
	static KPopupMenu *createContextMenu(TQWidget *p);

	/**
	 * One menu to show them all, One menu to find them
	 * One menu to bring them all and in the darkness bind them
	 *
	 * In the land of Noatun where the oceans die
	 */
	static KPopupMenu *contextMenu();

	/**
	 * Show the context menu at point
	 **/
	static void showContextMenu(const TQPoint &);

	/**
	 * show the context menu at the mouse's current position
	 **/
	static void showContextMenu();
private:
	static KPopupMenu *mContextMenu;
};

}

#endif