00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __KCARDDIALOG_H_
00019 #define __KCARDDIALOG_H_
00020
00021 #include <kdialog.h>
00022 #include <kconfig.h>
00023
00024 #include <libkdegames_export.h>
00025
00026 class QListWidgetItem;
00027 class KCardDialogPrivate;
00028
00092 class KDEGAMES_EXPORT KCardDialog : public KDialog
00093 {
00094 Q_OBJECT
00095
00096 public:
00097
00108 explicit KCardDialog (QWidget* parent = NULL,
00109 bool pAllowSVG = true,
00110 bool pAllowPNG = true,
00111 bool pLock = true,
00112 QString defFront = QString(),
00113 QString defBack = QString()
00114 );
00115
00122 explicit KCardDialog (KConfigGroup& group, QWidget* parent = NULL);
00123
00127 ~KCardDialog();
00128
00147 static int getCardDeck(QString &pFrontName,
00148 QString &pBackName,
00149 QWidget *pParent = NULL,
00150 bool pAllowSVG = true,
00151 bool pAllowPNG = true,
00152 bool pLock = true,
00153 bool pRandom = false);
00154
00164 static int getCardDeck(const KConfigGroup& group);
00165
00170 void saveSettings(KConfigGroup& group);
00171
00176 QString backName() const;
00177
00182 QString frontName() const;
00183
00188 static QString getDefaultCardDir(bool pAllowSVG = true, bool pAllowPNG = true);
00189
00194 static QString getDefaultDeck(bool pAllowSVG = true, bool pAllowPNG = true);
00195
00196
00197 protected:
00198 void insertCardIcons();
00199
00203 void insertDeckIcons();
00204
00209 void updateBack(QString item);
00210
00215 void updateFront(QString item);
00216
00220 void setupGUI();
00221
00227 static QString getDeckFileNameFromIndex(const QString& desktop);
00228
00229 protected Q_SLOTS:
00233 void updateFront();
00234
00240 void updateBack();
00241
00246 void updateLocking(int state);
00247
00252 void updateSVG(int state);
00253
00258 void updatePNG(int state);
00259
00260 private:
00264 KCardDialogPrivate* const d;
00265 };
00266
00267 #endif