kcarddialog.h00001
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 #include <kdemacros.h>
00027 class QIconViewItem;
00028
00029 class KConfig;
00030
00031 class KCardDialogPrivate;
00032
00090 class KDE_EXPORT KCardDialog : public KDialogBase
00091 {
00092 Q_OBJECT
00093
00094 public:
00095
00101 enum CardFlags { Both=0, NoDeck=0x01, NoCards=0x02 };
00102
00110 KCardDialog (QWidget* parent = NULL,const char* name = NULL,
00111 CardFlags flags = Both);
00115 ~KCardDialog();
00116
00156 static int getCardDeck(QString &deck,QString &carddir, QWidget *parent=0,
00157 CardFlags flags=Both, bool* randomDeck=0,
00158 bool* randomCardDir=0, double* scale=0, KConfig* conf=0);
00159
00175 static void getConfigCardDeck(KConfig* conf, QString& deck, QString& cardDir, double& scale);
00176
00188 static QString getDefaultDeck();
00189
00201 static QString getDefaultCardDir();
00202
00210 static QString getCardPath(const QString &carddir, int index);
00211
00216 static QString getRandomDeck();
00217
00222 static QString getRandomCardDir();
00223
00228 void showRandomDeckBox(bool s);
00229
00234 void showRandomCardDirBox(bool s);
00235
00241 const QString& deck() const;
00242
00247 void setDeck(const QString& file);
00248
00252 const QString& cardDir() const;
00253
00258 void setCardDir(const QString& dir);
00259
00263 CardFlags flags() const;
00264
00270 void setupDialog(bool showResizeBox = false);
00271
00276 bool isRandomDeck() const;
00277
00282 bool isRandomCardDir() const;
00283
00287 bool isGlobalDeck() const;
00288
00292 bool isGlobalCardDir() const;
00293
00297 double cardScale() const;
00298
00303 void loadConfig(KConfig* conf);
00304
00311 void saveConfig(KConfig* conf);
00312
00313
00314 protected:
00315 void insertCardIcons();
00316 void insertDeckIcons();
00317
00318 static void getGlobalDeck(QString& cardDir, bool& random);
00319 static void getGlobalCardDir(QString& deck, bool& random);
00320
00321 static QString getDeckName(const QString& desktop);
00322
00327 static QString group();
00328
00329 protected slots:
00330 void slotDeckClicked(QIconViewItem *);
00331 void slotCardClicked(QIconViewItem *);
00332 void slotRandomCardDirToggled(bool on);
00333 void slotRandomDeckToggled(bool on);
00334 void slotCardResized(int);
00335 void slotDefaultSize();
00336 void slotSetGlobalDeck();
00337 void slotSetGlobalCardDir();
00338
00339 private:
00340 static void init();
00341
00342 KCardDialogPrivate* d;
00343 };
00344
00345 #endif
|