kpresenter

KPrGroupObject.h
1/* This file is part of the KDE project
2 Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
3 Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19*/
20
21#ifndef kpgroupobject_h
22#define kpgroupobject_h
23
24class KPrDocument;
25class KoOasisContext;
26class KPrPage;
27class KoXmlWriter;
28
29#include "KPrObject.h"
30
31class KPrGroupObject : public KPrObject
32{
33public:
34 KPrGroupObject();
35 KPrGroupObject( const TQPtrList<KPrObject> &objs );
36 virtual ~KPrGroupObject() {}
37
38 KPrGroupObject &operator=( const KPrGroupObject & );
39
40 virtual void setSize( double _width, double _height );
41 virtual void setOrig( const KoPoint &_point );
42 virtual void setOrig( double _x, double _y );
43 virtual void moveBy( const KoPoint &_point );
44 virtual void moveBy( double _dx, double _dy );
45
46 virtual void rotate( float _angle );
47 virtual void setShadowDistance( int _distance );
48 virtual void setShadowDirection( ShadowDirection _direction );
49 virtual void setShadowColor( const TQColor &_color );
50 virtual void setEffect( Effect _effect );
51 virtual void setEffect2( Effect2 _effect2 );
52 virtual void setAppearStep( int _appearStep );
53 virtual void setDisappear( bool b );
54 virtual void setDisappearStep( int _disappearStep );
55 virtual void setEffect3( Effect3 _effect3);
56 virtual void setAppearTimer( int _appearTimer );
57 virtual void setDisappearTimer( int _disappearTimer );
58 virtual void setAppearSoundEffect( bool b );
59 virtual void setDisappearSoundEffect( bool b );
60 virtual void setAppearSoundEffectFileName( const TQString &_a_fileName );
61 virtual void setDisappearSoundEffectFileName( const TQString &_d_fileName );
62
63 virtual void setShadowParameter(int _distance,ShadowDirection _direction,const TQColor &_color);
64
65 virtual ObjType getType() const
66 { return OT_GROUP; }
67 virtual TQString getTypeString() const
68 { return i18n("Group"); }
69
70 virtual TQDomDocumentFragment save( TQDomDocument& doc, double offset );
71 virtual double load(const TQDomElement &element, KPrDocument *doc);
72 virtual void loadOasisGroupObject( KPrDocument *doc, KPrPage * newpage, TQDomNode &element, KoOasisContext & context, KPrLoadingInfo *info);
73
74 virtual void draw( TQPainter *_painter, KoTextZoomHandler *_zoomhandler,
75 int pageNum, SelectionMode selectionMode, bool drawContour = false );
76
77 void addObjects( KPrObject * obj );
78
79 void setUpdateObjects( bool b )
80 { updateObjs = b; }
81
82 TQPtrList<KPrObject> getObjects()
83 { return objects; }
84 const TQPtrList<KPrObject> &objectList() const
85 { return objects; }
86 virtual void addTextObjects( TQPtrList<KoTextObject> & ) const;
87
88 void selectAllObj();
89 void deSelectAllObj();
90
91 virtual void setOwnClipping( bool _ownClipping );
92 virtual void setSubPresStep( int _subPresStep );
93 virtual void doSpecificEffects( bool _specEffects, bool _onlyCurrStep = true );
94 virtual void getAllObjectSelectedList(TQPtrList<KPrObject> &lst,bool force=false );
95
96 virtual void flip( bool horizontal );
97 virtual void removeFromObjList();
98 virtual void addToObjList();
99 virtual void incCmdRef();
100 virtual void decCmdRef();
101
102protected:
103 virtual const char * getOasisElementName() const;
104 virtual bool saveOasisObjectAttributes( KPOasisSaveContext &sc ) const;
105 virtual void saveOasisPosObject( KoXmlWriter &xmlWriter, int indexObj ) const;
106
107 void updateSizes( double fx, double fy );
108 void updateCoords( double dx, double dy );
109
110 TQPtrList<KPrObject> objects;
111 bool updateObjs;
112
113};
114
115#endif