summaryrefslogtreecommitdiffstats
path: root/ksplashml/themeengine/objkstheme.h
blob: 9685d4529b2fdbb4c3eb091fc22df36e60a6010d (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
/***************************************************************************
 *   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 __OBJKSTHEME_H__
#define __OBJKSTHEME_H__

#include <kcmdlineargs.h>

#include <qstring.h>
#include <qstringlist.h>

class KConfig;
/**
 * @short Theme reader.
 * A Theme is read in from the file
 * <KDEDIR>/share/apps/ksplash/Themes/<theme>/Theme.rc
 * This controls the behavior, graphics, and appearance
 * of KSplash completely, and offers a friendlier way
 * of installing custom splash screens.
 */
class KDE_EXPORT ObjKsTheme : public QObject
{
  Q_OBJECT
public:
  explicit ObjKsTheme( const QString& );
  virtual ~ObjKsTheme();

  void loadCmdLineArgs( KCmdLineArgs * );

  QString theme() const      { return( mActiveTheme ); }
  QString themeEngine() const { return( mThemeEngine ); }
  KConfig *themeConfig() const { return( mThemeConfig ); }
  QString themeDir() const   { return( mThemeDir );    }
  bool loColor() const       { return( mLoColor );     }
  bool testing() const       { return( mTesting );     }
  bool managedMode() const   { return( mManagedMode ); }
  QString icon( int i ) { return (m_icons[i-1].isNull()?(QString::null):m_icons[i-1]); }
  QString text( int i ) { return (m_text[i-1].isNull()?(QString::null):m_text[i-1]);   }
  QString locateThemeData( const QString &resource );
  int xineramaScreen() const { return mXineramaScreen; }

protected:
  bool loadThemeRc( const QString&, bool );
  bool loadLocalConfig( const QString&, bool );
  bool loadKConfig( KConfig *, const QString&, bool );

private:
  QString mActiveTheme, mThemeDir;
  KConfig *mThemeConfig;

  int mXineramaScreen;
  bool mLoColor, mTesting, mManagedMode;
  QString mThemeEngine;
  QString mThemePrefix;

  QStringList m_icons, m_text;

  class ObjKsThemePrivate;
  ObjKsThemePrivate *d;
};

#endif