kpresenter

KPrObjectProperties.h
1/* This file is part of the KDE project
2 Copyright (C) 2005-2006 Thorsten Zachmann <zachmann@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef KPOBJECTPROPERTIES_H
21#define KPOBJECTPROPERTIES_H
22
23#include "KPrCommand.h"
24
25class KPrObjectProperties
26{
27public:
28 enum PropertyType {
29 PtPen = 1,
30 PtLineEnds = 2,
31 PtBrush = 4,
32 PtPie = 8,
33 PtPicture = 16,
34 PtPolygon = 32,
35 PtRectangle = 64,
36 PtText = 128,
37 PtOther = 256,
38 PtPenWidth = 512
39 };
40
41 KPrObjectProperties( const TQPtrList<KPrObject> &objects );
42 ~KPrObjectProperties();
43
44 int getPropertyFlags() { return m_flags; }
45
47 KoPenCmd::Pen getPen() const { return m_pen; }
49 KPrBrushCmd::Brush getBrush() const { return m_brush; }
51 KPrRectValueCmd::RectValues getRectValues() const { return m_rectValues; }
53 KPrPolygonSettingCmd::PolygonSettings getPolygonSettings() const { return m_polygonSettings; }
55 KPrPieValueCmd::PieValues getPieValues() const { return m_pieValues; }
56 // get picture properties
57 KPrPictureSettingCmd::PictureSettings getPictureSettings() const { return m_pictureSettings; }
58 const TQPixmap &getPixmap() const { return m_pixmap; }
60 MarginsStruct getMarginsStruct() { return m_marginsStruct; }
61 PropValue getProtectContent() { return m_protectContent; }
62
63protected:
64 void getProperties( const TQPtrList<KPrObject> &objects );
65
66 void getPenProperties( KPrObject *object );
67 void getLineEndsProperties( KPrObject *object );
68 void getBrushProperties( KPrObject *object );
69 void getRectProperties( KPrObject *object );
70 void getPolygonSettings( KPrObject *object );
71 void getPieProperties( KPrObject *object );
72 void getPictureProperties( KPrObject *object );
73 void getTextProperties( KPrObject *object );
74
75private:
76 TQPtrList<KPrObject> m_objects;
77 int m_flags;
78
80 KoPenCmd::Pen m_pen;
82 KPrBrushCmd::Brush m_brush;
84 KPrRectValueCmd::RectValues m_rectValues;
86 KPrPolygonSettingCmd::PolygonSettings m_polygonSettings;
88 KPrPieValueCmd::PieValues m_pieValues;
90 KPrPictureSettingCmd::PictureSettings m_pictureSettings;
91 TQPixmap m_pixmap;
93 MarginsStruct m_marginsStruct;
94 PropValue m_protectContent;
95};
96
97#endif /* KPOBJECTPROPERTIES_H */