Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

PiecesTable Class Reference

#include </home/clem/local/src/opie/noncore/games/fifteen/fifteen.h>

Collaboration diagram for PiecesTable:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PiecesTable (QWidget *parent=0, const char *name=0)
 ~PiecesTable ()

Protected Slots

void slotConfigure ()
void slotCustomImage (const QString &str)
void slotRandomize ()
void slotReset ()

Protected Member Functions

void resizeEvent (QResizeEvent *)
void mousePressEvent (QMouseEvent *)
void paintCell (QPainter *, int row, int col)
void initImage ()
void initMap ()
void initColors ()
void randomizeMap ()
void checkwin ()
void readConfig ()
void writeConfig ()
void initPolygon (int w, int h, int x_of, int y_of)

Private Types

enum  MenuOp { mRandomize = 1, mReset = 2 }

Private Member Functions

void clear ()

Private Attributes

QString _image
QArray< int > _map
QArray< QColor > _colors
QArray< QPixmap * > _pixmap
QPopupMenu * _menu
bool _randomized
QPointArray light_border
QPointArray dark_border
FifteenConfigDialog_dialog

Member Enumeration Documentation

enum PiecesTable::MenuOp [private]
 

Enumeration values:
mRandomize 
mReset 

Definition at line 76 of file fifteen.h.


Constructor & Destructor Documentation

PiecesTable::PiecesTable QWidget *  parent = 0,
const char *  name = 0
 

Definition at line 88 of file fifteen.cpp.

References initColors(), and readConfig().

PiecesTable::~PiecesTable  ) 
 

Definition at line 107 of file fifteen.cpp.

References clear(), and writeConfig().


Member Function Documentation

void PiecesTable::checkwin  )  [protected]
 

Definition at line 402 of file fifteen.cpp.

References _map, _randomized, FALSE, i, items, and tr.

Referenced by mousePressEvent().

void PiecesTable::clear  )  [private]
 

Definition at line 162 of file fifteen.cpp.

References _pixmap, and i.

Referenced by slotCustomImage(), and ~PiecesTable().

void PiecesTable::initColors  )  [protected]
 

Definition at line 324 of file fifteen.cpp.

References _colors.

Referenced by PiecesTable().

void PiecesTable::initImage  )  [protected]
 

void PiecesTable::initMap  )  [protected]
 

Definition at line 332 of file fifteen.cpp.

References _map, _randomized, i, and items.

Referenced by mousePressEvent(), randomizeMap(), readConfig(), and slotReset().

void PiecesTable::initPolygon int  w,
int  h,
int  x_of,
int  y_of
[protected]
 

Definition at line 258 of file fifteen.cpp.

References dark_border, and light_border.

Referenced by slotCustomImage().

void PiecesTable::mousePressEvent QMouseEvent *   )  [protected]
 

Definition at line 431 of file fifteen.cpp.

References _map, _menu, checkwin(), col, initMap(), mRandomize, mReset, pos, randomizeMap(), row, and tr.

void PiecesTable::paintCell QPainter *  ,
int  row,
int  col
[protected]
 

Definition at line 276 of file fifteen.cpp.

References _map, _pixmap, background, and pos.

void PiecesTable::randomizeMap  )  [protected]
 

Definition at line 342 of file fifteen.cpp.

References _map, _randomized, col, initMap(), pos, and row.

Referenced by mousePressEvent(), and slotRandomize().

void PiecesTable::readConfig  )  [protected]
 

Definition at line 131 of file fifteen.cpp.

References _image, _map, _randomized, QValueList< T >::begin(), QValueList< T >::count(), QValueList< T >::end(), FALSE, i, initMap(), items, QString::null, Config::readBoolEntry(), Config::readEntry(), Config::readListEntry(), Config::readNumEntry(), and Config::setGroup().

Referenced by PiecesTable().

void PiecesTable::resizeEvent QResizeEvent *   )  [protected]
 

Definition at line 306 of file fifteen.cpp.

References _image, height, slotCustomImage(), and width.

Referenced by slotConfigure().

void PiecesTable::slotConfigure  )  [protected, slot]
 

Definition at line 524 of file fifteen.cpp.

References _dialog, _image, QPEApplication::execDialog(), l, resizeEvent(), FifteenConfigDialog::setGameboard(), FifteenConfigDialog::setImageSrc(), and slotReset().

void PiecesTable::slotCustomImage const QString str  )  [protected, slot]
 

Definition at line 174 of file fifteen.cpp.

References _colors, _image, _pixmap, clear(), col, dark_border, empty, f, height, image, initPolygon(), QString::isEmpty(), light_border, QString::null, QString::number(), p, pix, row, str, TRUE, and width.

Referenced by resizeEvent().

void PiecesTable::slotRandomize  )  [protected, slot]
 

Definition at line 420 of file fifteen.cpp.

References randomizeMap().

void PiecesTable::slotReset  )  [protected, slot]
 

Definition at line 425 of file fifteen.cpp.

References initMap().

Referenced by slotConfigure().

void PiecesTable::writeConfig  )  [protected]
 

Definition at line 113 of file fifteen.cpp.

References _image, _map, _randomized, QValueList< T >::append(), i, items, QString::number(), Config::setGroup(), and Config::writeEntry().

Referenced by ~PiecesTable().


Member Data Documentation

QArray<QColor> PiecesTable::_colors [private]
 

Definition at line 67 of file fifteen.h.

Referenced by initColors(), and slotCustomImage().

FifteenConfigDialog* PiecesTable::_dialog [private]
 

Definition at line 74 of file fifteen.h.

Referenced by slotConfigure().

QString PiecesTable::_image [private]
 

Definition at line 65 of file fifteen.h.

Referenced by readConfig(), resizeEvent(), slotConfigure(), slotCustomImage(), and writeConfig().

QArray<int> PiecesTable::_map [private]
 

Definition at line 66 of file fifteen.h.

Referenced by checkwin(), initMap(), mousePressEvent(), paintCell(), randomizeMap(), readConfig(), and writeConfig().

QPopupMenu* PiecesTable::_menu [private]
 

Definition at line 70 of file fifteen.h.

Referenced by mousePressEvent().

QArray<QPixmap*> PiecesTable::_pixmap [private]
 

Definition at line 68 of file fifteen.h.

Referenced by clear(), paintCell(), and slotCustomImage().

bool PiecesTable::_randomized [private]
 

Definition at line 71 of file fifteen.h.

Referenced by checkwin(), initMap(), randomizeMap(), readConfig(), and writeConfig().

QPointArray PiecesTable::dark_border [private]
 

Definition at line 73 of file fifteen.h.

Referenced by initPolygon(), and slotCustomImage().

QPointArray PiecesTable::light_border [private]
 

Definition at line 72 of file fifteen.h.

Referenced by initPolygon(), and slotCustomImage().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:44:39 2005 for OPIE by  doxygen 1.4.2