scoresprite.h

Go to the documentation of this file.
00001 #ifndef SCORE_SPRITE_H
00002 #define SCORE_SPRITE_H
00003 /*
00004    This file is part of the KDE games kwin4 program
00005    Copyright (c) 2006 Martin Heni <kde@heni-online.de>
00006 
00007    This library is free software; you can redistribute it and/or
00008    modify it under the terms of the GNU Library General Public
00009    License as published by the Free Software Foundation; either
00010    version 2 of the License, or (at your option) any later version.
00011 
00012    This library is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015    Library General Public License for more details.
00016 
00017    You should have received a copy of the GNU Library General Public License
00018    along with this library; see the file COPYING.LIB.  If not, write to
00019    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020    Boston, MA 02110-1301, USA.
00021 */
00022 
00023 // Qt includes
00024 #include <QPointF>
00025 #include <QSizeF>
00026 #include <QGraphicsPixmapItem>
00027 #include <QGraphicsTextItem>
00028 
00029 
00030 // Local includes
00031 #include "thememanager.h"
00032 #include "pixmapsprite.h"
00033 
00034 
00037 class ScoreSprite : public PixmapSprite
00038 {
00039 
00040   public:
00048     ScoreSprite(QString id, ThemeManager* theme, int advancePeriod, int no, QGraphicsScene* scene);
00049     
00052     ~ScoreSprite();
00053 
00057     virtual void advance(int phase);
00058 
00062     virtual int type() const {return QGraphicsItem::UserType+10;}
00063 
00067     virtual void changeTheme();
00068 
00073     void setLevel(int level, int no);
00074     
00079     void setPlayerName(QString s,int no);
00080     
00085     void setWon(QString s,int no);
00086 
00091     void setDraw(QString s,int no);
00092     
00097     void setLoss(QString s,int no);
00098 
00103     void setBreak(QString s,int no);
00104     
00108     void setTurn(int no);
00109     
00114     void setInput(int device, int no);
00115 
00116   private:
00117     // Text for won
00118     QGraphicsTextItem* mWon[2];
00119 
00120     // Text for draw
00121     QGraphicsTextItem* mDraw[2];
00122 
00123     // Text for loss
00124     QGraphicsTextItem* mLoss[2];
00125 
00126     // Text for aborted games
00127     QGraphicsTextItem* mBreak[2];
00128 
00129     // Text for name of player
00130     QGraphicsTextItem* mName[2];
00131 
00132     // Sprite for the input device
00133     PixmapSprite* mInput[2];
00134 
00135     // Frame  number of the input device sprite
00136     int mInputFrame[2];
00137 
00138     // Whose' turn or -1 for nobody
00139     int mTurn;
00140 
00141 };
00142 
00143 #endif

Generated on Sun Mar 4 10:56:43 2007 for KWin4 by  doxygen 1.4.6