~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to noatun/noatun/library/controls.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __CONTROLS_H
 
2
#define __CONTROLS_H
 
3
 
 
4
#include <qguardedptr.h>
 
5
 
 
6
#include <kaction.h>
 
7
#include <ktoolbar.h>
 
8
#include <qslider.h>
 
9
 
 
10
class QComboBox;
 
11
class QLabel;
 
12
 
 
13
/**
 
14
 * A slider that can be moved around while being
 
15
 * changed internally
 
16
 **/
 
17
class L33tSlider : public QSlider
 
18
{
 
19
Q_OBJECT
 
20
public:
 
21
        L33tSlider(QWidget * parent, const char * name=0);
 
22
        L33tSlider(Orientation, QWidget * parent, const char * name=0);
 
23
        L33tSlider(int minValue, int maxValue, int pageStep, int value,
 
24
                   Orientation, QWidget * parent, const char * name=0);
 
25
 
 
26
        bool currentlyPressed() const;
 
27
signals:
 
28
        /**
 
29
         * emmited only when the user changes the value by hand
 
30
         **/
 
31
        void userChanged(int value);
 
32
 
 
33
public slots:
 
34
        virtual void setValue(int);
 
35
protected:
 
36
        virtual void mousePressEvent(QMouseEvent*);
 
37
        virtual void mouseReleaseEvent(QMouseEvent*);
 
38
        virtual void wheelEvent(QWheelEvent *);
 
39
private:
 
40
        bool pressed;
 
41
};
 
42
 
 
43
/**
 
44
 * A slider for your toolbar
 
45
 **/
 
46
class SliderAction : public KAction
 
47
{
 
48
Q_OBJECT
 
49
public:
 
50
        SliderAction(const QString& text, int accel, const QObject *receiver,
 
51
                     const char *member, QObject* parent, const char* name );
 
52
        virtual int plug( QWidget *w, int index = -1 );
 
53
        virtual void unplug( QWidget *w );
 
54
        QSlider* slider() const { return m_slider; }
 
55
 
 
56
signals:
 
57
        void plugged();
 
58
 
 
59
public slots:
 
60
        void toolbarMoved(KToolBar::BarPosition pos);
 
61
private:
 
62
        QGuardedPtr<QSlider> m_slider;
 
63
        QStringList m_items;
 
64
        const QObject *m_receiver;
 
65
        const char *m_member;
 
66
};
 
67
 
 
68
#endif