]> git.sesse.net Git - vlc/blob - modules/gui/skins2/commands/cmd_show_window.hpp
8d34f36db7e2e403a6c4a8ac75eacfff72b1aaca
[vlc] / modules / gui / skins2 / commands / cmd_show_window.hpp
1 /*****************************************************************************
2  * cmd_show_window.hpp
3  *****************************************************************************
4  * Copyright (C) 2003 VideoLAN
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 CMD_SHOW_WINDOW_HPP
26 #define CMD_SHOW_WINDOW_HPP
27
28 #include "cmd_generic.hpp"
29 #include "../src/top_window.hpp"
30 #include "../src/window_manager.hpp"
31
32
33 /// Command to show a window
34 class CmdShowWindow: public CmdGeneric
35 {
36     public:
37         CmdShowWindow( intf_thread_t *pIntf, WindowManager &rWinManager,
38                        TopWindow &rWin ):
39             CmdGeneric( pIntf ), m_rWinManager( rWinManager ), m_rWin( rWin ) {}
40         virtual ~CmdShowWindow() {}
41
42         /// This method does the real job of the command
43         virtual void execute() { m_rWinManager.show( m_rWin ); }
44
45         /// Return the type of the command
46         virtual string getType() const { return "show window"; }
47
48     private:
49         /// Reference to the window manager
50         WindowManager &m_rWinManager;
51         /// Reference to the window
52         TopWindow &m_rWin;
53 };
54
55
56 /// Command to hide a window
57 class CmdHideWindow: public CmdGeneric
58 {
59     public:
60         CmdHideWindow( intf_thread_t *pIntf, WindowManager &rWinManager,
61                        TopWindow &rWin ):
62             CmdGeneric( pIntf ), m_rWinManager( rWinManager ), m_rWin( rWin ) {}
63         virtual ~CmdHideWindow() {}
64
65         /// This method does the real job of the command
66         virtual void execute() { m_rWinManager.hide( m_rWin ); }
67
68         /// Return the type of the command
69         virtual string getType() const { return "hide window"; }
70
71     private:
72         /// Reference to the window manager
73         WindowManager &m_rWinManager;
74         /// Reference to the window
75         TopWindow &m_rWin;
76 };
77
78
79 /// Command to raise all windows
80 class CmdRaiseAll: public CmdGeneric
81 {
82     public:
83         CmdRaiseAll( intf_thread_t *pIntf, WindowManager &rWinManager ):
84             CmdGeneric( pIntf ), m_rWinManager( rWinManager ) {}
85         virtual ~CmdRaiseAll() {}
86
87         /// This method does the real job of the command
88         virtual void execute() { m_rWinManager.raiseAll(); }
89
90         /// Return the type of the command
91         virtual string getType() const { return "raise all windows"; }
92
93     private:
94         /// Reference to the window manager
95         WindowManager &m_rWinManager;
96 };
97
98 #endif