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

Last change on this file since 112 was 112, checked in by Silvan Scherrer, 15 years ago

Smplayer: eol-style

  • Property svn:eol-style set to LF
File size: 3.2 KB
Line 
1/* smplayer, GUI front-end for mplayer.
2 Copyright (C) 2006-2010 Ricardo Villalba <rvm@escomposlinux.org>
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
82protected:
83 virtual QWidget * createWidget ( QWidget * parent );
84};
85
86
87class VolumeSliderAction : public MyWidgetAction
88{
89 Q_OBJECT
90
91public:
92 VolumeSliderAction( QWidget * parent );
93 ~VolumeSliderAction();
94
95 void setFixedSize(QSize size) { fixed_size = size; };
96 QSize fixedSize() { return fixed_size; };
97
98 void setTickPosition(QSlider::TickPosition position);
99 QSlider::TickPosition tickPosition() { return tick_position; };
100
101public slots:
102 virtual void setValue(int);
103 virtual int value();
104
105signals:
106 void valueChanged(int value);
107
108protected:
109 virtual QWidget * createWidget ( QWidget * parent );
110
111private:
112 QSize fixed_size;
113 QSlider::TickPosition tick_position;
114};
115
116
117class TimeLabelAction : public MyWidgetAction
118{
119 Q_OBJECT
120
121public:
122 TimeLabelAction( QWidget * parent );
123 ~TimeLabelAction();
124
125 virtual QString text() { return _text; };
126
127public slots:
128 virtual void setText(QString s);
129
130signals:
131 void newText(QString s);
132
133protected:
134 virtual QWidget * createWidget ( QWidget * parent );
135
136private:
137 QString _text;
138};
139
140
141#if MINI_ARROW_BUTTONS
142class SeekingButton : public QWidgetAction
143{
144 Q_OBJECT
145
146public:
147 SeekingButton( QList<QAction*> actions, QWidget * parent );
148 ~SeekingButton();
149
150protected:
151 virtual QWidget * createWidget ( QWidget * parent );
152
153 QList<QAction*> _actions;
154};
155#endif
156
157#endif
158
Note: See TracBrowser for help on using the repository browser.