• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegames API Reference
  • KDE Home
  • Contact Us
 

kmahjongg

Public Slots | Signals | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | List of all members
BoardWidget Class Reference

#include <boardwidget.h>

Inheritance diagram for BoardWidget:
Inheritance graph
[legend]

Public Slots

void angleSwitchCCW ()
 
void angleSwitchCW ()
 
void animatingMoveListBackwards ()
 
void animatingMoveListForward ()
 
void demoMoveTimeout ()
 
void drawBoard (bool showTiles=true)
 
void helpMove ()
 
void helpMoveStop ()
 
void helpMoveTimeout ()
 
bool loadBackground (const QString &, bool bShowError=true)
 
bool loadBoard ()
 
bool loadBoardLayout (const QString &)
 
void loadSettings ()
 
bool loadTileset (const QString &)
 
void matchAnimationTimeout ()
 
void populateSpriteMap ()
 
void resizeTileset (const QSize &wsize)
 
void saveSettings ()
 
void setDisplayedWidth ()
 
void shuffle ()
 
void updateSpriteMap ()
 

Signals

void demoModeChanged (bool bActive)
 
void gameCalculated ()
 
void gameOver (unsigned short removed, unsigned short cheats)
 
void statusTextChanged (const QString &, long)
 
void tileNumberChanged (int iMaximum, int iCurrent, int iLeft)
 

Public Member Functions

 BoardWidget (QWidget *parent=0)
 
 ~BoardWidget ()
 
void animateMoveList ()
 
void calculateNewGame (int num=-1)
 
void gameLoaded ()
 
QString getBoardName ()
 
long getGameNum ()
 
QString getLayoutName ()
 
void pause ()
 
void redoMove ()
 
void setShowMatch (bool show)
 
void startDemoMode ()
 
void stopDemoMode ()
 
int undoMove ()
 

Public Attributes

GameData * Game
 
TileViewAngle m_angle
 
QHash< TileCoord, TileSprite * > spriteMap
 
KMahjonggBackground theBackground
 
KMahjonggLayout theBoardLayout
 
KMahjonggTileset theTiles
 

Protected Types

enum  STATES {
  Stop, Demo, Help, Animation,
  Match
}
 

Protected Member Functions

void cancelUserSelectedTiles ()
 
void drawTileNumber ()
 
void getFileOrDefault (const QString &filename, const QString &type, QString &res)
 
void hilightTile (POSITION &, bool on=true, bool refresh=true)
 
KGameCanvasItem * itemAt (const QPoint &point) const
 
void mousePressEvent (QMouseEvent *)
 
void putTileInBoard (POSITION &, bool refresh=true)
 
void removeTile (POSITION &, bool refresh=true)
 
int requiredHeight ()
 
int requiredHorizontalCells ()
 
int requiredVerticalCells ()
 
int requiredWidth ()
 
virtual void resizeEvent (QResizeEvent *event)
 
void setStatusText (const QString &)
 
void stopEndAnimation ()
 
void stopMatchAnimation ()
 
void transformPointToPosition (const QPoint &point, POSITION &MouseClickPos)
 
bool validMovesAvailable ()
 
virtual void wheelEvent (QWheelEvent *event)
 

Protected Attributes

QTimer * animateBackwardsTimer
 
QTimer * animateForwardTimer
 
unsigned short cheatsUsed
 
long gameGenerationNum
 
bool gamePaused
 
int iTimerStep
 
short matchCount
 
POSITION MouseClickPos1
 
POSITION MouseClickPos2
 
bool showHelp
 
bool showMatch
 
QTimer * timer
 
POSITION TimerPos1
 
POSITION TimerPos2
 
enum BoardWidget::STATES TimerState
 

Detailed Description

Where all the funn happens.

See also
BoardLayout
Author
Mathias Mueller

Definition at line 52 of file boardwidget.h.

Member Enumeration Documentation

enum BoardWidget::STATES
protected

Describe the enum.

Enumerator
Stop 
Demo 
Help 
Animation 
Match 

Definition at line 366 of file boardwidget.h.

Constructor & Destructor Documentation

BoardWidget::BoardWidget ( QWidget *  parent = 0)
explicit

Class Constructor.

Parameters
*parentblah blah

Definition at line 34 of file boardwidget.cpp.

BoardWidget::~BoardWidget ( )

Class Destructor.

Definition at line 81 of file boardwidget.cpp.

Member Function Documentation

void BoardWidget::angleSwitchCCW ( )
slot

Slot Description.

Definition at line 1143 of file boardwidget.cpp.

void BoardWidget::angleSwitchCW ( )
slot

Slot Description.

Definition at line 1182 of file boardwidget.cpp.

void BoardWidget::animateMoveList ( )

Method Description.

Definition at line 667 of file boardwidget.cpp.

void BoardWidget::animatingMoveListBackwards ( )
slot

Slot Description.

Definition at line 689 of file boardwidget.cpp.

void BoardWidget::animatingMoveListForward ( )
slot

Slot Description.

Definition at line 673 of file boardwidget.cpp.

void BoardWidget::calculateNewGame ( int  num = -1)

Method Description.

Definition at line 717 of file boardwidget.cpp.

void BoardWidget::cancelUserSelectedTiles ( )
protected

Method Description.

Definition at line 1070 of file boardwidget.cpp.

void BoardWidget::demoModeChanged ( bool  bActive)
signal

Signal Description.

Parameters
bActive
void BoardWidget::demoMoveTimeout ( )
slot

Slot Description.

Definition at line 559 of file boardwidget.cpp.

void BoardWidget::drawBoard ( bool  showTiles = true)
slot

Slot Description.

Definition at line 792 of file boardwidget.cpp.

void BoardWidget::drawTileNumber ( )
protected

Method Description.

Definition at line 1065 of file boardwidget.cpp.

void BoardWidget::gameCalculated ( )
signal

Signal Description.

void BoardWidget::gameLoaded ( )

Method Description.

Definition at line 454 of file boardwidget.cpp.

void BoardWidget::gameOver ( unsigned short  removed,
unsigned short  cheats 
)
signal

Signal Description.

QString BoardWidget::getBoardName ( )
inline

Method Description.

Returns
QString filename

Definition at line 119 of file boardwidget.h.

void BoardWidget::getFileOrDefault ( const QString &  filename,
const QString &  type,
QString &  res 
)
protected

Method Description.

long BoardWidget::getGameNum ( )
inline

Method Description.

Returns
long gameGenerationNum
See also
gameGenerationNum

Definition at line 113 of file boardwidget.h.

QString BoardWidget::getLayoutName ( )

Method Description.

Returns
QString filename

Definition at line 1249 of file boardwidget.cpp.

void BoardWidget::helpMove ( )
slot

Slot Description.

Definition at line 493 of file boardwidget.cpp.

void BoardWidget::helpMoveStop ( )
slot

Slot Description.

Definition at line 527 of file boardwidget.cpp.

void BoardWidget::helpMoveTimeout ( )
slot

Slot Description.

Definition at line 508 of file boardwidget.cpp.

void BoardWidget::hilightTile ( POSITION &  Pos,
bool  on = true,
bool  refresh = true 
)
protected

Method Description.

Definition at line 770 of file boardwidget.cpp.

KGameCanvasItem * BoardWidget::itemAt ( const QPoint &  point) const
protected

Override the itemAt method of the KGameCanvasWidget.

We need this cause of corrections in the 3D simulated view with the stones, as the normal KGameCanvasWidget only supports 2D objects, and the thrown shadows should not be a part of the click event.

Parameters
pointthe point we click on the KGameCanvasWidget.

Definition at line 923 of file boardwidget.cpp.

bool BoardWidget::loadBackground ( const QString &  pszFileName,
bool  bShowError = true 
)
slot

Slot Description.

Returns
true if ...
false if ...

Definition at line 1048 of file boardwidget.cpp.

bool BoardWidget::loadBoard ( )
slot

Slot Description.

Returns
true if ...
false if ...

Definition at line 1035 of file boardwidget.cpp.

bool BoardWidget::loadBoardLayout ( const QString &  file)
slot

Slot Description.

Returns
true if ...
false if ...

Definition at line 1098 of file boardwidget.cpp.

void BoardWidget::loadSettings ( )
slot

Slot Description.

Definition at line 86 of file boardwidget.cpp.

bool BoardWidget::loadTileset ( const QString &  path)
slot

Slot Description.

Returns
true if ...
false if ...

Definition at line 1078 of file boardwidget.cpp.

void BoardWidget::matchAnimationTimeout ( )
slot

Slot Description.

Definition at line 627 of file boardwidget.cpp.

void BoardWidget::mousePressEvent ( QMouseEvent *  event)
protected

Method Description.

Definition at line 856 of file boardwidget.cpp.

void BoardWidget::pause ( )

Method Description.

Definition at line 448 of file boardwidget.cpp.

void BoardWidget::populateSpriteMap ( )
slot

Slot Description.

Definition at line 158 of file boardwidget.cpp.

void BoardWidget::putTileInBoard ( POSITION &  Pos,
bool  refresh = true 
)
protected

Method Description.

Definition at line 818 of file boardwidget.cpp.

void BoardWidget::redoMove ( )

Method Description.

Definition at line 658 of file boardwidget.cpp.

void BoardWidget::removeTile ( POSITION &  Pos,
bool  refresh = true 
)
protected

Method Description.

Definition at line 841 of file boardwidget.cpp.

int BoardWidget::requiredHeight ( )
protected

Method Description.

Returns
int blah blah

Definition at line 1135 of file boardwidget.cpp.

int BoardWidget::requiredHorizontalCells ( )
protected

Method Description.

Returns
int blah blah

Definition at line 1111 of file boardwidget.cpp.

int BoardWidget::requiredVerticalCells ( )
protected

Method Description.

Returns
int blah blah

Definition at line 1120 of file boardwidget.cpp.

int BoardWidget::requiredWidth ( )
protected

Method Description.

Returns
int blah blah

Definition at line 1127 of file boardwidget.cpp.

void BoardWidget::resizeEvent ( QResizeEvent *  event)
protectedvirtual

Virtual Method Description.

Definition at line 122 of file boardwidget.cpp.

void BoardWidget::resizeTileset ( const QSize &  wsize)
slot

Slot Description.

Definition at line 133 of file boardwidget.cpp.

void BoardWidget::saveSettings ( )
slot

Slot Description.

Definition at line 142 of file boardwidget.cpp.

void BoardWidget::setDisplayedWidth ( )
slot

Slot Description.

Definition at line 151 of file boardwidget.cpp.

void BoardWidget::setShowMatch ( bool  show)

Method Description.

Parameters
show

Definition at line 618 of file boardwidget.cpp.

void BoardWidget::setStatusText ( const QString &  pszText)
protected

Method Description.

Definition at line 1043 of file boardwidget.cpp.

void BoardWidget::shuffle ( )
slot

Slot Description.

Definition at line 1221 of file boardwidget.cpp.

void BoardWidget::startDemoMode ( )

Method Description.

Definition at line 536 of file boardwidget.cpp.

void BoardWidget::statusTextChanged ( const QString &  ,
long   
)
signal

Signal Description.

void BoardWidget::stopDemoMode ( )

Method Description.

Definition at line 549 of file boardwidget.cpp.

void BoardWidget::stopEndAnimation ( )
protected

Method Description.

Definition at line 703 of file boardwidget.cpp.

void BoardWidget::stopMatchAnimation ( )
protected

Method Description.

Definition at line 648 of file boardwidget.cpp.

void BoardWidget::tileNumberChanged ( int  iMaximum,
int  iCurrent,
int  iLeft 
)
signal

Signal Description.

void BoardWidget::transformPointToPosition ( const QPoint &  point,
POSITION &  MouseClickPos 
)
protected

Transform window point to board position.

Parameters
pointInput: Point in window coordinates
MouseClickPosOutput: Position in game board

Definition at line 971 of file boardwidget.cpp.

int BoardWidget::undoMove ( )

Method Description.

Returns
int blah blah redoMove()

Definition at line 470 of file boardwidget.cpp.

void BoardWidget::updateSpriteMap ( )
slot

Slot Description.

Definition at line 208 of file boardwidget.cpp.

bool BoardWidget::validMovesAvailable ( )
protected

This method test if any valid moves are available.

Returns
False if no valid move available, else true.

Definition at line 1238 of file boardwidget.cpp.

void BoardWidget::wheelEvent ( QWheelEvent *  event)
protectedvirtual

Overridden virtual method for wheel events.

Definition at line 1256 of file boardwidget.cpp.

Member Data Documentation

QTimer* BoardWidget::animateBackwardsTimer
protected

Definition at line 376 of file boardwidget.h.

QTimer* BoardWidget::animateForwardTimer
protected

Definition at line 375 of file boardwidget.h.

unsigned short BoardWidget::cheatsUsed
protected

Definition at line 356 of file boardwidget.h.

GameData* BoardWidget::Game

Definition at line 128 of file boardwidget.h.

long BoardWidget::gameGenerationNum
protected

Definition at line 357 of file boardwidget.h.

bool BoardWidget::gamePaused
protected

Definition at line 354 of file boardwidget.h.

int BoardWidget::iTimerStep
protected

Definition at line 349 of file boardwidget.h.

TileViewAngle BoardWidget::m_angle

Definition at line 127 of file boardwidget.h.

short BoardWidget::matchCount
protected

Definition at line 351 of file boardwidget.h.

POSITION BoardWidget::MouseClickPos1
protected

Definition at line 359 of file boardwidget.h.

POSITION BoardWidget::MouseClickPos2
protected

Definition at line 360 of file boardwidget.h.

bool BoardWidget::showHelp
protected

Definition at line 353 of file boardwidget.h.

bool BoardWidget::showMatch
protected

Definition at line 352 of file boardwidget.h.

QHash<TileCoord, TileSprite *> BoardWidget::spriteMap

Definition at line 133 of file boardwidget.h.

KMahjonggBackground BoardWidget::theBackground

Definition at line 130 of file boardwidget.h.

KMahjonggLayout BoardWidget::theBoardLayout

Definition at line 131 of file boardwidget.h.

KMahjonggTileset BoardWidget::theTiles

Definition at line 129 of file boardwidget.h.

QTimer* BoardWidget::timer
protected

Definition at line 374 of file boardwidget.h.

POSITION BoardWidget::TimerPos1
protected

Definition at line 361 of file boardwidget.h.

POSITION BoardWidget::TimerPos2
protected

Definition at line 362 of file boardwidget.h.

enum BoardWidget::STATES BoardWidget::TimerState
protected

The documentation for this class was generated from the following files:
  • boardwidget.h
  • boardwidget.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:33 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kmahjongg

Skip menu "kmahjongg"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdegames API Reference

Skip menu "kdegames API Reference"
  • granatier
  • kapman
  • kblackbox
  • kgoldrunner
  • kigo
  • kmahjongg
  • KShisen
  • ksquares
  • libkdegames
  •   highscore
  •   libkdegamesprivate
  •     kgame
  • libkmahjongg
  • palapeli
  •   libpala

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal