summaryrefslogtreecommitdiffstats
path: root/ksplashml/themeengine/default/themelegacy.h
blob: ed0b8025b441951b6e40fcbab62a9694c25de995 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/***************************************************************************
 *   Copyright Brian Ledbetter 2001-2003 <[email protected]>             *
 *   Copyright Ravikiran Rajagopal 2003                                    *
 *   [email protected]                                            *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License (version 2) as   *
 *   published by the Free Software Foundation. (The original KSplash/ML   *
 *   codebase (upto version 0.95.3) is BSD-licensed.)                      *
 *                                                                         *
 ***************************************************************************/

#ifndef __THEMELEGACY_H__
#define __THEMELEGACY_H__

#include <kprogress.h>

#include <tqlabel.h>
#include <tqwidget.h>

#include "themeengine.h"
class QPixmap;
class QTimer;

class QCheckBox;

class DefaultConfig: public ThemeEngineConfig
{
  Q_OBJECT
public:
  DefaultConfig( TQWidget *, KConfig * );
  void save();
protected:
  TQCheckBox *mFlash, *mAlwaysShow;
};

/**
 * @short Traditional KDE splash screen.
 */
class ObjKsTheme;
class KDE_EXPORT ThemeDefault : public ThemeEngine
{
  Q_OBJECT
public:
  ThemeDefault( TQWidget *, const char *, const TQStringList& );
   virtual ~ThemeDefault();

  inline const DefaultConfig *config( TQWidget *p, KConfig *c )
  {
    return new DefaultConfig( p, c );
  };

  static TQStringList names()
  {
    TQStringList Names;
    Names << "Default";
    Names << "Classic";
    Names << "Klassic";
    return( Names );
  }

public slots:
  inline void slotSetText( const TQString& s )
  {
    if( mLabel )
      mLabel->setText( s );
    slotUpdateState();
  };
  inline void slotUpdateSteps( int s )
  {
    mProgressBar->show();
    mProgressBar->setTotalSteps( s );
  }
  inline void slotUpdateProgress( int i )
  {
    mProgressBar->setProgress( i );
  }


private slots:
  void slotUpdateState();
  TQPixmap updateBarPixmap( int );
  void flash();

private:
  void _initUi();
  void _readSettings();
  TQString _findPicture( const TQString &pic );

  // Configurable Options
  bool mIconsFlashing;
  TQColor mLabelForeground;

  // Internals.
  KProgress *mProgressBar;
  TQLabel *mLabel, *mBarLabel;
  TQPixmap *mActivePixmap, *mInactivePixmap;
  int mState;
  TQTimer *mFlashTimer;
  TQPixmap *mFlashPixmap1, *mFlashPixmap2;
};

#endif