kpresenter

KPrObjectProperties.h

00001 // -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
00002 /* This file is part of the KDE project
00003    Copyright (C) 2005-2006 Thorsten Zachmann <zachmann@kde.org>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef KPOBJECTPROPERTIES_H
00022 #define KPOBJECTPROPERTIES_H
00023 
00024 #include "KPrCommand.h"
00025 
00026 class KPrObjectProperties
00027 {
00028 public:
00029     enum PropertyType {
00030         PtPen = 1,
00031         PtLineEnds = 2,
00032         PtBrush = 4,
00033         PtPie = 8,
00034         PtPicture = 16,
00035         PtPolygon = 32,
00036         PtRectangle = 64,
00037         PtText = 128,
00038         PtOther = 256,
00039         PtPenWidth = 512    
00040     };
00041 
00042     KPrObjectProperties( const QPtrList<KPrObject> &objects );
00043     ~KPrObjectProperties();
00044 
00045     int getPropertyFlags() { return m_flags; }
00046 
00048     KoPenCmd::Pen getPen() const { return m_pen; }
00050     KPrBrushCmd::Brush getBrush() const { return m_brush; }
00052     KPrRectValueCmd::RectValues getRectValues() const { return m_rectValues; }
00054     KPrPolygonSettingCmd::PolygonSettings getPolygonSettings() const { return m_polygonSettings; }
00056     KPrPieValueCmd::PieValues getPieValues() const { return m_pieValues; }
00057     // get picture properties
00058     KPrPictureSettingCmd::PictureSettings getPictureSettings() const { return m_pictureSettings; }
00059     const QPixmap &getPixmap() const { return m_pixmap; }
00061     MarginsStruct getMarginsStruct() { return m_marginsStruct; }
00062     PropValue getProtectContent() { return m_protectContent; }
00063 
00064 protected:
00065     void getProperties( const QPtrList<KPrObject> &objects );
00066 
00067     void getPenProperties( KPrObject *object );
00068     void getLineEndsProperties( KPrObject *object );
00069     void getBrushProperties( KPrObject *object );
00070     void getRectProperties( KPrObject *object );
00071     void getPolygonSettings( KPrObject *object );
00072     void getPieProperties( KPrObject *object );
00073     void getPictureProperties( KPrObject *object );
00074     void getTextProperties( KPrObject *object );
00075 
00076 private:
00077     QPtrList<KPrObject> m_objects;
00078     int m_flags;
00079 
00081     KoPenCmd::Pen m_pen;
00083     KPrBrushCmd::Brush m_brush;
00085     KPrRectValueCmd::RectValues m_rectValues;
00087     KPrPolygonSettingCmd::PolygonSettings m_polygonSettings;
00089     KPrPieValueCmd::PieValues m_pieValues;
00091     KPrPictureSettingCmd::PictureSettings m_pictureSettings;
00092     QPixmap m_pixmap;
00094     MarginsStruct m_marginsStruct;
00095     PropValue m_protectContent;
00096 };
00097 
00098 #endif /* KPOBJECTPROPERTIES_H */
KDE Home | KDE Accessibility Home | Description of Access Keys