00001 /* Copyright (C) 2009 Väinö Lappi <djap84@gmail.com> 00002 00003 This program is free software; you can redistribute it and/or modify 00004 it under the terms of the GNU General Public License as published by 00005 the Free Software Foundation; either version 2 of the License, or 00006 (at your option) any later version. 00007 00008 This program is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 GNU General Public License for more details. 00012 00013 You should have received a copy of the GNU General Public License 00014 along with this program; if not, write to the Free Software 00015 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00016 00017 */ 00018 #ifndef __ANIMATIONENGINEAPI_H__ 00019 #define __ANIMATIONENGINEAPI_H__ 00020 00021 #include <QMutex> 00022 00030 class AnimationEngineAPI{ 00031 public: 00032 virtual ~AnimationEngineAPI(){} 00033 00039 virtual void startAnimation(QGraphicsScene *targetGraphicsScene) = 0; 00040 00050 virtual void startAnimationPreview(QGraphicsScene *targetGraphicsScene){ 00051 startAnimation(targetGraphicsScene); 00052 } 00053 00065 virtual void refreshMouseCoordinates(int x, int y){ 00066 iMouseCoordinatesMux.lock(); 00067 iMouseX = x; 00068 iMouseY = y; 00069 iMouseCoordinatesMux.unlock(); 00070 } 00071 00079 virtual void stopAndCleanUp() = 0; 00080 00090 virtual QString getAnimationName() = 0; 00091 00102 virtual QString getAnimationBg() = 0; 00103 00115 virtual void sceneSizeChanged(qint64 width, qint64 height){ 00116 iWidthAndHeightMux.lock(); 00117 iWidth = width; 00118 iHeight = height; 00119 iWidthAndHeightMux.unlock(); 00120 } 00121 protected: 00126 qint64 iWidth; 00131 qint64 iHeight; 00136 QMutex iWidthAndHeightMux; 00141 int iMouseX; 00146 int iMouseY; 00151 QMutex iMouseCoordinatesMux; 00152 }; 00153 00154 #endif // __ANIMATIONENGINEAPI_H__