]> git.sesse.net Git - vlc/blob - modules/gui/skins2/src/dialogs.hpp
* skins2/src/skin_main.cpp: New demux2 module to load automatically a skin.
[vlc] / modules / gui / skins2 / src / dialogs.hpp
1 /*****************************************************************************
2  * dialogs.hpp
3  *****************************************************************************
4  * Copyright (C) 2003 VideoLAN
5  * $Id: dialogs.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $
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 Quick Open File dialog.
47         /// If play is false, just add the item in the playlist
48         void showFileSimple( bool play );
49
50         /// Show the Open File dialog.
51         /// If play is false, just add the item in the playlist
52         void showFile( bool play );
53
54         /// Show the Open Disc dialog
55         /// If play is false, just add the item in the playlist
56         void showDisc( bool play );
57
58         /// Show the Open Network Stream dialog
59         /// If play is false, just add the item in the playlist
60         void showNet( bool play );
61
62         /// Show the Messages dialog
63         void showMessages();
64
65         /// Show the Preferences dialog
66         void showPrefs();
67
68         /// Show the FileInfo dialog
69         void showFileInfo();
70
71         /// Show the popup menu
72         void showPopupMenu( bool bShow );
73
74         // XXX: This is a kludge! In fact, the file name retrieved when
75         // changing the skin should be returned directly to the command, but
76         // the dialog provider mechanism doesn't allow it.
77         /// Store temporarily a file name
78         void setThemeFile( const string &themeFile ) { m_theme = themeFile; }
79         /// Get a previously saved file name
80         const string &getThemeFile() const { return m_theme; }
81
82     private:
83         // Private because it's a singleton
84         Dialogs( intf_thread_t *pIntf );
85         ~Dialogs();
86
87         /// Initialization method
88         bool init();
89
90         /// Dialogs provider module
91         intf_thread_t *m_pProvider;
92         module_t *m_pModule;
93
94         /// Name of a theme file, obtained via the ChangeSkin dialog
95         string m_theme;
96 };
97
98
99 #endif