Qt: menu, code simplification.
[vlc.git] / modules / gui / qt4 / actions_manager.hpp
1 /*****************************************************************************
2  * Controller.hpp : Controller for the main interface
3  ****************************************************************************
4  * Copyright (C) 2006-2008 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Jean-Baptiste Kempf <jb@videolan.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #ifndef _ACTIONS_MANAGER_H_
25 #define _ACTIONS_MANAGER_H_
26
27 #ifdef HAVE_CONFIG_H
28 # include "config.h"
29 #endif
30
31 #include "qt4.hpp"
32
33 #include <QObject>
34 typedef enum actionType_e
35 {
36     PLAY_ACTION,
37     STOP_ACTION,
38     OPEN_ACTION,
39     PREVIOUS_ACTION,
40     NEXT_ACTION,
41     SLOWER_ACTION,
42     FASTER_ACTION,
43     FULLSCREEN_ACTION,
44     EXTENDED_ACTION,
45     PLAYLIST_ACTION,
46     SNAPSHOT_ACTION,
47     RECORD_ACTION,
48     FRAME_ACTION,
49     ATOB_ACTION,
50     REVERSE_ACTION,
51     SKIP_BACK_ACTION,
52     SKIP_FW_ACTION,
53     QUIT_ACTION,
54 } actionType_e;
55
56 class ActionsManager : public QObject
57 {
58
59     Q_OBJECT
60 public:
61     static ActionsManager *getInstance( intf_thread_t *_p_intf, QObject *_parent = 0 )
62     {
63         if( !instance )
64             instance = new ActionsManager( _p_intf, _parent );
65         return instance;
66     }
67     static void killInstance()
68     {
69         if( instance ) delete instance;
70     }
71     virtual ~ActionsManager();
72
73 private:
74     static ActionsManager *instance;
75     ActionsManager( intf_thread_t  *_p_i, QObject *_parent );
76     intf_thread_t       *p_intf;
77
78 public slots:
79     void toggleMuteAudio();
80     void AudioUp();
81     void AudioDown();
82     void play();
83 protected slots:
84     void fullscreen();
85     void snapshot();
86     void playlist();
87     void record();
88     void frame();
89
90     virtual void doAction( int );
91 };
92
93 #endif
94