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

« back to all changes in this revision

Viewing changes to kmix/kmixapplet.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
/*
 
2
 * KMix -- KDE's full featured mini mixer
 
3
 *
 
4
 *
 
5
 * Copyright (C) 2000 Stefan Schimanski <1Stein@gmx.de>
 
6
 *
 
7
 * This program is free software; you can redistribute it and/or
 
8
 * modify it under the terms of the GNU Library General Public
 
9
 * License as published by the Free Software Foundation; either
 
10
 * version 2 of the License, or (at your option) any later version.
 
11
 *
 
12
 * This program is distributed in the hope that it will be useful,
 
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
15
 * Library General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU Library General Public
 
18
 * License along with this program; if not, write to the Free
 
19
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
20
 */
 
21
 
 
22
#ifndef KMIXAPPLET_H
 
23
#define KMIXAPPLET_H
 
24
 
 
25
#include <qwidget.h>
 
26
#include <kaction.h>
 
27
#include <kpanelapplet.h>
 
28
#include <qlist.h>
 
29
#include <kcolordialog.h>
 
30
 
 
31
#include "colorwidget.h"
 
32
#include "kmixerwidget.h"
 
33
 
 
34
class Mixer;
 
35
class QTimer;
 
36
 
 
37
 
 
38
class ColorDialog : public ColorWidget {
 
39
   Q_OBJECT
 
40
  public:
 
41
   ColorDialog( QWidget * parent=0, const char * name=0, bool modal=FALSE, WFlags f=0 ) 
 
42
       : ColorWidget( parent, name, modal, f ) {
 
43
       connect( buttonApply, SIGNAL(clicked()), SLOT(apply()) );
 
44
   };
 
45
 
 
46
   virtual ~ColorDialog() {};
 
47
 
 
48
  protected slots:
 
49
   virtual void apply() { emit applied(); }
 
50
   virtual void accept() { ColorWidget::accept(); emit applied(); }
 
51
   virtual void reject() { ColorWidget::reject(); emit rejected(); }
 
52
 
 
53
  signals:
 
54
   void applied();
 
55
   void rejected();     
 
56
};
 
57
 
 
58
 
 
59
class KMixApplet : public KPanelApplet
 
60
{
 
61
   Q_OBJECT
 
62
 
 
63
  public:
 
64
   KMixApplet( const QString& configFile, Type t = Normal,
 
65
               QWidget *parent = 0, const char *name = 0 );
 
66
   virtual ~KMixApplet();
 
67
 
 
68
   int widthForHeight(int height) const;
 
69
   int heightForWidth(int width) const; 
 
70
   
 
71
   void about();
 
72
   void help();
 
73
   void preferences();   
 
74
 
 
75
  protected slots:
 
76
   void triggerUpdateLayout();
 
77
   void updateLayoutNow(); 
 
78
   void selectMixer();
 
79
   void applyColors();
 
80
  
 
81
  protected:
 
82
   void resizeEvent( QResizeEvent * );
 
83
   void saveConfig();
 
84
    
 
85
  private:
 
86
   KMixerWidget *m_mixerWidget;
 
87
   QPushButton *m_errorLabel;
 
88
   QTimer *m_layoutTimer;
 
89
   int m_lockedLayout;
 
90
   ColorWidget *m_pref;
 
91
   bool insideOut; //  reverses direction of sliders and icon position
 
92
   void popupDirectionChange(Direction);
 
93
 
 
94
   static int s_instCount;
 
95
   static QList<Mixer> *s_mixers;
 
96
   static QTimer *s_timer;    
 
97
 
 
98
   KMixerWidget::Colors m_colors;
 
99
   bool m_customColors;
 
100
   
 
101
   int mixerNum;
 
102
   QString mixerName;
 
103
   Mixer *mixer;
 
104
};
 
105
 
 
106
 
 
107
#endif