00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
#ifndef KBILLIARDS_H
00019
#define KBILLIARDS_H
00020
00021
#ifdef HAVE_CONFIG_H
00022
#include <config.h>
00023
#endif
00024
00025
#include <kapp.h>
00026
#include <qwidget.h>
00027
#include <kmainwindow.h>
00028
#include <ktoolbar.h>
00029
#include <kconfig.h>
00030
#include <qcanvas.h>
00031
#include <qlist.h>
00032
#include <qlcdnumber.h>
00033
00034
#include "edgeobject.h"
00035
#include "ball.h"
00036
#include "throwvector.h"
00037
#include "psettings.h"
00038
#include "configuration.h"
00039
#include "dlgscores.h"
00040
#include "mcanvas.h"
00041
#include "soundmodule.h"
00042
00043
class Ball;
00044
class EdgeObject;
00045
00047 class Kbilliards :
public KMainWindow
00048 {
00049 Q_OBJECT
00050
public:
00052
Kbilliards(QWidget* parent=0,
const char *name=0);
00054
~Kbilliards();
00056
void placeedgeobjects();
00058
void keyPressEvent( QKeyEvent * );
00060
void placeballs(
int,
int);
00062
void BallinHole(
int);
00064
void loadSettings();
00066
void winner();
00067 signals:
00069
void PBsignal(
int);
00070
public:
00072 Configuration defaultconfig;
00074 Configuration actualconfig;
00076 MusicConfiguration actualmusicconfig;
00078 KMenuBar * menu;
00080 KStatusBar * status;
00082 KToolBar * toolbar;
00084
ThrowVector * throwvector;
00086 QList<Ball> ingameballs;
00088 QList<Ball> outgameballs;
00090 QList<EdgeObject> edgeobjects;
00092
int Score;
00094 QLCDNumber * ScoreDisplay;
00096 bool PowerBarFlag;
00098
double MaxThrowPower;
00100 KConfigBase * config;
00102
int nextBallseq;
00104
bool ballinhole;
00106
bool checkballstatus;
00108
SoundModule *Music;
00109
protected:
00111 QCanvas * canvas;
00113 QCanvasView * BilliardArea;
00115 EdgeObject *
holetl;
00117 EdgeObject * holetc;
00119 EdgeObject * holetr;
00121 EdgeObject * holebl;
00123 EdgeObject * holebc;
00125 EdgeObject * holebr;
00127 Ball *
whiteball;
00130 int gamestatus;
00132
00133
public slots:
00135
void slotAbout();
00137
void slotAboutKDE();
00139
void throw_ball();
00141
void newGame();
00143
void confdialog();
00145
void saveSettings();
00147
void viewScores();
00149
void clock();
00150
protected:
00152
void timerEvent( QTimerEvent *);
00153
protected slots:
00155
void move_left_vector() ;
00157
void move_right_vector() ;
00158
private:
00160
int power;
00162 QString path_data;
00163 };
00164
00165
#endif