libkdegames Library API Documentation

kcarddialog.h

00001 /* 00002 This file is part of the KDE games library 00003 Copyright (C) 2000 Martin Heni (martin@heni-online.de) 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License version 2 as published by the Free Software Foundation. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00017 Boston, MA 02111-1307, USA. 00018 */ 00019 #ifndef __KCARDDIALOG_H_ 00020 #define __KCARDDIALOG_H_ 00021 00022 #include <qstring.h> 00023 #include <kdialogbase.h> 00024 #include <qmap.h> // TODO: remove - it is in kcarddialog.cpp now; left here for source compatibility 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
KDE Logo
This file is part of the documentation for libkdegames Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Jul 28 14:18:45 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003