]> git.sesse.net Git - vlc/blob - modules/gui/skins2/src/dialogs.hpp
cf6fda5033f37fe0362d7054fd04dbdefb403c22
[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
37         /// Returns NULL if initialization failed
38         static Dialogs *instance( intf_thread_t *pIntf );
39
40         /// Delete the instance of Dialogs
41         static void destroy( intf_thread_t *pIntf );
42
43         /// Show the Change Skin dialog
44         void showChangeSkin();
45
46         /// Show the Load Playlist dialog
47         void showPlaylistLoad();
48
49         /// Show the Save Playlist dialog
50         void showPlaylistSave();
51
52         /// Show the Quick Open File dialog.
53         /// If play is false, just add the item in the playlist
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         void showFile( bool play );
59
60         /// Show the Open Disc dialog
61         /// If play is false, just add the item in the playlist
62         void showDisc( bool play );
63
64         /// Show the Open Network Stream dialog
65         /// If play is false, just add the item in the playlist
66         void showNet( bool play );
67
68         /// Show the Messages dialog
69         void showMessages();
70
71         /// Show the Preferences dialog
72         void showPrefs();
73
74         /// Show the FileInfo dialog
75         void showFileInfo();
76
77         /// Show the popup menu
78         void showPopupMenu( bool bShow );
79
80     private:
81         // Private because it's a singleton
82         Dialogs( intf_thread_t *pIntf );
83         ~Dialogs();
84
85         /// DlgCallback is the type of the callbacks of the open/save dialog
86         typedef void DlgCallback( intf_dialog_args_t *pArg );
87
88         /// Possible flags for the open/save dialog
89         typedef enum
90         {
91             kOPEN     = 0x01,
92             kSAVE     = 0x02,
93             kMULTIPLE = 0x04
94         } flags_t;
95
96         /// Initialization method
97         bool init();
98
99         /// Show a generic open/save dialog, initialized with the given
100         /// parameters
101         /// The 'flags' parameter is a logical or of the flags_t values
102         void showFileGeneric( const string &rTitle, const string &rExtensions,
103                               DlgCallback callback, int flags );
104
105         /// Callback for the Change Skin dialog
106         static void showChangeSkinCB( intf_dialog_args_t *pArg );
107
108         /// Callback for the Load Playlist dialog
109         static void showPlaylistLoadCB( intf_dialog_args_t *pArg );
110
111         /// Callback for the Save Playlist dialog
112         static void showPlaylistSaveCB( intf_dialog_args_t *pArg );
113
114         /// Dialogs provider module
115         intf_thread_t *m_pProvider;
116         module_t *m_pModule;
117 };
118
119
120 #endif