File indexing completed on 2024-05-12 15:56:47

0001 /* This file is part of the KDE project
0002  * SPDX-FileCopyrightText: 2008 Jan Hambrecht <jaham@gmx.net>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 
0007 #ifndef KOSHAPEBACKGROUND_H
0008 #define KOSHAPEBACKGROUND_H
0009 
0010 #include "kritaflake_export.h"
0011 
0012 #include <QtGlobal>
0013 
0014 class QSizeF;
0015 class QPainter;
0016 class QPainterPath;
0017 class KoShapeSavingContext;
0018 
0019 /**
0020  * This is the base class for shape backgrounds.
0021  * Derived classes are used to paint the background of
0022  * a shape within a given painter path.
0023  */
0024 class KRITAFLAKE_EXPORT KoShapeBackground
0025 {
0026 public:
0027     KoShapeBackground();
0028     virtual ~KoShapeBackground();
0029 
0030     /// Paints the background using the given fill path
0031     virtual void paint(QPainter &painter, const QPainterPath &fillPath) const = 0;
0032 
0033     /// Returns if the background has some transparency.
0034     virtual bool hasTransparency() const;
0035 
0036     virtual bool compareTo(const KoShapeBackground *other) const = 0;
0037 
0038     virtual explicit operator bool() const { return true; }
0039 
0040 };
0041 
0042 #endif // KOSHAPEBACKGROUND_H