• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

libkdegames

kcarddialog.h

Go to the documentation of this file.
00001 /*
00002     This file is part of the KDE games library
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License version 2 as published by the Free Software Foundation.
00007 
00008     This library is distributed in the hope that it will be useful,
00009     but WITHOUT ANY WARRANTY; without even the implied warranty of
00010     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011     Library General Public License for more details.
00012 
00013     You should have received a copy of the GNU Library General Public License
00014     along with this library; see the file COPYING.LIB.  If not, write to
00015     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016     Boston, MA 02110-1301, USA.
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 
00159    void saveSettings(KConfigGroup& group);
00160 
00165    static QString deckSVGFilePath(const QString& name);
00166 
00174    static QString cardSVGFilePath(const QString& name);
00175 
00180    static bool isSVGCard(const QString& name);
00181 
00186    static bool isSVGDeck(const QString& name);
00187    
00193    static QString defaultCardName(bool pAllowSVG = true, bool pAllowPNG = true);
00194    
00200    static QString defaultDeckName(bool pAllowSVG = true, bool pAllowPNG = true);
00201    
00207    static QString randomCardName(bool pAllowSVG = true, bool pAllowPNG = true);
00208  
00214    static QString randomDeckName(bool pAllowSVG = true, bool pAllowPNG = true);
00215 
00222    static QString cardDir(const QString& name);
00223 
00230    static QString deckFilename(const QString& name);
00231 
00236    QString deckName() const;
00237 
00242    QString cardName() const;
00243 
00249    static void reset();
00250 
00255    static QString getDefaultCardDir(bool pAllowSVG = true, bool pAllowPNG = true);
00256 
00261    static QString getDefaultDeck(bool pAllowSVG = true, bool pAllowPNG = true);
00262 
00263 
00264 protected:
00268     static void readFronts();
00269     
00273     static void readBacks();
00274     
00278     void insertCardIcons();
00279     
00283     void insertDeckIcons();
00284     
00289     void updateBack(QString item);
00290 
00295     void updateFront(QString item);
00296     
00300     void setupGUI();
00301     
00308     static QString findi18nBack(QString& name);
00309 
00315     static QString getDeckFileNameFromIndex(const QString& desktop);
00316 
00320     static QString group();
00321 
00322 protected Q_SLOTS:
00326     void updateFront();
00327     
00333     void updateBack();
00334     
00339     void updateLocking(int state);
00340 
00345     void updateSVG(int state);
00346         void updatePNG(int state);
00351 
00352 private:
00356    static void init();
00357 
00361    KCardDialogPrivate* const d;
00362 };
00363 
00364 #endif

libkdegames

Skip menu "libkdegames"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • kblackbox
  • kgoldrunner
  • kmahjongg
  • ksquares
  • libkdegames
  •   highscore
  •   kgame
  •   kggzgames
  •   kggzmod
  •   kggznet
  • libkmahjongg
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal