kword

KWPartFrameSet.h
1/* This file is part of the KDE project
2 Copyright (C) 2002 David Faure <faure@kde.org>
3 Copyright (C) 2005 Thomas Zander <zander@kde.org>
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License version 2, as published by the Free Software Foundation.
8
9 This program 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 program; see the file COPYING. 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 KWPARTFRAMESET_H
21#define KWPARTFRAMESET_H
22
23#include "KWFrameSet.h"
24class KWDocumentChild;
30{
31 TQ_OBJECT
32
33public:
34 KWPartFrameSet( KWDocument *_doc, KWDocumentChild *_child, const TQString & name );
35
37 KWPartFrameSet( KWDocument* doc, const TQDomElement& frameTag,
38 const TQDomElement& objectTag, KoOasisContext& context );
39
40 virtual ~KWPartFrameSet();
41
42 virtual KWordFrameSetIface* dcopObject();
43
44
48 virtual FrameSetType type() const { return FT_PART; }
49
51
52 KWDocumentChild *getChild() const { return m_child; }
53 void setChild( KWDocumentChild* child );
54
59
60 virtual void drawFrameContents( KWFrame * frame, TQPainter *painter, const TQRect & fcrect,
61 const TQColorGroup &cg, bool onlyChanged, bool resetChanged,
62 KWFrameSetEdit * edit, KWViewMode *viewMode );
63
64 virtual void createEmptyRegion( const TQRect &crect, TQRegion &emptyRegion, KWViewMode *viewMode );
65
66 virtual TQDomElement save( TQDomElement &parentElem, bool saveFrames = true );
67 virtual void load( TQDomElement &attributes, bool loadFrames = true );
68 virtual void saveOasis( KoXmlWriter& writer, KoSavingContext& context, bool saveFrames ) const;
69
70
75 void startEditing();
80 void endEditing();
81
87 virtual void moveFloatingFrame( int frameNum, const KoPoint &position );
88
89#ifndef NDEBUG
90 virtual void printDebug();
91#endif
92
99 void deleteFrame( unsigned int num, bool remove = true, bool recalc = true );
100
101 void setDeleted( bool on = true );
102
103 virtual void storeInternal();
104
105 virtual void setProtectContent ( bool protect ) { m_protectContent = protect; }
106 virtual bool protectContent() const { return m_protectContent; }
107
108private slots:
109 void slotChildChanged();
110
111private:
112 KWDocumentChild *m_child;
113 KWFramePartMoveCommand *m_cmdMoveChild;
114 bool m_protectContent;
115};
116
117#if 0
118class KWPartFrameSetEdit : public TQObject, public KWFrameSetEdit
119{
120 //TQ_OBJECT
121
122public:
123 KWPartFrameSetEdit( KWPartFrameSet * fs, KWCanvas * canvas );
124 virtual ~KWPartFrameSetEdit();
125
126 virtual DCOPObject* dcopObject();
127
128
129 KWPartFrameSet * partFrameSet() const
130 {
131 return static_cast<KWPartFrameSet*>(frameSet());
132 }
133
134 // Events forwarded by the canvas (when being in "edit" mode)
135 //virtual void mousePressEvent( TQMouseEvent *, const TQPoint &, const KoPoint & );
136 //virtual void mouseDoubleClickEvent( TQMouseEvent *, const TQPoint &, const KoPoint & );
137//private slots:
138 void slotChildActivated(bool);
139private:
140 DCOPObject *m_dcop;
141};
142#endif
143
144#include <KoDocumentChild.h>
145class KWDocument;
146
147/******************************************************************/
148/* Class: KWDocumentChild */
149/******************************************************************/
150class KWDocumentChild : public KoDocumentChild
151{
152public:
153 KWDocumentChild( KWDocument *_wdoc, const TQRect& _rect, KoDocument *_doc );
154 KWDocumentChild( KWDocument *_wdoc );
155 ~KWDocumentChild();
156
157 KWDocument* parent()const
158 { return m_pKWordDoc; }
159
160 virtual void setDocument( KoDocument *doc, const TQRect &geometry );
161
162 void setPartFrameSet( KWPartFrameSet* fs ) { m_partFrameSet = fs; }
163 KWPartFrameSet * partFrameSet() const { return m_partFrameSet; }
164 virtual KoDocument* hitTest( const TQPoint& p, const TQWMatrix& _matrix = TQWMatrix() );
165
166private:
167 KWDocument *m_pKWordDoc;
168 KWPartFrameSet *m_partFrameSet;
169};
170
171#endif // KWPARTFRAMESET_H
Class: KWCanvas This class is responsible for the rendering of the frames to the screen as well as th...
Definition KWCanvas.h:61
Command created when one part is moved or resized.
Definition KWCommand.h:317
This object is created to edit a particular frameset in a particular view The view's canvas creates i...
Class: KWFrameSet Base type, a frameset holds content as well as frames to show that content.
Definition KWFrameSet.h:62
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
This class represents a single frame.
Definition KWFrame.h:68
A frameset that contains an embedded object (a KWDocumentChild)
virtual void createEmptyRegion(const TQRect &crect, TQRegion &emptyRegion, KWViewMode *viewMode)
Let the caller know which parts of emptyRegion we do not claim, and thus the caller is free to paint ...
virtual void drawFrameContents(KWFrame *frame, TQPainter *painter, const TQRect &fcrect, const TQColorGroup &cg, bool onlyChanged, bool resetChanged, KWFrameSetEdit *edit, KWViewMode *viewMode)
Implement this one instead of drawFrame to benefit from double-buffering AND transparency handling (p...
virtual void load(TQDomElement &attributes, bool loadFrames=true)
load from XML - when loading
void updateChildGeometry()
Update the geometry of m_child based on the geometry of the frame.
virtual void moveFloatingFrame(int frameNum, const KoPoint &position)
Move the frame 'frameNum' to the given position and move the document child window with it This is ca...
void startEditing()
Called by KWView when the object is being edited (activated).
virtual TQDomElement save(TQDomElement &parentElem, bool saveFrames=true)
save to XML - when saving
void endEditing()
Called by KWView when the object is not being edited anymore (deactivated).
virtual void saveOasis(KoXmlWriter &writer, KoSavingContext &context, bool saveFrames) const
Save to OASIS format.
void deleteFrame(unsigned int num, bool remove=true, bool recalc=true)
Delete a frame from the set of frames this frameSet has.
virtual KWFrameSetEdit * createFrameSetEdit(KWCanvas *)
Create a framesetedit object to edit this frameset in canvas.
virtual FrameSetType type() const
The type of frameset.
Abstract base class for KWCanvas's view modes.
Definition KWViewMode.h:48