kcarddialog.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __KCARDDIALOG_H_
00020 #define __KCARDDIALOG_H_
00021
00022 #include <qstring.h>
00023 #include <kdialogbase.h>
00024 #include <qmap.h>
00025
00026 class QIconViewItem;
00027
00028 class KConfig;
00029
00030 class KCardDialogPrivate;
00031
00089 class KCardDialog : public KDialogBase
00090 {
00091 Q_OBJECT
00092
00093 public:
00094
00100 enum CardFlags { Both=0, NoDeck=0x01, NoCards=0x02 };
00101
00109 KCardDialog (QWidget* parent = NULL,const char* name = NULL,
00110 CardFlags flags = Both);
00114 ~KCardDialog();
00115
00155 static int getCardDeck(QString &deck,QString &carddir, QWidget *parent=0,
00156 CardFlags flags=Both, bool* randomDeck=0,
00157 bool* randomCardDir=0, double* scale=0, KConfig* conf=0);
00158
00174 static void getConfigCardDeck(KConfig* conf, QString& deck, QString& cardDir, double& scale);
00175
00187 static QString getDefaultDeck();
00188
00200 static QString getDefaultCardDir();
00201
00209 static QString getCardPath(const QString &carddir, int index);
00210
00215 static QString getRandomDeck();
00216
00221 static QString getRandomCardDir();
00222
00227 void showRandomDeckBox(bool s);
00228
00233 void showRandomCardDirBox(bool s);
00234
00240 const QString& deck() const;
00241
00246 void setDeck(const QString& file);
00247
00251 const QString& cardDir() const;
00252
00257 void setCardDir(const QString& dir);
00258
00262 CardFlags flags() const;
00263
00269 void setupDialog(bool showResizeBox = false);
00270
00275 bool isRandomDeck() const;
00276
00281 bool isRandomCardDir() const;
00282
00286 bool isGlobalDeck() const;
00287
00291 bool isGlobalCardDir() const;
00292
00296 double cardScale() const;
00297
00302 void loadConfig(KConfig* conf);
00303
00310 void saveConfig(KConfig* conf);
00311
00312
00313 protected:
00314 void insertCardIcons();
00315 void insertDeckIcons();
00316
00317 static void getGlobalDeck(QString& cardDir, bool& random);
00318 static void getGlobalCardDir(QString& deck, bool& random);
00319
00320 static QString getDeckName(const QString& desktop);
00321
00326 static QString group();
00327
00328 protected slots:
00329 void slotDeckClicked(QIconViewItem *);
00330 void slotCardClicked(QIconViewItem *);
00331 void slotRandomCardDirToggled(bool on);
00332 void slotRandomDeckToggled(bool on);
00333 void slotCardResized(int);
00334 void slotDefaultSize();
00335 void slotSetGlobalDeck();
00336 void slotSetGlobalCardDir();
00337
00338 private:
00339 static void init();
00340
00341 KCardDialogPrivate* d;
00342 };
00343
00344 #endif
This file is part of the documentation for libkdegames Library Version 3.3.2.