1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox frontends: Qt GUI ("VirtualBox"):
|
---|
4 | * VirtualBox Qt extensions: QIAdvancedSlider class implementation
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2009-2010 Oracle Corporation
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | */
|
---|
18 |
|
---|
19 | #ifndef __QIAdvancedSlider_h__
|
---|
20 | #define __QIAdvancedSlider_h__
|
---|
21 |
|
---|
22 | /* Qt includes */
|
---|
23 | #include <QSlider>
|
---|
24 |
|
---|
25 | class CPrivateSlider;
|
---|
26 |
|
---|
27 | class QIAdvancedSlider: public QWidget
|
---|
28 | {
|
---|
29 | Q_OBJECT;
|
---|
30 | Q_PROPERTY(int value READ value WRITE setValue);
|
---|
31 |
|
---|
32 | public:
|
---|
33 | QIAdvancedSlider(QWidget *pParent = 0);
|
---|
34 | QIAdvancedSlider(Qt::Orientation fOrientation, QWidget *pParent = 0);
|
---|
35 |
|
---|
36 | int value() const;
|
---|
37 |
|
---|
38 | void setRange(int minV, int maxV);
|
---|
39 |
|
---|
40 | void setMaximum(int val);
|
---|
41 | int maximum() const;
|
---|
42 |
|
---|
43 | void setMinimum(int val);
|
---|
44 | int minimum() const;
|
---|
45 |
|
---|
46 | void setPageStep(int val);
|
---|
47 | int pageStep() const;
|
---|
48 |
|
---|
49 | void setSingleStep(int val);
|
---|
50 | int singelStep() const;
|
---|
51 |
|
---|
52 | void setTickInterval(int val);
|
---|
53 | int tickInterval() const;
|
---|
54 |
|
---|
55 | void setTickPosition(QSlider::TickPosition fPos);
|
---|
56 | QSlider::TickPosition tickPosition() const;
|
---|
57 |
|
---|
58 | Qt::Orientation orientation() const;
|
---|
59 |
|
---|
60 | void setSnappingEnabled(bool fOn);
|
---|
61 | bool isSnappingEnabled() const;
|
---|
62 |
|
---|
63 | void setOptimalHint(int min, int max);
|
---|
64 | void setWarningHint(int min, int max);
|
---|
65 | void setErrorHint(int min, int max);
|
---|
66 |
|
---|
67 | public slots:
|
---|
68 |
|
---|
69 | void setOrientation(Qt::Orientation fOrientation);
|
---|
70 | void setValue(int val);
|
---|
71 |
|
---|
72 | signals:
|
---|
73 | void valueChanged(int);
|
---|
74 | void sliderMoved(int);
|
---|
75 | void sliderPressed();
|
---|
76 | void sliderReleased();
|
---|
77 |
|
---|
78 | private slots:
|
---|
79 |
|
---|
80 | void sltSliderMoved(int val);
|
---|
81 |
|
---|
82 | private:
|
---|
83 |
|
---|
84 | void init(Qt::Orientation fOrientation = Qt::Horizontal);
|
---|
85 | int snapValue(int val);
|
---|
86 |
|
---|
87 | /* Private member vars */
|
---|
88 | CPrivateSlider *m_pSlider;
|
---|
89 | bool m_fSnappingEnabled;
|
---|
90 | };
|
---|
91 |
|
---|
92 | #endif /* __QIAdvancedSlider__ */
|
---|
93 |
|
---|