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., 59 Temple Place - Suite 330, Boston, MA 02111, 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"
33 template<int TYPE = 0> class CmdDialogs;
35 // XXX use an enum instead
36 typedef CmdDialogs<1> CmdDlgChangeSkin;
37 typedef CmdDialogs<2> CmdDlgFileSimple;
38 typedef CmdDialogs<3> CmdDlgFile;
39 typedef CmdDialogs<4> CmdDlgDisc;
40 typedef CmdDialogs<5> CmdDlgNet;
41 typedef CmdDialogs<6> CmdDlgMessages;
42 typedef CmdDialogs<7> CmdDlgPrefs;
43 typedef CmdDialogs<8> CmdDlgFileInfo;
44 typedef CmdDialogs<9> CmdDlgShowPopupMenu;
45 typedef CmdDialogs<10> CmdDlgHidePopupMenu;
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;
53 /// Generic "Open dialog" command
55 class CmdDialogs: public CmdGeneric
58 CmdDialogs( intf_thread_t *pIntf ): CmdGeneric( pIntf ) {}
59 virtual ~CmdDialogs() {}
61 /// This method does the real job of the command
62 virtual void execute()
64 /// Get the dialogs provider
65 Dialogs *pDialogs = Dialogs::instance( getIntf() );
66 if( pDialogs == NULL )
74 pDialogs->showChangeSkin();
77 pDialogs->showFileSimple( true );
80 pDialogs->showFile( true );
83 pDialogs->showDisc( true );
86 pDialogs->showNet( true );
89 pDialogs->showMessages();
92 pDialogs->showPrefs();
95 pDialogs->showFileInfo();
98 pDialogs->showPopupMenu( true );
101 pDialogs->showPopupMenu( false );
104 pDialogs->showFile( false );
107 pDialogs->showPlaylistLoad();
110 pDialogs->showPlaylistSave();
113 pDialogs->showDirectory( true );
116 pDialogs->showStreamingWizard();
119 msg_Warn( getIntf(), "Unknown dialog type" );
124 /// Return the type of the command
125 virtual string getType() const { return "dialog"; }