]> git.sesse.net Git - vlc/blob - modules/gui/qt4/actions_manager.hpp
Always create a new object with the parent object
[vlc] / 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 QVLC_ACTIONS_MANAGER_H_
25 #define QVLC_ACTIONS_MANAGER_H_ 1
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     RANDOM_ACTION,
55     LOOP_ACTION,
56     INFO_ACTION,
57     OPEN_SUB_ACTION,
58 } actionType_e;
59
60 class ActionsManager : public QObject
61 {
62
63     Q_OBJECT
64 public:
65     static ActionsManager *getInstance( intf_thread_t *_p_intf, QObject *_parent = 0 )
66     {
67         if( !instance )
68             instance = new ActionsManager( _p_intf, _parent );
69         return instance;
70     }
71     static void killInstance()
72     {
73         delete instance;
74         instance = NULL;
75     }
76
77 private:
78     virtual ~ActionsManager();
79
80     static ActionsManager *instance;
81     ActionsManager( intf_thread_t  *_p_i, QObject *_parent );
82     intf_thread_t       *p_intf;
83
84 public slots:
85     void toggleMuteAudio();
86     void AudioUp();
87     void AudioDown();
88     void play();
89     void record();
90     void skipForward();
91     void skipBackward();
92 protected slots:
93     void fullscreen();
94     void snapshot();
95     void playlist();
96     void frame();
97
98     virtual void doAction( int );
99 };
100
101 #endif
102