summaryrefslogtreecommitdiffstats
path: root/arts/tools/artsactions.h
blob: 15a19f64d211e4919e0cc1165896be8b2a70390a (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
/*

    Copyright (C) 2003 Arnold Krille <[email protected]>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

    */

#ifndef ARTS_ACTIONS_H
#define ARTS_ACTIONS_H

#include <qwidget.h>
#include <kdelibs_export.h>
class KArtsServer;
class KAction;
class KActionCollection;
class KPopupMenu;
class FFTScopeView;
class Gui_AUDIO_MANAGER;
class ArtsStatusView;
class MidiManagerView;
class EnvironmentView;
class MediaTypesView;

class KDE_EXPORT ArtsActions : public QObject
{
	Q_OBJECT
public:
	/**
		Constructs a ArtsActions-object.

		Use the KActions you get from it to obtain a unique Style for all menus.

		It also provides an easy way to have FFT-ScopeView, Audiomanager and other things available.

		@param artsserver a pointer to a existing KArtsServer. If 0 a new is created.
		@param actioncollection the KActionCollection all the actions should belong to. Names of the actions are then: artssupport_*
		@param qwidget the parent QWidget
		@param name the name of the object
	*/
	ArtsActions( KArtsServer* artsserver, KActionCollection* actioncollection, QWidget* qwidget, const char* name=0 );
	/** Destructor */
	~ArtsActions();

	/** Returns an Action for showing the ScopeView. Unless otherwise connected it also toggles a ScopeView.  */
	KAction* actionScopeView();
	/** Returns an Action for showing the Audiomanager. Unless otherwise connected it also toggles a Audiomanager.  */
	KAction* actionAudioManager();
	/** Returns an Action for showing the StatusView. Unless otherwise connected it also toggles a StatusView.  */
	KAction* actionArtsStatusView();
	/** Returns an Action for showing the MidiManager. Unless otherwise connected it also toggles a MidiManager.  */
	KAction* actionMidiManagerView();
	/** Returns an Action for showing the EnvironmentView. Unless otherwise connected it also toggles a EnvironmentView.  */
	KAction* actionEnvironmentView();
	/** Returns an Action for showing the MediaTypesView. Unless otherwise connected it also toggles a MediaTypesView.  */
	KAction* actionMediaTypesView();

	KAction* actionStyleNormal();
	KAction* actionStyleFire();
	KAction* actionStyleLine();
	KAction* actionStyleLED();
	KAction* actionStyleAnalog();
	KAction* actionStyleSmall();
	KPopupMenu* stylemenu();

	static KAction* actionMoreBars( const QObject*, const char*, KActionCollection* );
	static KAction* actionLessBars( const QObject*, const char*, KActionCollection* );

public slots:
	void viewScopeView();
	void viewAudioManager();
	void viewArtsStatusView();
	void viewMidiManagerView();
	void viewEnvironmentView();
	void viewMediaTypesView();
private slots:
	void _p_style_normal() { emit styleNormal(); }
	void _p_style_fire() { emit styleFire(); }
	void _p_style_line() { emit styleLine(); }
	void _p_style_led() { emit styleLED(); }
	void _p_style_analog() { emit styleAnalog(); }
	void _p_style_small() { emit styleSmall(); }
signals:
	void styleNormal();
	void styleFire();
	void styleLine();
	void styleLED();
	void styleAnalog();
	void styleSmall();
private:
	KArtsServer* _kartsserver;
	KActionCollection* _actioncollection;
	KAction *_a_sv, *_a_am, *_a_asv, *_a_mmv, *_a_ev, *_a_mtv;
	//KAction *_a_morebars, *_a_lessbars;
	KAction *_a_style_normal, *_a_style_fire, *_a_style_line, *_a_style_led, *_a_style_analog, *_a_style_small;
	KPopupMenu* _stylemenu;
	FFTScopeView *_sv;
	Gui_AUDIO_MANAGER *_am;
	ArtsStatusView *_asv;
	MidiManagerView *_mmv;
	EnvironmentView *_ev;
	MediaTypesView *_mtv;
};

#endif