KardSequence Class Reference

#include <kardsequence.h>

Collaboration diagram for KardSequence:

Collaboration graph
[legend]

List of all members.


Detailed Description

This is a graphical representation for a sequence of Kards.

Author:
John Schneiderman

Public Slots

void addKard (Kard &kard)
void removeKard (Kard &kard)

Signals

void kardMoved ()
void kardMoved (Kard &kard)
void kardSelected (Kard &kard)

Public Member Functions

void addCard (const Card &card)
const CardSequencecardSequence () const
void clear ()
bool isFaceUp () const
bool isSortPopup () const
bool isVertical () const
 KardSequence (const CardSequence &sequence, QWidget *parent=0, bool vertical=false)
 KardSequence (QWidget *parent=0, bool vertical=false)
void removeCard (const Card &card)
void setCardBackImage (const QString &backImage)
void setCardFrontImagePath (const QString &imagePath)
void setCardSequence (const CardSequence &sequence)
void setFaceUp (bool faceUp)
void setSelected (const Card &card)
void setSortPopup (bool sortPopup)
void setVertical (bool vertical)
int size () const
QSize sizeHint ()
 ~KardSequence ()

Protected Member Functions

virtual void dragEnterEvent (QDragEnterEvent *event)
virtual void dropEvent (QDropEvent *event)
virtual void mousePressEvent (QMouseEvent *event)
virtual void paintEvent (QPaintEvent *event)

Properties

bool m_faceUp
bool m_sortPopup
bool m_vertical

Constructor & Destructor Documentation

KardSequence::KardSequence ( QWidget *  parent = 0,
bool  vertical = false 
)

This is the default constructor.

Parameters:
parent is the parent widget.
vertical is true if you want the cards to be displayed vertically, false elsewise.

KardSequence::KardSequence ( const CardSequence sequence,
QWidget *  parent = 0,
bool  vertical = false 
)

This is the default constructor.

Parameters:
sequence is the sequence to display.
parent is the parent widget.
vertical is true if you want the cards to be displayed vertically, false elsewise.

KardSequence::~KardSequence (  ) 

The default destructor.


Member Function Documentation

void KardSequence::addCard ( const Card card  ) 

This will add a card to the end of our card sequence.

Parameters:
card is the card to add to our sequence.

void KardSequence::addKard ( Kard kard  )  [slot]

This will add a Kard to the end of our card sequence.

Parameters:
kard is the Kard to add to our card sequence.

const CardSequence & KardSequence::cardSequence (  )  const

This is the accessor for the cardSequence we're displaying.

Returns:
the card sequence.

void KardSequence::clear (  ) 

This will clear everything in our widget.

void KardSequence::dragEnterEvent ( QDragEnterEvent *  event  )  [protected, virtual]

These are the types of objects we can accept for dropping.

Parameters:
event is the generating event.

void KardSequence::dropEvent ( QDropEvent *  event  )  [protected, virtual]

This handles when an object is dropped into us.

Parameters:
event is the generating event.

bool KardSequence::isFaceUp (  )  const

Tells us if the cards are to be face up or not.

Returns:
true if the cards are face up, false elsewise.

bool KardSequence::isSortPopup (  )  const

This tells if the sort pop-up menu is enabled.

Returns:
true if the sort pop-up menu is enabled, false elsewise.

bool KardSequence::isVertical (  )  const

Tells us if the cards are displayed vertically or horizontally.

Returns:
true if the cards are displayed vertically, false if they're horizontal.

void KardSequence::kardMoved (  )  [signal]

This is a signal that notifies a slot that a card has been moved in our widget.

void KardSequence::kardMoved ( Kard kard  )  [signal]

This is a signal that notifies a slot that a card has been moved in our widget.

Parameters:
kard is the kard that was moved.

void KardSequence::kardSelected ( Kard kard  )  [signal]

This is a signal that notifies a slot that a card has been selected.

Parameters:
kard is the kard that was selected.

void KardSequence::mousePressEvent ( QMouseEvent *  event  )  [protected, virtual]

This displays the right mouse button click menu for sorting by rank or by suit.

Parameters:
event is the generating event.

void KardSequence::paintEvent ( QPaintEvent *  event  )  [protected, virtual]

This paints our KardSequence.

Parameters:
event is the generating event.

void KardSequence::removeCard ( const Card card  ) 

This will remove a card from our card sequence.

Parameters:
card is the card to remove from our sequence.
Exceptions:
KardsGTError if card is not in the sequence.

void KardSequence::removeKard ( Kard kard  )  [slot]

This will remove a Kard from our card sequence.

Parameters:
kard is the kard to remove from our card sequence.

void KardSequence::setCardBackImage ( const QString &  backImage  ) 

This sets the image to be used on the back of the kards in our widget.

Parameters:
backImage is the file name for the image to use on the back of our kards.

void KardSequence::setCardFrontImagePath ( const QString &  imagePath  ) 

This sets the images to be used on the front of the kards in our widget.

Parameters:
imagePath is the path to the directory that contains our card images.

void KardSequence::setCardSequence ( const CardSequence sequence  ) 

This is a modifier to set the sequence of cards displayed.

Parameters:
sequence is the sequence of cards we wish to display.

void KardSequence::setFaceUp ( bool  faceUp  ) 

This is a modifier to set if our cards should be face up or face down.

Parameters:
faceUp true will set the cards to be face up, false will set them to be face down.

void KardSequence::setSelected ( const Card card  ) 

This selects a specific kard in our sequence.

Parameters:
card is the kard we want to select.

void KardSequence::setSortPopup ( bool  sortPopup  ) 

This enables or disables the sort pop-up menu.

Parameters:
sortPopup is true if we wish to enable the sort pop-up menu, false elsewise.

void KardSequence::setVertical ( bool  vertical  ) 

This will change our sequence to be either vertical or horizontal.

Parameters:
vertical is true will make our sequence to be displayed vertically, false will make our sequence to be displayed horizontally.

int KardSequence::size (  )  const

An accessor for how many cards are in our card sequence.

Returns:
the number of cards in our sequence.

QSize KardSequence::sizeHint (  ) 

Is the preferred size for our widget.

Returns:
the preferred size.


Property Documentation

bool KardSequence::m_faceUp [read, write]

Parameters:
m_faceUp is true if we want our sequence to be face up, false elsewise.

bool KardSequence::m_sortPopup [read, write]

Parameters:
m_sortPopup is true if we want to have a pop-up menu for sorting, false elsewise.

bool KardSequence::m_vertical [read, write]

Parameters:
m_vertical is true if we want our sequence to be displayed vertically, false will make them horizontal.


The documentation for this class was generated from the following files:

Generated on Tue Aug 12 23:24:02 2008 for KardsGT by  doxygen 1.5.5