forked from videolan/vlc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdialogs_provider.hpp
200 lines (169 loc) · 5.39 KB
/
dialogs_provider.hpp
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
/*****************************************************************************
* dialogs_provider.hpp : Dialogs provider
****************************************************************************
* Copyright (C) 2006-2008 the VideoLAN team
* $Id$
*
* Authors: Clément Stenac <[email protected]>
* Jean-Baptiste Kempf <[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 QVLC_DIALOGS_PROVIDER_H_
#define QVLC_DIALOGS_PROVIDER_H_
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include "qt4.hpp"
#include "dialogs/open.hpp"
#include <QObject>
#include <QStringList>
#define TITLE_EXTENSIONS_MEDIA qtr( "Media Files" )
#define TITLE_EXTENSIONS_VIDEO qtr( "Video Files" )
#define TITLE_EXTENSIONS_AUDIO qtr( "Audio Files" )
#define TITLE_EXTENSIONS_PLAYLIST qtr( "Playlist Files" )
#define TITLE_EXTENSIONS_SUBTITLE qtr( "Subtitle Files" )
#define TITLE_EXTENSIONS_ALL qtr( "All Files" )
#define EXTENSIONS_ALL "*"
#define ADD_EXT_FILTER( string, type ) \
string = string + QString("%1 ( %2 );;") \
.arg( TITLE_##type ) \
.arg( QString( type ) );
enum {
EXT_FILTER_MEDIA = 0x01,
EXT_FILTER_VIDEO = 0x02,
EXT_FILTER_AUDIO = 0x04,
EXT_FILTER_PLAYLIST = 0x08,
EXT_FILTER_SUBTITLE = 0x10,
};
class QEvent;
class QSignalMapper;
class VLCMenuBar;
class DialogsProvider : public QObject
{
Q_OBJECT
friend class VLCMenuBar;
public:
static DialogsProvider *getInstance()
{
assert( instance );
return instance;
}
static DialogsProvider *getInstance( intf_thread_t *p_intf )
{
if( !instance )
instance = new DialogsProvider( p_intf );
return instance;
}
static void killInstance()
{
delete instance;
instance = NULL;
}
QStringList showSimpleOpen( const QString& help = QString(),
int filters = EXT_FILTER_MEDIA |
EXT_FILTER_VIDEO | EXT_FILTER_AUDIO |
EXT_FILTER_PLAYLIST,
const QString& path = QString() );
bool isDying() { return b_isDying; }
static QString getDirectoryDialog( intf_thread_t *p_intf);
protected:
QSignalMapper *menusMapper;
QSignalMapper *menusUpdateMapper;
QSignalMapper *SDMapper;
void customEvent( QEvent *);
private:
DialogsProvider( intf_thread_t *);
virtual ~DialogsProvider();
static DialogsProvider *instance;
intf_thread_t *p_intf;
QMenu* popupMenu;
QMenu* videoPopupMenu;
QMenu* audioPopupMenu;
QMenu* miscPopupMenu;
QWidget* root;
bool b_isDying;
void openDialog( int );
void addFromSimple( bool, bool );
void saveAPlaylist(playlist_t *p_playlist, playlist_item_t *p_node);
public slots:
void playlistDialog();
void bookmarksDialog();
void mediaInfoDialog();
void mediaCodecDialog();
void prefsDialog();
void extendedDialog();
void synchroDialog();
void messagesDialog();
void sendKey( int key );
#ifdef ENABLE_VLM
void vlmDialog();
#endif
void helpDialog();
#ifdef UPDATE_CHECK
void updateDialog();
#endif
void aboutDialog();
void gotoTimeDialog();
void podcastConfigureDialog();
void toolbarDialog();
void pluginDialog();
void epgDialog();
void setPopupMenu();
void destroyPopupMenu();
void openFileGenericDialog( intf_dialog_args_t * );
void simpleOpenDialog();
void openDialog();
void openDiscDialog();
void openFileDialog();
void openUrlDialog();
void openNetDialog();
void openCaptureDialog();
void PLAppendDialog( int tab = OPEN_FILE_TAB );
void MLAppendDialog( int tab = OPEN_FILE_TAB );
void PLOpenDir();
void PLAppendDir();
void streamingDialog( QWidget *parent, const QStringList& mrls, bool b_stream = true,
QStringList options = QStringList("") );
void openAndStreamingDialogs();
void openAndTranscodingDialogs();
void openAPlaylist();
void savePlayingToPlaylist();
void saveRecentsToPlaylist();
void loadSubtitlesFile();
void quit();
private slots:
void menuAction( QObject *);
void menuUpdateAction( QObject * );
void SDMenuAction( const QString& );
signals:
void toolBarConfUpdated();
};
class DialogEvent : public QEvent
{
public:
static const QEvent::Type DialogEvent_Type;
DialogEvent( int _i_dialog, int _i_arg, intf_dialog_args_t *_p_arg ) :
QEvent( DialogEvent_Type )
{
i_dialog = _i_dialog;
i_arg = _i_arg;
p_arg = _p_arg;
}
int i_arg, i_dialog;
intf_dialog_args_t *p_arg;
};
#endif