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

kblackbox

Public Types | Public Slots | Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
KBBScalableGraphicWidget Class Reference

#include <kbbscalablegraphicwidget.h>

Inheritance diagram for KBBScalableGraphicWidget:
Inheritance graph
[legend]

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

 KBBScalableGraphicWidget (KBBGameDoc *gameDoc, KBBThemeManager *themeManager, QAction *done)
 
 ~KBBScalableGraphicWidget ()
 
void addBall (int boxPosition)
 
void addBall (int boxPosition, int outsidePosition)
 
void addBallUnsure (const int boxPosition)
 
void addMarkerNothing (const int boxPosition)
 
void drawRay (const int borderPosition)
 
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)
 

Static Public Attributes

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

Protected Member Functions

void drawBackground (QPainter *painter, const QRectF &)
 

Detailed Description

Scalable graphic central widget for KBlackBox.

Definition at line 62 of file kbbscalablegraphicwidget.h.

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 130 of file kbbscalablegraphicwidget.cpp.

Member Function Documentation

void KBBScalableGraphicWidget::addBall ( int  boxPosition)

Definition at line 150 of file kbbscalablegraphicwidget.cpp.

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

Definition at line 156 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::addBallUnsure ( const int  boxPosition)

Definition at line 173 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::addMarkerNothing ( const int  boxPosition)

Definition at line 180 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::cursorAtNewPosition ( int  borderPosition)
slot

Definition at line 417 of file kbbscalablegraphicwidget.cpp.

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

Definition at line 493 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::drawRay ( const int  borderPosition)

Definition at line 191 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::keyboardEnter ( )
slot

Definition at line 434 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::keyboardMoveDown ( )
slot

Definition at line 446 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::keyboardMoveLeft ( )
slot

Definition at line 454 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::keyboardMoveRight ( )
slot

Definition at line 462 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::keyboardMoveUp ( )
slot

Definition at line 470 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::keyboardSpace ( )
slot

Definition at line 478 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::mouseBorderClick ( const int  borderPosition)

Definition at line 202 of file kbbscalablegraphicwidget.cpp.

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

Definition at line 210 of file kbbscalablegraphicwidget.cpp.

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

Definition at line 221 of file kbbscalablegraphicwidget.cpp.

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

Definition at line 241 of file kbbscalablegraphicwidget.cpp.

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

Definition at line 251 of file kbbscalablegraphicwidget.cpp.

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

Message to display.

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

Definition at line 292 of file kbbscalablegraphicwidget.cpp.

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

Definition at line 303 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::removeAllBalls ( )

Definition at line 351 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::removeBall ( const int  boxPosition)

Definition at line 359 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::removeRay ( )

Definition at line 372 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::resizeEvent ( QResizeEvent *  )

Definition at line 324 of file kbbscalablegraphicwidget.cpp.

QGraphicsScene * KBBScalableGraphicWidget::scene ( )

Definition at line 379 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::setPause ( bool  state)

Definition at line 312 of file kbbscalablegraphicwidget.cpp.

void KBBScalableGraphicWidget::setScore ( int  score)

Definition at line 385 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
continueGameSould the game continue after displaying the solution? (Yes for sandbox mode, no for normal game end).

Definition at line 391 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
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:44:09 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kblackbox

Skip menu "kblackbox"
  • 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