File indexing completed on 2024-05-05 17:59:05

0001 /*
0002     This file is part of the Okteta Kasten module, made within the KDE community.
0003 
0004     SPDX-FileCopyrightText: 2007 Friedrich W. H. Kossebau <kossebau@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 
0009 #ifndef FRAMESPRINT_ABSTRACTFRAMERENDERER_HPP
0010 #define FRAMESPRINT_ABSTRACTFRAMERENDERER_HPP
0011 
0012 #include <QScopedPointer>
0013 
0014 class QSize;
0015 class QPoint;
0016 class QRect;
0017 class QPainter;
0018 
0019 // frame only horizontal duplicated or also vertical?
0020 class AbstractFrameRenderer
0021 {
0022 public:
0023     AbstractFrameRenderer();
0024     AbstractFrameRenderer(const AbstractFrameRenderer&) = delete;
0025 
0026     virtual ~AbstractFrameRenderer();
0027 
0028     AbstractFrameRenderer& operator=(const AbstractFrameRenderer&) = delete;
0029 
0030 public: // API to be implemented
0031     // make this flags?
0032 //     virtual bool hasFixedWidth() const = 0;
0033 //     virtual bool hasFixedHeight() const = 0;
0034     virtual int height() const = 0;
0035     virtual int width() const = 0;
0036 //     virtual QSize sizeHint( const QSize &maxSize ) const = 0;
0037     // only vertical for now...
0038 //     virtual int framesCount() const = 0;
0039 
0040     /** painting will start, fix all things like Time and Data */
0041     virtual void prepare() = 0;
0042     virtual void renderFrame(QPainter* painter, int frameIndex) = 0;
0043 
0044 public:
0045     void setPos(int x, int y);
0046     void setPos(QPoint point);
0047 
0048 public:
0049     QPoint pos () const;
0050     QRect rect () const;
0051     QSize size () const;
0052     int x() const;
0053     int y() const;
0054 
0055 private:
0056     QScopedPointer<class AbstractFrameRendererPrivate> const d;
0057 };
0058 
0059 #endif