File indexing completed on 2024-04-21 05:53:49

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 // Std
0013 #include <memory>
0014 
0015 class QSize;
0016 class QPoint;
0017 class QRect;
0018 class QPainter;
0019 
0020 // frame only horizontal duplicated or also vertical?
0021 class AbstractFrameRenderer
0022 {
0023 public:
0024     AbstractFrameRenderer();
0025     AbstractFrameRenderer(const AbstractFrameRenderer&) = delete;
0026 
0027     virtual ~AbstractFrameRenderer();
0028 
0029     AbstractFrameRenderer& operator=(const AbstractFrameRenderer&) = delete;
0030 
0031 public: // API to be implemented
0032     // make this flags?
0033 //     virtual bool hasFixedWidth() const = 0;
0034 //     virtual bool hasFixedHeight() const = 0;
0035     virtual int height() const = 0;
0036     virtual int width() const = 0;
0037 //     virtual QSize sizeHint( const QSize &maxSize ) const = 0;
0038     // only vertical for now...
0039 //     virtual int framesCount() const = 0;
0040 
0041     /** painting will start, fix all things like Time and Data */
0042     virtual void prepare() = 0;
0043     virtual void renderFrame(QPainter* painter, int frameIndex) = 0;
0044 
0045 public:
0046     void setPos(int x, int y);
0047     void setPos(QPoint point);
0048 
0049 public:
0050     QPoint pos () const;
0051     QRect rect () const;
0052     QSize size () const;
0053     int x() const;
0054     int y() const;
0055 
0056 private:
0057     const std::unique_ptr<class AbstractFrameRendererPrivate> d;
0058 };
0059 
0060 #endif