summaryrefslogtreecommitdiffstats
path: root/ksplashml/themeengine/themeengine.h
blob: 0ffb0f72bc01be0a1897e55074d886a060ed65e4 (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
/***************************************************************************
 *   Copyright Brian Ledbetter 2001-2003 <brian@shadowcom.net>             *
 *   Copyright Ravikiran Rajagopal 2003  <ravi@kde.org>                    *
 *                                                                         *
 *   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 THEMEENGINE_H
#define THEMEENGINE_H

#include <tqstringlist.h>
#include <tqvbox.h>
#include <tqwidget.h>

#include <kdemacros.h>

class KConfig;
class ObjKsTheme;
class TQMouseEvent;

/**
 * @short The base for the ThemeEngine's configuration widget.
 */
class KDE_EXPORT ThemeEngineConfig: public TQVBox
{
  Q_OBJECT
public:

  ThemeEngineConfig( TQWidget *p, KConfig *c )
      :TQVBox( p ), mConfig( c )
  {}

  KConfig* config()const { return mConfig; }

public slots:
  virtual void load() {}
  virtual void save() {}

protected:
  KConfig *mConfig;
};

/**
 * @short Base class for all theme engines. Member functions need to be
 * overridden by derived classes in order to provide actual functionality.
 */
class KDE_EXPORT ThemeEngine: public TQVBox
{
  Q_OBJECT
public:
  ThemeEngine( TQWidget *parent, const char *name, const TQStringList &args );
  virtual ~ThemeEngine() = 0;
  virtual const ThemeEngineConfig *config( TQWidget *, KConfig * ) { return 0L; }
  virtual ObjKsTheme *ksTheme() { return mTheme; }
  virtual bool eventFilter( TQObject* o, TQEvent* e );

public slots:
  virtual void slotUpdateProgress( int ) {}
  virtual void slotUpdateSteps( int ) {}
  virtual void slotSetText( const TQString& ) {}
  virtual void slotSetTextIndex( const int ) {}
  virtual void slotSetPixmap( const TQString& ) {} // use DesktopIcon() to load this.

protected:
  void addSplashWindow( TQWidget* );

protected:
  ObjKsTheme *mTheme;
  virtual bool x11Event( XEvent* );

private slots:
  void splashWindowDestroyed( TQObject* );

private:
  class ThemeEnginePrivate;
  ThemeEnginePrivate *d;
};

#endif