add more spacing
[personal-kdebase.git] / workspace / ksplash / kcm / installer.h
blob9fb12dde22e8678ae4b86c875e1af7d4869cbbb4
1 /***************************************************************************
2 * Copyright Ravikiran Rajagopal 2003 *
3 * ravi@ee.eng.ohio-state.edu *
4 * Copyright (c) 1998 Stefan Taferner <taferner@kde.org> *
5 * *
6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License (version 2) as *
8 * published by the Free Software Foundation. *
9 * *
10 ***************************************************************************/
11 #ifndef SPLASHINSTALLER_H
12 #define SPLASHINSTALLER_H
14 #include <QMap>
15 #include <QPoint>
16 //Added by qt3to4:
17 #include <QDragEnterEvent>
18 #include <QMouseEvent>
19 #include <QLabel>
20 #include <QDropEvent>
22 #include <klistwidget.h>
23 #include <kurl.h>
25 class QLabel;
26 class QTextEdit;
27 class QPushButton;
28 class ThemeListBox;
30 class SplashInstaller : public QWidget
32 Q_OBJECT
33 public:
34 SplashInstaller(QWidget *parent=0, const char *aName=0, bool aInit=false);
35 ~SplashInstaller();
37 virtual void load();
38 virtual void save();
39 virtual void defaults();
41 Q_SIGNALS:
42 void changed( bool state );
44 protected Q_SLOTS:
45 virtual void slotNew();
46 virtual void slotAdd();
47 virtual void slotRemove();
48 virtual void slotTest();
49 virtual void slotSetTheme(int);
50 void slotFilesDropped(const KUrl::List &urls);
52 protected:
53 /** Scan Themes directory for available theme packages */
54 virtual void readThemesList();
55 /** add a theme to the list, returns the list index */
56 int addTheme(const QString &path, const QString &name);
57 void addNewTheme(const KUrl &srcURL);
58 int findTheme( const QString &theme );
60 private:
61 bool mGui;
62 ThemeListBox *mThemesList;
63 QString mEngineOfSelected;
64 QPushButton *mBtnNew, *mBtnAdd, *mBtnRemove, *mBtnTest;
65 QTextEdit *mText;
66 QLabel *mPreview;
69 class ThemeListBox: public KListWidget
71 Q_OBJECT
72 public:
73 ThemeListBox(QWidget *parent);
74 QMap<QString, QString> text2path;
76 Q_SIGNALS:
77 void filesDropped(const KUrl::List &urls);
79 protected:
80 void dragEnterEvent(QDragEnterEvent* event);
81 void dragMoveEvent(QDragMoveEvent* event);
82 void dropEvent(QDropEvent* event);
83 void mouseMoveEvent(QMouseEvent *e);
84 void mousePressEvent(QMouseEvent *e);
86 private:
87 QString mDragFile;
88 QPoint mOldPos;
92 #endif