|
Canorus
0.7
|
00001 00008 #ifndef VIEWPORT_H 00009 #define VIEWPORT_H 00010 00011 #include <QWidget> 00012 00013 class QCloseEvent; 00014 00015 class CAViewPort : public QWidget { 00016 Q_OBJECT 00017 00018 public: 00019 CAViewPort(QWidget *parent=0); 00020 00021 virtual ~CAViewPort(); 00022 00023 enum CAViewPortType { 00024 ScoreViewPort, 00025 SourceViewPort 00026 }; 00027 00028 inline CAViewPortType viewPortType() { return _viewPortType; } 00029 00030 virtual CAViewPort *clone() = 0; 00031 virtual CAViewPort *clone(QWidget *parent) = 0; 00032 00033 virtual void rebuild() = 0; 00034 00035 static const int DEFAULT_VIEWPORT_WIDTH; 00036 static const int DEFAULT_VIEWPORT_HEIGHT; 00037 00038 protected slots: 00039 void mousePressEvent(QMouseEvent *e); 00040 inline void closeEvent(QCloseEvent*) { emit closed(this); } 00041 00042 signals: 00043 void clicked(); 00044 void closed(CAViewPort*); 00045 00046 protected: 00047 inline void setViewPortType(CAViewPortType t) { _viewPortType = t; } 00048 00050 // General properties // 00052 CAViewPortType _viewPortType; 00053 }; 00054 #endif
1.8.0