1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright (C) 2003 the VideoLAN team
7 * Authors: Cyril Deguet <asmax@via.ecp.fr>
8 * Olivier Teulière <ipkiss@via.ecp.fr>
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.
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.
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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 #ifndef CMD_DIALOGS_HPP
26 #define CMD_DIALOGS_HPP
28 #include "cmd_generic.hpp"
29 #include "../src/dialogs.hpp"
30 #include "cmd_change_skin.hpp"
32 #include <vlc_interface.h>
34 template<int TYPE = 0> class CmdDialogs;
36 // XXX use an enum instead
37 typedef CmdDialogs<1> CmdDlgChangeSkin;
38 typedef CmdDialogs<2> CmdDlgFileSimple;
39 typedef CmdDialogs<3> CmdDlgFile;
40 typedef CmdDialogs<4> CmdDlgDisc;
41 typedef CmdDialogs<5> CmdDlgNet;
42 typedef CmdDialogs<6> CmdDlgMessages;
43 typedef CmdDialogs<7> CmdDlgPrefs;
44 typedef CmdDialogs<8> CmdDlgFileInfo;
46 typedef CmdDialogs<11> CmdDlgAdd;
47 typedef CmdDialogs<12> CmdDlgPlaylistLoad;
48 typedef CmdDialogs<13> CmdDlgPlaylistSave;
49 typedef CmdDialogs<14> CmdDlgDirectory;
50 typedef CmdDialogs<15> CmdDlgStreamingWizard;
51 typedef CmdDialogs<16> CmdDlgPlaytreeLoad;
52 typedef CmdDialogs<17> CmdDlgPlaytreeSave;
53 typedef CmdDialogs<18> CmdDlgPlaylist;
55 typedef CmdDialogs<30> CmdDlgShowPopupMenu;
56 typedef CmdDialogs<31> CmdDlgHidePopupMenu;
57 typedef CmdDialogs<32> CmdDlgShowAudioPopupMenu;
58 typedef CmdDialogs<33> CmdDlgHideAudioPopupMenu;
59 typedef CmdDialogs<34> CmdDlgShowVideoPopupMenu;
60 typedef CmdDialogs<35> CmdDlgHideVideoPopupMenu;
61 typedef CmdDialogs<36> CmdDlgShowMiscPopupMenu;
62 typedef CmdDialogs<37> CmdDlgHideMiscPopupMenu;
65 /// Generic "Open dialog" command
67 class CmdDialogs: public CmdGeneric
70 CmdDialogs( intf_thread_t *pIntf ): CmdGeneric( pIntf ) {}
71 virtual ~CmdDialogs() {}
73 /// This method does the real job of the command
74 virtual void execute()
76 /// Get the dialogs provider
77 Dialogs *pDialogs = Dialogs::instance( getIntf() );
78 if( pDialogs == NULL )
86 pDialogs->showChangeSkin();
89 pDialogs->showFileSimple( true );
92 pDialogs->showFile( true );
95 pDialogs->showDisc( true );
98 pDialogs->showNet( true );
101 pDialogs->showMessages();
104 pDialogs->showPrefs();
107 pDialogs->showFileInfo();
110 pDialogs->showFile( false );
113 pDialogs->showPlaylistLoad();
116 pDialogs->showPlaylistSave();
119 pDialogs->showDirectory( true );
122 pDialogs->showStreamingWizard();
125 pDialogs->showPlaylist();
128 pDialogs->showPopupMenu( true, INTF_DIALOG_POPUPMENU );
131 pDialogs->showPopupMenu( false, INTF_DIALOG_POPUPMENU );
134 pDialogs->showPopupMenu( true, INTF_DIALOG_AUDIOPOPUPMENU );
137 pDialogs->showPopupMenu( false,INTF_DIALOG_AUDIOPOPUPMENU );
140 pDialogs->showPopupMenu( true, INTF_DIALOG_VIDEOPOPUPMENU );
143 pDialogs->showPopupMenu( false,INTF_DIALOG_VIDEOPOPUPMENU );
146 pDialogs->showPopupMenu( true, INTF_DIALOG_MISCPOPUPMENU );
149 pDialogs->showPopupMenu( false,INTF_DIALOG_MISCPOPUPMENU );
152 msg_Warn( getIntf(), "unknown dialog type" );
157 /// Return the type of the command
158 virtual string getType() const { return "dialog"; }
161 class CmdInteraction: public CmdGeneric
164 CmdInteraction( intf_thread_t *pIntf, interaction_dialog_t *
165 p_dialog ): CmdGeneric( pIntf ), m_pDialog( p_dialog )
167 virtual ~CmdInteraction() {}
169 /// This method does the real job of the command
170 virtual void execute()
172 /// Get the dialogs provider
173 Dialogs *pDialogs = Dialogs::instance( getIntf() );
174 if( pDialogs == NULL )
178 pDialogs->showInteraction( m_pDialog );
181 virtual string getType() const { return "interaction"; }
183 interaction_dialog_t *m_pDialog;