~ubuntu-branches/ubuntu/natty/kdemultimedia/natty-proposed

« back to all changes in this revision

Viewing changes to kmix/gui/ksmallslider.h

  • Committer: Bazaar Package Importer
  • Author(s): Debian Qt/KDE Maintainers
  • Date: 2011-05-26 02:41:36 UTC
  • mfrom: (0.2.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 108.
  • Revision ID: james.westby@ubuntu.com-20110526024136-jjwsigfy402jhupm
Tags: upstream-4.6.3
ImportĀ upstreamĀ versionĀ 4.6.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//-*-C++-*-
 
2
/*
 
3
 * KMix -- KDE's full featured mini mixer
 
4
 *
 
5
 *
 
6
 * Copyright (C) 2000 Stefan Schimanski <1Stein@gmx.de>
 
7
 *
 
8
 * This program is free software; you can redistribute it and/or
 
9
 * modify it under the terms of the GNU Library General Public
 
10
 * License as published by the Free Software Foundation; either
 
11
 * version 2 of the License, or (at your option) any later version.
 
12
 *
 
13
 * This program is distributed in the hope that it will be useful,
 
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
16
 * Library General Public License for more details.
 
17
 *
 
18
 * You should have received a copy of the GNU Library General Public
 
19
 * License along with this program; if not, write to the Free
 
20
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
21
 */
 
22
 
 
23
#ifndef KSMALLSLIDER_H
 
24
#define KSMALLSLIDER_H
 
25
 
 
26
#include <qabstractslider.h>
 
27
#include <qpixmap.h>
 
28
 
 
29
class KSmallSlider : public QAbstractSlider
 
30
{
 
31
      Q_OBJECT
 
32
 
 
33
   public:
 
34
      KSmallSlider( int minValue, int maxValue, int pageStep, int value,
 
35
        Qt::Orientation, QWidget *parent, const char *name=0 );
 
36
 
 
37
      QSize sizeHint() const;
 
38
      QSizePolicy sizePolicy() const;
 
39
      QSize minimumSizeHint() const;
 
40
 
 
41
      bool gray() const;
 
42
 
 
43
public slots:
 
44
      void setGray( bool value );
 
45
      void setColors( QColor high, QColor low, QColor back );
 
46
      void setGrayColors( QColor high, QColor low, QColor back );
 
47
 
 
48
      signals:
 
49
      void valueChanged( int value );
 
50
 
 
51
   protected:
 
52
      void resizeEvent( QResizeEvent * );
 
53
      void paintEvent( QPaintEvent * );
 
54
 
 
55
      void mousePressEvent( QMouseEvent * );
 
56
      void mouseMoveEvent( QMouseEvent * );
 
57
//      void wheelEvent( QWheelEvent * );
 
58
 
 
59
      void valueChange();
 
60
 
 
61
   private:
 
62
 
 
63
      void init();
 
64
      int positionFromValue( int ) const;
 
65
      int valueFromPosition( int ) const;
 
66
      int positionFromValue( int logical_val, int span ) const;
 
67
      int valueFromPosition( int pos, int span ) const;
 
68
      void moveSlider( int );
 
69
 
 
70
      int available() const;
 
71
      int goodPart( const QPoint& ) const;
 
72
 
 
73
      bool grayed;
 
74
      QColor colHigh, colLow, colBack;
 
75
      QColor grayHigh, grayLow, grayBack;
 
76
 
 
77
};
 
78
 
 
79
#endif