okteta
abstractframerenderer.h
Go to the documentation of this file.00001 /* 00002 This file is part of the Okteta Kakao module, part of the KDE project. 00003 00004 Copyright 2007 Friedrich W. H. Kossebau <kossebau@kde.org> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Lesser General Public 00008 License as published by the Free Software Foundation; either 00009 version 2.1 of the License, or (at your option) version 3, or any 00010 later version accepted by the membership of KDE e.V. (or its 00011 successor approved by the membership of KDE e.V.), which shall 00012 act as a proxy defined in Section 6 of version 3 of the license. 00013 00014 This library is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public 00020 License along with this library. If not, see <http://www.gnu.org/licenses/>. 00021 */ 00022 00023 #ifndef ABSTRACTFRAMERENDERER_H 00024 #define ABSTRACTFRAMERENDERER_H 00025 00026 class QSize; 00027 class QPoint; 00028 class QRect; 00029 class QPainter; 00030 00031 // frame only horizontal duplicated or also vertical? 00032 class AbstractFrameRenderer 00033 { 00034 public: 00035 AbstractFrameRenderer(); 00036 virtual ~AbstractFrameRenderer(); 00037 00038 public: // API to be implemented 00039 // make this flags? 00040 // virtual bool hasFixedWidth() const = 0; 00041 // virtual bool hasFixedHeight() const = 0; 00042 virtual int height() const = 0; 00043 virtual int width() const = 0; 00044 // virtual QSize sizeHint( const QSize &maxSize ) const = 0; 00045 // only vertical for now... 00046 // virtual int framesCount() const = 0; 00047 00049 virtual void prepare() = 0; 00050 virtual void renderFrame( QPainter *painter, int frameIndex ) = 0; 00051 00052 public: 00053 void setPos( int x, int y ); 00054 void setPos( const QPoint &point ); 00055 00056 public: 00057 QPoint pos () const; 00058 QRect rect () const; 00059 QSize size () const; 00060 int x() const; 00061 int y() const; 00062 00063 protected: 00064 class Private; 00065 Private * const d; 00066 }; 00067 00068 #endif
KDE 4.2 API Reference