KardPlayer Class Reference

#include <kardplayer.h>

Collaboration diagram for KardPlayer:

Collaboration graph
[legend]

List of all members.


Detailed Description

This is the graphical representation of a player.

Author:
John Schneiderman

Public Member Functions

const QString & caption () const
void clear ()
 KardPlayer (QWidget *parent=0)
QPixmap playerImage () const
void setCaption (const QString &caption, int length)
void setCaption (const QString &caption)
void setDealer (bool dealer)
void setPlayerImage (const QString &imageFilename)
void setPlayerImage (const QPixmap &playerImage)
void setSkillLevel (Player::SkillLevel level)
void setTurn (bool turn)
QSize sizeHint () const

Protected Member Functions

virtual void paintEvent (QPaintEvent *event)
virtual void timerEvent (QTimerEvent *event)

Properties

QString m_caption
QPixmap m_playerImage

Constructor & Destructor Documentation

KardPlayer::KardPlayer ( QWidget *  parent = 0  ) 

KardPlayer constructor

Parameters:
parent is the parent window.


Member Function Documentation

const QString & KardPlayer::caption (  )  const

This is the accessor to what the player "said".

void KardPlayer::clear (  ) 

This clears what the player has said.

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

This draws the players image.

Parameters:
event is the generating event.

QPixmap KardPlayer::playerImage (  )  const

This is the accessor for the current player's image.

void KardPlayer::setCaption ( const QString &  caption,
int  length 
)

This causes the player to "say" something.

Parameters:
caption is what the player says.
length is how many seconds to display the message
Note:
if we're still showing a previous caption, we'll combine the messages.

void KardPlayer::setCaption ( const QString &  caption  ) 

This causes the player to "say" something.

Parameters:
caption is what the player says.
Note:
if we're still showing a previous caption, we'll combine the messages.

void KardPlayer::setDealer ( bool  dealer  ) 

Updates the icon notification for the player dealer status.

Parameters:
dealer is true if we are the dealer, false elsewise.

void KardPlayer::setPlayerImage ( const QString &  imageFilename  ) 

This sets the image of the player.

Parameters:
imageFilename is the name of the file for the player.
Note:
The image file-name can be either a built in image or a file-name to an image.
Exceptions:
KardsGTError if the image file cannot be found.

void KardPlayer::setPlayerImage ( const QPixmap &  playerImage  ) 

This sets the image of the player.

Parameters:
playerImage is what to set the player's image to.
Exceptions:
KardsGTError if the playerImage is null.

void KardPlayer::setSkillLevel ( Player::SkillLevel  level  ) 

Updates the icon notification for the player level status.

Parameters:
level is the level the player has attained.
Exceptions:
KardsGTError If level is an invalid value.

void KardPlayer::setTurn ( bool  turn  ) 

Updates the icon notification for the player turn status.

Parameters:
turn is true if it is the player's turn, false elsewise.

QSize KardPlayer::sizeHint (  )  const

This gives the preferred size of the player's image.

Returns:
the size of the player's image.

void KardPlayer::timerEvent ( QTimerEvent *  event  )  [protected, virtual]

This will erase the caption.

Parameters:
event is the timer event to clear our caption.


Property Documentation

QString KardPlayer::m_caption [read, write]

Parameters:
m_caption is the caption for the player.

QPixmap KardPlayer::m_playerImage [read, write]

Parameters:
m_playerImage is the players image.


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

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