2008-05-05 07:46:19 +00:00
|
|
|
//
|
|
|
|
|
// C++ Interface: mycardspixmaplabel
|
|
|
|
|
//
|
2011-02-11 20:02:08 +00:00
|
|
|
// Description:
|
2008-05-05 07:46:19 +00:00
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// Author: FThauer FHammer <f.thauer@web.de>, (C) 2007
|
|
|
|
|
//
|
|
|
|
|
// Copyright: See COPYING file that comes with this distribution
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
#ifndef MYCARDSPIXMAPLABEL_H
|
|
|
|
|
#define MYCARDSPIXMAPLABEL_H
|
|
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
|
|
#include <QtGui>
|
|
|
|
|
#include <QtCore>
|
|
|
|
|
|
|
|
|
|
class gameTableImpl;
|
|
|
|
|
|
|
|
|
|
class MyCardsPixmapLabel : public QLabel
|
|
|
|
|
{
|
2011-02-11 20:02:08 +00:00
|
|
|
Q_OBJECT
|
2008-05-05 07:46:19 +00:00
|
|
|
public:
|
2011-02-11 20:02:08 +00:00
|
|
|
MyCardsPixmapLabel(QGroupBox*);
|
2008-05-05 07:46:19 +00:00
|
|
|
|
2011-02-11 20:02:08 +00:00
|
|
|
~MyCardsPixmapLabel();
|
2008-05-05 07:46:19 +00:00
|
|
|
|
2011-02-11 20:02:08 +00:00
|
|
|
void setMyW ( gameTableImpl* theValue ) {
|
|
|
|
|
myW = theValue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void setIsFlipside(bool theValue) {
|
|
|
|
|
isFlipside = theValue;
|
|
|
|
|
}
|
|
|
|
|
bool getIsFlipside() const {
|
|
|
|
|
return isFlipside;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void setFadeOutAction(bool theValue) {
|
|
|
|
|
fadeOutAction = theValue;
|
|
|
|
|
}
|
|
|
|
|
bool getFadeOutAction() const {
|
|
|
|
|
return fadeOutAction;
|
|
|
|
|
}
|
2008-05-05 07:46:19 +00:00
|
|
|
|
|
|
|
|
void startFadeOut(int);
|
2011-02-11 20:02:08 +00:00
|
|
|
void stopFadeOut();
|
2008-05-05 07:46:19 +00:00
|
|
|
void startFlipCards(int, const QPixmap & , const QPixmap &);
|
|
|
|
|
void stopFlipCardsAnimation();
|
2011-02-11 20:02:08 +00:00
|
|
|
|
|
|
|
|
void setFlipsidePix(QPixmap p) {
|
|
|
|
|
flipside = p;
|
|
|
|
|
}
|
2010-07-22 12:12:57 +00:00
|
|
|
|
2008-05-05 07:46:19 +00:00
|
|
|
void paintEvent(QPaintEvent * event);
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
void signalFastFlipCards(bool);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public slots:
|
2011-02-11 20:02:08 +00:00
|
|
|
|
2008-05-05 07:46:19 +00:00
|
|
|
void setPixmap ( const QPixmap &, const bool );
|
2009-03-25 22:59:01 +00:00
|
|
|
void setHiddenFrontPixmap ( const QPixmap &);
|
2008-05-05 07:46:19 +00:00
|
|
|
|
|
|
|
|
void nextFadeOutFrame();
|
|
|
|
|
void nextFlipCardsFrame();
|
2011-02-11 20:02:08 +00:00
|
|
|
|
2008-05-05 07:46:19 +00:00
|
|
|
void fastFlipCards(bool front);
|
|
|
|
|
|
2011-02-11 20:02:08 +00:00
|
|
|
// void mouseMoveEvent ( QMouseEvent *);
|
|
|
|
|
|
2008-05-05 07:46:19 +00:00
|
|
|
void mousePressEvent ( QMouseEvent *);
|
|
|
|
|
void mouseReleaseEvent ( QMouseEvent *);
|
|
|
|
|
|
2011-02-11 20:02:08 +00:00
|
|
|
void setFront ( const QPixmap& theValue ) {
|
|
|
|
|
front = theValue;
|
|
|
|
|
}
|
2009-03-25 22:59:01 +00:00
|
|
|
|
2008-05-05 07:46:19 +00:00
|
|
|
|
2011-02-11 20:02:08 +00:00
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
gameTableImpl* myW;
|
2008-05-05 07:46:19 +00:00
|
|
|
|
|
|
|
|
qreal frameOpacity;
|
|
|
|
|
qreal opacityRaiseInterval;
|
|
|
|
|
|
|
|
|
|
qreal flipCardsScaleIntervall;
|
|
|
|
|
qreal frameFlipCardsAction1Size;
|
|
|
|
|
qreal frameFlipCardsAction2Size;
|
|
|
|
|
|
|
|
|
|
QTimer *fadeOutTimer;
|
2011-02-11 20:02:08 +00:00
|
|
|
QTimer *flipCardsTimer;
|
2008-05-05 07:46:19 +00:00
|
|
|
|
|
|
|
|
bool isFlipside;
|
|
|
|
|
bool fadeOutAction;
|
|
|
|
|
bool flipCardsAction1;
|
|
|
|
|
bool flipCardsAction2;
|
|
|
|
|
bool stopFlipCards;
|
2011-02-11 20:02:08 +00:00
|
|
|
|
|
|
|
|
bool mousePress;
|
|
|
|
|
bool fastFlipCardsFront;
|
2008-05-05 07:46:19 +00:00
|
|
|
|
|
|
|
|
QPixmap front;
|
|
|
|
|
QPixmap flipside;
|
|
|
|
|
QPixmap myHiddenFront;
|
|
|
|
|
|
2011-02-11 20:02:08 +00:00
|
|
|
friend class gameTableImpl;
|
2008-05-05 07:46:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|