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

libkdegames

KCardWidget Class Reference

#include <KCardDialog>

Inheritance diagram for KCardWidget:

Inheritance graph
[legend]

List of all members.


Detailed Description

A carddeck selection widget for card games.

The KCardWidget provides a widget for interactive carddeck selection. It gives cardgames an easy to use interface to select front and back of the card sets. As card sets the KDE default cardsets are offered as well as used specified ones.

This class can be used in two ways: Embedding it into an existing dialog or creating a small KDialog just for the carddeck selection.

Card sets (front and back) are identified by their (translated) names.

Here you can see a card widget in action

kcarddialog.png

KCardwidget

You can use a KConfigGroup to initialize the state of the widget or let the widget store its current state to a config group.

For an example usage see KCardDialog.

Definition at line 86 of file kcarddialog.h.


Public Slots

void setFixedSizeAllowed (bool fixedSizeAllowed)
void setLocked (bool locked)

Public Member Functions

QString backName () const
QString frontName () const
bool isFixedSizeAllowed () const
bool isLocked () const
 KCardWidget (QWidget *parent=NULL)
void readSettings (const KConfigGroup &group)
void saveSettings (KConfigGroup &group) const
void setBackName (const QString &name)
void setFrontName (const QString &name)
 ~KCardWidget ()

Protected Slots

void updateBack ()
void updateFront ()

Protected Member Functions

void insertCardIcons ()
void insertDeckIcons ()
void setupGUI ()

Constructor & Destructor Documentation

KCardWidget::KCardWidget ( QWidget *  parent = NULL  ) 

Constructs a card deck selection widget.

Parameters:
parent The parent widget of the widget, if any.

Definition at line 76 of file kcarddialog.cpp.

KCardWidget::~KCardWidget (  ) 

Destructs a card deck selection dialog.

Definition at line 133 of file kcarddialog.cpp.


Member Function Documentation

QString KCardWidget::backName (  )  const

Retrieve the name of the card deck (back side) from the widget.

Returns:
The deck name.

Definition at line 139 of file kcarddialog.cpp.

QString KCardWidget::frontName (  )  const

Retrieve the name of the card set (front side) from the dialog.

Returns:
The card set name.

Definition at line 146 of file kcarddialog.cpp.

void KCardWidget::insertCardIcons (  )  [protected]

Definition at line 162 of file kcarddialog.cpp.

void KCardWidget::insertDeckIcons (  )  [protected]

Insert the back sides into the list view.

Definition at line 312 of file kcarddialog.cpp.

bool KCardWidget::isFixedSizeAllowed (  )  const

Retrieve the current state of the "Show old style decks" checkbox.

Returns:
wether or not fixed size card decks are shown in the list

Definition at line 151 of file kcarddialog.cpp.

bool KCardWidget::isLocked (  )  const

Retrieve the locking status.

Returns:
true if the backside selection is locked to the frontside

Definition at line 156 of file kcarddialog.cpp.

void KCardWidget::readSettings ( const KConfigGroup &  group  ) 

Read the settings from a config file.

Parameters:
group the configuration group

Definition at line 87 of file kcarddialog.cpp.

void KCardWidget::saveSettings ( KConfigGroup &  group  )  const

Saves the KCardWidget config into a config file.

These settings are used by KCardWidget.

Definition at line 96 of file kcarddialog.cpp.

void KCardWidget::setBackName ( const QString &  name  ) 

set the name of the card deck (back side)

Parameters:
name the new name to select as back side

Definition at line 285 of file kcarddialog.cpp.

void KCardWidget::setFixedSizeAllowed ( bool  fixedSizeAllowed  )  [slot]

Allow the user to select fixed size cards.

Parameters:
fixedSizeAllowed if set to true will show scalable and also fixed size card decks in the dialog

Definition at line 267 of file kcarddialog.cpp.

void KCardWidget::setFrontName ( const QString &  name  ) 

set the name of the card set (front side)

Parameters:
name the new name to select as front side

Definition at line 207 of file kcarddialog.cpp.

void KCardWidget::setLocked ( bool  locked  )  [slot]

enable or disable locked selection, when locking is enabled the user can only choose the front sides and the backside will be determined from the frontside

Parameters:
locked wether to lock the front and backside selection

Definition at line 254 of file kcarddialog.cpp.

void KCardWidget::setupGUI (  )  [protected]

Configure the dialog GUI.

Definition at line 106 of file kcarddialog.cpp.

void KCardWidget::updateBack (  )  [protected, slot]

Called by the card deck list view when a new item was selected.

Parameters:
current The newly selected item.
last The previously selected item.

Definition at line 276 of file kcarddialog.cpp.

void KCardWidget::updateFront (  )  [protected, slot]

Called by the card set list view when a new item was selected.

Definition at line 197 of file kcarddialog.cpp.


The documentation for this class was generated from the following files:
  • kcarddialog.h
  • kcarddialog.cpp

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