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

kblackbox

KBBScalableGraphicWidget Class Reference

#include <kbbscalablegraphicwidget.h>

Inheritance diagram for KBBScalableGraphicWidget:

Inheritance graph
[legend]

List of all members.


Detailed Description

Scalable graphic central widget for KBlackBox.

Definition at line 62 of file kbbscalablegraphicwidget.h.


Public Types

enum  itemType {
  background = 0, informationBackground = 1, blackbox = 2, blackboxGrid = 3,
  tutorialMarker = 4, markerNothing = 5, solutionRay = 6, playerRay = 7,
  resultBackground = 8, resultBackgroundHighlight = 9, resultReflection = 10, resultHit = 11,
  resultText = 12, solutionBall = 13, playerBall = 14, unsureBall = 15,
  wrongPlayerBall = 16, rightPlayerBall = 17, interactionInfoDeflection = 18, interactionInfoHit = 19,
  interactionInfoNothing = 20, interactionInfoReflection = 21, interactionInfoReflectionSym = 22, laser0 = 23,
  laser90 = 24, laser180 = 25, laser270 = 26, cursor = 27
}

Public Slots

void cursorAtNewPosition (int borderPosition)
void keyboardEnter ()
void keyboardMoveDown ()
void keyboardMoveLeft ()
void keyboardMoveRight ()
void keyboardMoveUp ()
void keyboardSpace ()

Public Member Functions

void addBall (int boxPosition, int outsidePosition)
void addBall (int boxPosition)
void addBallUnsure (const int boxPosition)
void addMarkerNothing (const int boxPosition)
void drawRay (const int borderPosition)
 KBBScalableGraphicWidget (KBBGameDoc *gameDoc, KBBThemeManager *themeManager, QAction *done)
void mouseBorderClick (const int borderPosition)
void mouseBoxClick (const Qt::MouseButton button, int boxPosition)
int moveBall (const int boxPositionFrom, const int boxPositionTo)
int moveMarkerNothing (const int boxPositionFrom, const int boxPositionTo)
void newGame (int columns, int rows, int ballNumber)
void popupText (const QString &text, int time=5000)
int positionAfterMovingBall (const int boxPositionFrom, const int boxPositionTo) const
void removeAllBalls ()
void removeBall (const int boxPosition)
void removeRay ()
void resizeEvent (QResizeEvent *)
QGraphicsScene * scene ()
void setPause (bool state)
void setScore (int score)
void solve (const bool continueGame)
 ~KBBScalableGraphicWidget ()

Static Public Attributes

static int const BORDER_SIZE = 50
static int const RATIO = 25

Protected Member Functions

void drawBackground (QPainter *painter, const QRectF &)

Member Enumeration Documentation

enum KBBScalableGraphicWidget::itemType

Every graphic items.

Values are used to define the relative heigths between the displayed graphic items.

See also:
KBBThemeManager::zValue(const KBBScalableGraphicWidget::itemType itemType);
Enumerator:
background 
informationBackground 
blackbox 
blackboxGrid 
tutorialMarker 
markerNothing 
solutionRay 
playerRay 
resultBackground 
resultBackgroundHighlight 
resultReflection 
resultHit 
resultText 
solutionBall 
playerBall 
unsureBall 
wrongPlayerBall 
rightPlayerBall 
interactionInfoDeflection 
interactionInfoHit 
interactionInfoNothing 
interactionInfoReflection 
interactionInfoReflectionSym 
laser0 
laser90 
laser180 
laser270 
cursor 

Definition at line 89 of file kbbscalablegraphicwidget.h.


Constructor & Destructor Documentation

KBBScalableGraphicWidget::KBBScalableGraphicWidget ( KBBGameDoc *  gameDoc,
KBBThemeManager *  themeManager,
QAction *  done 
) [explicit]

Constructor.

Definition at line 67 of file kbbscalablegraphicwidget.cpp.

KBBScalableGraphicWidget::~KBBScalableGraphicWidget (  ) 

Definition at line 131 of file kbbscalablegraphicwidget.cpp.


Member Function Documentation

void KBBScalableGraphicWidget::addBall ( int  boxPosition,
int  outsidePosition 
)

Definition at line 157 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::addBall ( int  boxPosition  ) 

Definition at line 151 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::addBallUnsure ( const int  boxPosition  ) 

Definition at line 174 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::addMarkerNothing ( const int  boxPosition  ) 

Definition at line 181 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::cursorAtNewPosition ( int  borderPosition  )  [slot]

Definition at line 422 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::drawBackground ( QPainter *  painter,
const QRectF &   
) [protected]

Reimplemented from QGraphicsView.

Definition at line 498 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::drawRay ( const int  borderPosition  ) 

Definition at line 192 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::keyboardEnter (  )  [slot]

Definition at line 439 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::keyboardMoveDown (  )  [slot]

Definition at line 451 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::keyboardMoveLeft (  )  [slot]

Definition at line 459 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::keyboardMoveRight (  )  [slot]

Definition at line 467 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::keyboardMoveUp (  )  [slot]

Definition at line 475 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::keyboardSpace (  )  [slot]

Definition at line 483 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::mouseBorderClick ( const int  borderPosition  ) 

Definition at line 203 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::mouseBoxClick ( const Qt::MouseButton  button,
int  boxPosition 
)

Definition at line 211 of file kbbscalablegraphicwidget.cpp.

int KBBScalableGraphicWidget::moveBall ( const int  boxPositionFrom,
const int  boxPositionTo 
)

Definition at line 222 of file kbbscalablegraphicwidget.cpp.

int KBBScalableGraphicWidget::moveMarkerNothing ( const int  boxPositionFrom,
const int  boxPositionTo 
)

Definition at line 242 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::newGame ( int  columns,
int  rows,
int  ballNumber 
)

Definition at line 252 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::popupText ( const QString &  text,
int  time = 5000 
)

Message to display.

Parameters:
text Message. Attention: Message should not be too wide.
time Time (in ms) the message remains displayed. 0 = forever.

Definition at line 293 of file kbbscalablegraphicwidget.cpp.

int KBBScalableGraphicWidget::positionAfterMovingBall ( const int  boxPositionFrom,
const int  boxPositionTo 
) const

Definition at line 304 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::removeAllBalls (  ) 

Definition at line 352 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::removeBall ( const int  boxPosition  ) 

Definition at line 360 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::removeRay (  ) 

Definition at line 373 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::resizeEvent ( QResizeEvent *   ) 

Definition at line 325 of file kbbscalablegraphicwidget.cpp.

QGraphicsScene * KBBScalableGraphicWidget::scene (  ) 

Reimplemented from QGraphicsView.

Definition at line 380 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::setPause ( bool  state  ) 

Definition at line 313 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::setScore ( int  score  ) 

Definition at line 386 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::solve ( const bool  continueGame  ) 

display the solution

Used at the end of the game and for the sandbox mode.

Parameters:
continueGame Sould the game continue after displaying the solution? (Yes for sandbox mode, no for normal game end).

Definition at line 396 of file kbbscalablegraphicwidget.cpp.


Member Data Documentation

int const KBBScalableGraphicWidget::BORDER_SIZE = 50 [static]

Distance between the black box and the widget border.

Note: The widget is scalable, so it's just an arbitrary default compared with other ranges. It's the minimal distance as the width/height ratio is constant and the widget may have another width/height ratio.

See also:
RATIO

Definition at line 74 of file kbbscalablegraphicwidget.h.

int const KBBScalableGraphicWidget::RATIO = 25 [static]

Width and height of a single square on the black box.

Note: The widget is scalable, so it's just an arbitrary default compared with other ranges.

Definition at line 81 of file kbbscalablegraphicwidget.h.


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

kblackbox

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

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