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 
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

Generated on Sun Mar 16 08:02:52 2008 for Libkdegames by  doxygen 1.5.3