kword

KWPictureFrameSet.h
1/* This file is part of the KDE project
2 Copyright (C) 1998, 1999, 2000 Reginald Stadlbauer <reggie@kde.org>
3 Copyright (C) 2005 Thomas Zander <zander@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 frame_picture_frame_set_h
22#define frame_picture_frame_set_h
23
24#include "KWFrameSet.h"
25#include <KoPicture.h>
26
27class KWPictureFrameSet : public KWFrameSet
28{
29public:
30 KWPictureFrameSet( KWDocument *_doc, const TQString & name );
32 KWPictureFrameSet( KWDocument* doc, const TQDomElement& frame, const TQDomElement& imageTag, KoOasisContext& context );
33 virtual ~KWPictureFrameSet();
34
35 virtual KWordFrameSetIface* dcopObject();
36
41 virtual FrameSetType type() const;
42
43 void setPicture( const KoPicture &picture ) { m_picture = picture; }
44 KoPicture picture() const { return m_picture; }
45
46 KoPictureKey key() const { return m_picture.getKey(); }
47
48 void loadPicture( const TQString &fileName );
49 void insertPicture( const KoPicture& picture );
50
55 void reloadPicture( const KoPictureKey& key );
56
57 virtual TQDomElement save( TQDomElement &parentElem, bool saveFrames = true );
58 virtual void load( TQDomElement &attributes, bool loadFrames = true );
59 virtual void saveOasis( KoXmlWriter& writer, KoSavingContext& context, bool saveFrames ) const;
60
61 virtual void drawFrameContents( KWFrame * frame, TQPainter *painter, const TQRect & crect,
62 const TQColorGroup &cg, bool onlyChanged, bool resetChanged,
63 KWFrameSetEdit * edit, KWViewMode *viewMode );
64
66 virtual void createEmptyRegion( const TQRect &, TQRegion &, KWViewMode * ) { }
67
68#ifndef NDEBUG
69 virtual void printDebug( KWFrame* frame );
70#endif
71
72 bool keepAspectRatio() const;
73 void setKeepAspectRatio( bool b );
74
79 virtual void setProtectContent ( bool ) { };
84 virtual bool protectContent() const { return false; }
85
86protected:
87 void loadOasis( const TQDomElement& frame, const TQDomElement& imageTag, KoOasisContext& context );
88
90 KoPicture m_picture;
91 bool m_keepAspectRatio;
93 bool m_finalSize;
94};
95
96#endif
Class: KWFrameSet Base type, a frameset holds content as well as frames to show that content.
Definition KWFrameSet.h:62
virtual FrameSetType type() const
The type of frameset.
Definition KWFrameSet.h:76
KWFrame * frame(unsigned int _num) const
get a frame by number
TQString name() const
get/set frameset name. For tables in particular, this must be unique
Definition KWFrameSet.h:428