]> git.sesse.net Git - vlc/blob - modules/gui/skins/controls/button.h
* fixed refresh of the playlist (and a segfault...)
[vlc] / modules / gui / skins / controls / button.h
1 /*****************************************************************************
2  * button.h: Button control
3  *****************************************************************************
4  * Copyright (C) 2003 VideoLAN
5  * $Id: button.h,v 1.2 2003/03/19 02:09:56 videolan Exp $
6  *
7  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
8  *          Emmanuel Puig    <karibu@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,
23  * USA.
24  *****************************************************************************/
25
26
27 #ifndef VLC_SKIN_CONTROL_BUTTON
28 #define VLC_SKIN_CONTROL_BUTTON
29
30 //--- GENERAL ---------------------------------------------------------------
31 #include <string>
32 using namespace std;
33
34 //---------------------------------------------------------------------------
35 class Action;
36 class Graphics;
37 class Window;
38
39 //---------------------------------------------------------------------------
40 class ControlButton : public GenericControl
41 {
42     private:
43         // Image IDs
44         string      Up;
45         string      Down;
46         string      Disabled;
47
48         // Control behaviour
49         bool        Selected;
50         bool        Enabled;
51         bool        CursorIn;
52
53         // List of actions to execute
54         Action     *ClickAction;
55         string      ClickActionName;
56         Action     *MouseOverAction;
57         string      MouseOverActionName;
58         Action     *MouseOutAction;
59         string      MouseOutActionName;
60
61         // ToolTip text
62         string      ToolTipText;
63
64     public:
65         // Constructor
66         ControlButton( string id,
67                        bool visible,
68                        int x, int y,
69                        string Up, string Down, string Disabled,
70                        string onclick, string onmousevoer, string onmouseout,
71                        string tooltiptext, string help,
72                        Window *Parent );
73
74         // Destructor
75         virtual ~ControlButton();
76
77         // Initializations
78         virtual void Init();
79         virtual bool ProcessEvent( Event *evt );
80
81         // Draw button
82         virtual void Draw( int x1, int y1, int x2, int y2, Graphics *dest );
83
84         // Mouse events
85         virtual bool MouseUp( int x, int y, int button );
86         virtual bool MouseDown( int x, int y, int button );
87         virtual bool MouseMove( int x, int y, int button );
88         virtual bool MouseOver( int x, int y );
89         virtual bool ToolTipTest( int x, int y );
90
91         // Translate control
92         virtual void MoveRelative( int xOff, int yOff );
93
94         // Enabling control
95         virtual void Enable( Event *event, bool enabled );
96 };
97 //---------------------------------------------------------------------------
98
99 #endif