kword

KWTextImage.h
1/* This file is part of the KDE project
2 Copyright (C) 2001 David Faure <faure@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 kwtextimage_h
21#define kwtextimage_h
22
23#include <KoPictureKey.h>
24#include <KoPicture.h>
25
26#include <KWTextDocument.h>
27
33class KWTextImage : public KoTextCustomItem
34{
35public:
40 KWTextImage( KWTextDocument *textdoc, const TQString & filename );
42 {
43 // Remove image from collection ?
44 }
45
46 virtual Placement placement() const { return place; }
47 virtual void resize();
48 virtual int widthHint() const { return width; }
49 virtual int minimumWidth() const { return width; }
50
51 void setImage( const KoPictureCollection & collection );
52
53 KoPicture image() const { return m_image; }
54
55 virtual void drawCustomItem( TQPainter* p, int x, int y, int wpix, int hpix, int ascentpix, int cx, int cy, int cw, int ch, const TQColorGroup& cg, bool selected, int offset, bool drawingShadow );
56
57 // Save to XML
58 virtual void save( TQDomElement & formatElem );
59 virtual void saveOasis( KoXmlWriter&, KoSavingContext& ) const;
60 virtual int typeId() const { return 2; }
61
62 void load( TQDomElement & formatElem );
63
67 KoPictureKey getKey( void ) const;
68private:
69 Placement place;
70 KoPicture m_image;
71 TQSize m_size; // Size of image
72};
73
74#endif
This is our KoTextDocument reimplementation, to create KWTextParag instead of KoTextParags,...
This class is used by "Insert Picture", i.e.
Definition KWTextImage.h:34
KoPictureKey getKey(void) const
Get the key of the picture.