]> git.sesse.net Git - vlc/blob - modules/gui/qt4/actions_manager.hpp
Qt: actions_manager: Change constructor and inline some functions.
[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 _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 } actionType_e;
54
55 class ActionsManager : public QObject
56 {
57
58     Q_OBJECT
59 public:
60     static ActionsManager *getInstance( intf_thread_t *_p_intf, QObject *_parent = 0 )
61     {
62         if( !instance )
63             instance = new ActionsManager( _p_intf, _parent );
64         return instance;
65     }
66     static void killInstance()
67     {
68         if( instance ) delete instance;
69     }
70     virtual ~ActionsManager();
71
72 private:
73     static ActionsManager *instance;
74     ActionsManager( intf_thread_t  *_p_i, QObject *_parent );
75     intf_thread_t       *p_intf;
76
77 protected slots:
78     virtual void doAction( int );
79
80 protected slots:
81     void play();
82     void stop();
83     void prev();
84     void next();
85     void fullscreen();
86     void extSettings();
87     void faster();
88     void slower();
89     void reverse();
90     void playlist();
91     void snapshot();
92     void record();
93     void frame();
94
95 };
96
97 #endif
98