source: smplayer/trunk/src/widgetactions.h@ 170

Last change on this file since 170 was 170, checked in by Silvan Scherrer, 11 years ago

SMPlayer: updated trunk to 14.9.0

  • Property svn:eol-style set to LF
File size: 3.3 KB
Line 
1/* smplayer, GUI front-end for mplayer.
2 Copyright (C) 2006-2014 Ricardo Villalba <rvm@users.sourceforge.net>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17*/
18
19#ifndef _WIDGETACTIONS_H_
20#define _WIDGETACTIONS_H_
21
22#include <QWidgetAction>
23#include "timeslider.h"
24#include "config.h"
25#include "guiconfig.h"
26
27class QStyle;
28
29class MyWidgetAction : public QWidgetAction
30{
31 Q_OBJECT
32
33public:
34 MyWidgetAction( QWidget * parent );
35 ~MyWidgetAction();
36
37 void setCustomStyle(QStyle * style) { custom_style = style; };
38 QStyle * customStyle() { return custom_style; };
39
40 void setStyleSheet(QString style) { custom_stylesheet = style; };
41 QString styleSheet() { return custom_stylesheet; };
42
43public slots:
44 virtual void enable(); // setEnabled in QAction is not virtual :(
45 virtual void disable();
46
47protected:
48 virtual void propagate_enabled(bool);
49
50protected:
51 QStyle * custom_style;
52 QString custom_stylesheet;
53};
54
55
56class TimeSliderAction : public MyWidgetAction
57{
58 Q_OBJECT
59
60public:
61 TimeSliderAction( QWidget * parent );
62 ~TimeSliderAction();
63
64public slots:
65 virtual void setPos(int);
66 virtual int pos();
67#if ENABLE_DELAYED_DRAGGING
68 void setDragDelay(int);
69 int dragDelay();
70
71private:
72 int drag_delay;
73#endif
74
75signals:
76 void posChanged(int value);
77 void draggingPos(int value);
78#if ENABLE_DELAYED_DRAGGING
79 void delayedDraggingPos(int);
80#endif
81 void wheelUp();
82 void wheelDown();
83
84protected:
85 virtual QWidget * createWidget ( QWidget * parent );
86};
87
88
89class VolumeSliderAction : public MyWidgetAction
90{
91 Q_OBJECT
92
93public:
94 VolumeSliderAction( QWidget * parent );
95 ~VolumeSliderAction();
96
97 void setFixedSize(QSize size) { fixed_size = size; };
98 QSize fixedSize() { return fixed_size; };
99
100 void setTickPosition(QSlider::TickPosition position);
101 QSlider::TickPosition tickPosition() { return tick_position; };
102
103public slots:
104 virtual void setValue(int);
105 virtual int value();
106
107signals:
108 void valueChanged(int value);
109
110protected:
111 virtual QWidget * createWidget ( QWidget * parent );
112
113private:
114 QSize fixed_size;
115 QSlider::TickPosition tick_position;
116};
117
118
119class TimeLabelAction : public MyWidgetAction
120{
121 Q_OBJECT
122
123public:
124 TimeLabelAction( QWidget * parent );
125 ~TimeLabelAction();
126
127 virtual QString text() { return _text; };
128
129public slots:
130 virtual void setText(QString s);
131
132signals:
133 void newText(QString s);
134
135protected:
136 virtual QWidget * createWidget ( QWidget * parent );
137
138private:
139 QString _text;
140};
141
142
143#if MINI_ARROW_BUTTONS
144class SeekingButton : public QWidgetAction
145{
146 Q_OBJECT
147
148public:
149 SeekingButton( QList<QAction*> actions, QWidget * parent );
150 ~SeekingButton();
151
152protected:
153 virtual QWidget * createWidget ( QWidget * parent );
154
155 QList<QAction*> _actions;
156};
157#endif
158
159#endif
160
Note: See TracBrowser for help on using the repository browser.