cmd_show_window.hpp 2.63 KB
Newer Older
1
2
3
4
/*****************************************************************************
 * cmd_show_window.hpp
 *****************************************************************************
 * Copyright (C) 2003 VideoLAN
5
 * $Id$
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 *
 * Authors: Cyril Deguet     <asmax@via.ecp.fr>
 *          Olivier Teulire <ipkiss@via.ecp.fr>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
 *****************************************************************************/

#ifndef CMD_SHOW_WINDOW_HPP
#define CMD_SHOW_WINDOW_HPP

#include "cmd_generic.hpp"
29
#include "../src/top_window.hpp"
30
#include "../src/window_manager.hpp"
31
32


33
34
35
36
/// Command to show a window
class CmdShowWindow: public CmdGeneric
{
    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
46
        /// Return the type of the command
        virtual string getType() const { return "show window"; }
47

48
    private:
49
50
        /// Reference to the window manager
        WindowManager &m_rWinManager;
51
        /// Reference to the window
52
        TopWindow &m_rWin;
53
54
55
56
57
};


/// Command to hide a window
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
73
        /// Reference to the window manager
        WindowManager &m_rWinManager;
74
        /// Reference to the window
75
        TopWindow &m_rWin;
76
77
};

78

79
#endif