]> git.sesse.net Git - vlc/blob - modules/gui/skins2/src/dialogs.hpp
* wxwidgets/menus.cpp: Added "Open Directory" in the wx popup menu
[vlc] / modules / gui / skins2 / src / dialogs.hpp
1 /*****************************************************************************
2  * dialogs.hpp
3  *****************************************************************************
4  * Copyright (C) 2003 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
8  *          Olivier Teulière <ipkiss@via.ecp.fr>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
23  *****************************************************************************/
24
25 #ifndef DIALOGS_HPP
26 #define DIALOGS_HPP
27
28 #include "skin_common.hpp"
29 #include <string>
30
31
32 // Dialogs provider
33 class Dialogs: public SkinObject
34 {
35     public:
36         /// Get the instance of Dialogs (or NULL if initialization failed)
37         static Dialogs *instance( intf_thread_t *pIntf );
38
39         /// Delete the instance of Dialogs
40         static void destroy( intf_thread_t *pIntf );
41
42         /// Show the Change Skin dialog
43         void showChangeSkin();
44
45         /// Show the Load Playlist dialog
46         void showPlaylistLoad();
47
48         /// Show the Save Playlist dialog
49         void showPlaylistSave();
50
51         /** Show the Quick Open File dialog.
52          *  If play is false, just add the item in the playlist
53          */
54         void showFileSimple( bool play );
55
56         /** Show the Open File dialog
57          *  If play is false, just add the item in the playlist
58          */
59         void showFile( bool play );
60
61         /** Show the Open Directory dialog
62          *  If play is false, just add the item in the playlist
63          */
64         void showDirectory( bool play );
65
66         /** Show the Open Disc dialog
67          *  If play is false, just add the item in the playlist
68          */
69         void showDisc( bool play );
70
71         /** Show the Open Network Stream dialog
72          *  If play is false, just add the item in the playlist
73          */
74         void showNet( bool play );
75
76         /// Show the Messages dialog
77         void showMessages();
78
79         /// Show the Preferences dialog
80         void showPrefs();
81
82         /// Show the FileInfo dialog
83         void showFileInfo();
84
85         /// Show the Streaming Wizard dialog
86         void showStreamingWizard();
87
88         /// Show the popup menu
89         void showPopupMenu( bool bShow );
90
91     private:
92         // Private because it's a singleton
93         Dialogs( intf_thread_t *pIntf );
94         ~Dialogs();
95
96         /// DlgCallback is the type of the callbacks of the open/save dialog
97         typedef void DlgCallback( intf_dialog_args_t *pArg );
98
99         /// Possible flags for the open/save dialog
100         typedef enum
101         {
102             kOPEN     = 0x01,
103             kSAVE     = 0x02,
104             kMULTIPLE = 0x04
105         } flags_t;
106
107         /// Initialization method
108         bool init();
109
110         /** Show a generic open/save dialog, initialized with the given
111          *  parameters
112          *  The 'flags' parameter is a logical or of the flags_t values
113          */
114         void showFileGeneric( const string &rTitle, const string &rExtensions,
115                               DlgCallback callback, int flags );
116
117         /// Callback for the Change Skin dialog
118         static void showChangeSkinCB( intf_dialog_args_t *pArg );
119
120         /// Callback for the Load Playlist dialog
121         static void showPlaylistLoadCB( intf_dialog_args_t *pArg );
122
123         /// Callback for the Save Playlist dialog
124         static void showPlaylistSaveCB( intf_dialog_args_t *pArg );
125
126         /// Dialogs provider module
127         intf_thread_t *m_pProvider;
128         module_t *m_pModule;
129 };
130
131
132 #endif