KWFrameSet.cpp
82 //kdDebug(32001) << k_funcinfo << name() << " adding frame" << frame << " recalc=" << recalc << endl;
95 //kdDebug(32001) << k_funcinfo << name() << " deleting frame" << num << " remove=" << remove << " recalc=" << recalc << endl; //kdBacktrace();
160void KWFrameSet::createEmptyRegion( const TQRect & crect, TQRegion & emptyRegion, KWViewMode *viewMode )
174 //kdDebug(32001) << "KWFrameSet::createEmptyRegion outerRect=" << outerRect << " crect=" << crect << endl;
187void KWFrameSet::drawPadding( KWFrame *frame, TQPainter *p, const TQRect &crect, const TQColorGroup &, KWViewMode *viewMode )
237void KWFrameSet::drawFrameBorder( TQPainter *painter, KWFrame *frame, KWFrame *settingsFrame, const TQRect &crect, KWViewMode *viewMode )
306void KWFrameSet::setAnchored( KWTextFrameSet* textfs, int paragId, int index, bool placeHolderExists /* = false */, bool repaint )
314void KWFrameSet::setAnchored( KWTextFrameSet* textfs, KoTextParag* parag, int index, bool placeHolderExists /* = false */, bool repaint )
316 kdDebug(32001) << "KWFrameSet::setAnchored " << textfs << " " << parag->paragId() << " " << index << " " << placeHolderExists << endl;
322 KWFrameList::createFrameList(textfs, m_doc); // remove ourselves from others list now we are inline
383void KWFrameSet::createAnchors( KoTextParag * parag, int index, bool placeHolderExists /*= false */ /*only used when loading*/,
394 KWAnchor * anchor = createAnchor( m_anchorTextFs->textDocument(), frameFromPtr( frameIt.current() ) );
690 kdDebug(32002) << "KWFrameSet::drawFrameAndBorders " << name() << " frame " << frameFromPtr( frame ) << " " << frame << " isn't valid" << endl;
698 kdDebug(32001) << "KWFrameSet::drawFrameAndBorders " << name() << " frame " << frameFromPtr( frame ) << " " << *frame << endl;
699 kdDebug(32001) << " (outer) normalFrameRect=" << normalOuterFrameRect << " frameRect=" << outerFrameRect << endl;
700 kdDebug(32001) << " crect=" << crect << " intersec=" << outerCRect << " todraw=" << !outerCRect.isEmpty() << endl;
722 kdDebug(32001) << " (inner) normalFrameRect=" << normalInnerFrameRect << " frameRect=" << innerFrameRect << endl;
723 //kdDebug(32001) << " crect after view-to-normal:" << fcrect << "." << " Will move by (" << -offsetX << ", -(" << normalInnerFrameRect.top() << "-" << m_doc->zoomItY(frame->internalY()) << ") == " << -offsetY << ")." << endl;
732 kdDebug(32001) << "KWFrameSet::drawFrameAndBorders in frame coords:" << fcrect << ". Will translate painter by intersec-fcrect: " << innerCRect.x()-fcrect.x() << "," << innerCRect.y()-fcrect.y() << "." << endl;
757void KWFrameSet::drawFrame( KWFrame *frame, TQPainter *painter, const TQRect &fcrect, const TQRect &outerCRect,
766 kdDebug(32001) << "\nKWFrameSet::drawFrame " << name() << " outerCRect=" << outerCRect << " frameCrect=" << fcrect << " drawUnderlyingFrames=" << drawUnderlyingFrames << endl;
792 doubleBufPainter->fillRect( 0, 0, outerCRect.width(), outerCRect.height(), TQApplication::palette().active().brush( TQColorGroup::Base ) );
811 kdDebug(32001) << " looking at frame below us: " << f->frameSet()->name() << " frame " << frameFromPtr( frame ) << endl;
813 TQRect viewFrameCRect = outerCRect.intersect( viewMode->normalToView( f->outerRect( viewMode ) ) );
817 kdDebug(32001) << " viewFrameRect=" << viewFrameCRect << " calling drawFrameAndBorders." << endl;
824 if ( frame->paddingLeft() || frame->paddingTop() || frame->paddingRight() || frame->paddingBottom() )
828 kdDebug(32001) << " translating by " << translationOffset.x() << ", " << translationOffset.y() << " before drawFrameContents" << endl;
830 doubleBufPainter->translate( translationOffset.x(), translationOffset.y() ); // This assume that viewToNormal() is only a translation
831 // We can't "repaint changed parags only" if we just drew the underlying frames, hence the "false"
832 drawFrameContents( frame, doubleBufPainter, fcrect, frameColorGroup, false, resetChanged, edit, viewMode );
839 kdDebug(32001) << " painting double-buf pixmap at position " << outerCRect.topLeft() << " (real painter pos:" << painter->xForm( outerCRect.topLeft() ) << ")" << endl;
858 drawFrameContents( frame, painter, fcrect, frameColorGroup, onlyChanged, resetChanged, edit, viewMode );
865 kdWarning() << "Default implementation of drawFrameContents called for " << className() << " " << this << " " << name() << kdBacktrace();
911 m_info = static_cast<KWFrameSet::Info>( KWDocument::getAttribute( framesetElem, "frameInfo", KWFrameSet::FI_BODY ) );
946 kdWarning(32001) << "Error in frame " << tag.tagName() << " " << tag.attributeNS( KoXmlNS::draw, "name", TQString() ) << " : neither width nor min-width specified!" << endl;
971 // A frame with protected size means that the frameset is size-protected (hmm, kword did it that way)
1080TQRegion KWFrameSet::frameClipRegion( TQPainter * painter, KWFrame *frame, const TQRect & crect,
1140 kdDebug(32001) << "KWFrameSet::canRemovePage " << name() << " frame on page " << num << " -> false" << endl;
1159bool KWFrameSet::isFrameAtPos( const KWFrame* frame, const TQPoint& point, bool borderOfFrameOnly) const {
1205 static const char * frameBh[] = { "AutoExtendFrame", "AutoCreateNewFrame", "Ignore", "ERROR" };
1239 kdDebug() << " +-- Frame " << j << " of "<< frameCount() << " (" << frame << ") " << copy << endl;
1241 kdDebug() << " Rectangle : " << frame->x() << "," << frame->y() << " " << frame->width() << "x" << frame->height() << endl;
1242 kdDebug() << " RunAround: "<< runaround[ frame->runAround() ] << " side:" << runaroundSide[ frame->runAroundSide() ]<< endl;
1246 kdDebug() << " BackgroundColor: "<< ( col.isValid() ? col.name().latin1() : "(default)" ) << endl;
1260 TQString page = pageManager() && pageManager()->pageCount() > 0 ? TQString::number(frame->pageNumber()) : " [waiting for pages to be created]";
int frameNum() const
The index the frameset needs to access which content is displayed in the anchor object.
Definition KWAnchor.h:52
KWFrameSet * frameSet() const
The frameset that will provide the content to display in this anchor object.
Definition KWAnchor.h:50
This class calculates and caches a list of frames that are on top or below the KWFrame instance this ...
Definition KWFrameList.h:32
void update()
Update the z-ordering around the frame we host the framelist for.
Definition KWFrameList.cpp:121
TQValueList< KWFrame * > framesBelow() const
Fetches the frames below the frame this frameList is for.
Definition KWFrameList.cpp:36
void updateAfterMove(int oldPageNum)
Update the z-ordering around the frame we host the framelist for.
Definition KWFrameList.cpp:113
static void createFrameList(KWFrame *f, KWDocument *doc)
Factory method to create and attach a new instance of a framelist.
Definition KWFrameList.cpp:179
TQValueList< KWFrame * > framesOnTop() const
Fetches the frames on top of the frame this frameList is for.
Definition KWFrameList.cpp:48
This object is created to edit a particular frameset in a particular view The view's canvas creates i...
Definition KWFrameSetEdit.h:51
Class: KWFrameSet Base type, a frameset holds content as well as frames to show that content.
Definition KWFrameSet.h:62
void drawFrameAndBorders(KWFrame *frame, TQPainter *painter, const TQRect &crect, const TQColorGroup &cg, bool, bool, KWFrameSetEdit *edit, KWViewMode *viewMode, KWFrame *settingsFrame, bool drawUnderlyingFrames)
This one is called by drawContents for each frame.
Definition KWFrameSet.cpp:682
void repaintChanged(KWFrameSet *frameset)
Emitted when something has changed in this frameset, so that all views repaint it.
KWAnchor * findAnchor(int frameNum)
Return the anchor object for this frame number.
Definition KWFrameSet.cpp:343
virtual void moveFloatingFrame(int frameNum, const KoPoint &position)
Move the frame frameNum to the given position - this is called when the frame is anchored and the anc...
Definition KWFrameSet.cpp:443
void drawFrameBorder(TQPainter *painter, KWFrame *frame, KWFrame *settingsFrame, const TQRect &crect, KWViewMode *viewMode)
Paint the borders for one frame of this frameset.
Definition KWFrameSet.cpp:237
virtual void deleteFrame(unsigned int num, bool remove=true, bool recalc=true)
Delete a frame from the set of frames this frameSet has.
Definition KWFrameSet.cpp:93
static KWFrame * settingsFrame(const KWFrame *frame)
Returns the original frame that the param frame is a copy off, or the frame itself.
Definition KWFrameSet.cpp:524
void setNewFrameBehavior(KWFrame::NewFrameBehavior nfb)
set newFrameBehavior on all frames, see KWFrame for specifics
Definition KWFrameSet.cpp:1153
virtual void drawPadding(KWFrame *frame, TQPainter *p, const TQRect &fcrect, const TQColorGroup &cg, KWViewMode *viewMode)
Draw the padding area inside of a specific frame of this frameSet.
Definition KWFrameSet.cpp:187
int m_firstPage
always equal to m_framesInPage[0].first()->pageNumber() :)
Definition KWFrameSet.h:491
Info
The different types of textFramesets (that TEXT is important here!) FI_BODY = normal text frames.
Definition KWFrameSet.h:91
const TQPtrList< KWFrame > & frameIterator() const
Iterator over the child frames.
Definition KWFrameSet.h:159
virtual void finalize()
Called once the frameset has been completely loaded or constructed.
Definition KWFrameSet.cpp:1074
virtual void drawContents(TQPainter *painter, const TQRect &crect, const TQColorGroup &cg, bool onlyChanged, bool resetChanged, KWFrameSetEdit *edit, KWViewMode *viewMode, KWFrameViewManager *frameViewManager)
Paint this frameset.
Definition KWFrameSet.cpp:632
void setAnchored(KWTextFrameSet *textfs, KoTextParag *parag, int index, bool placeHolderExists=false, bool repaint=true)
Make this frameset anchored, with the anchor at paragId,index in the text frameset textfs.
Definition KWFrameSet.cpp:314
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 ...
Definition KWFrameSet.cpp:160
TQPtrVector< TQPtrList< KWFrame > > m_framesInPage
This array provides a direct access to the frames on page N.
Definition KWFrameSet.h:489
virtual void drawFrame(KWFrame *frame, TQPainter *painter, const TQRect &fcrect, const TQRect &crect, const TQPoint &translationOffset, KWFrame *settingsFrame, const TQColorGroup &cg, bool onlyChanged, bool resetChanged, KWFrameSetEdit *edit, KWViewMode *viewMode, bool drawUnderlyingFrames)
Draw a particular frame of this frameset.
Definition KWFrameSet.cpp:757
virtual KWAnchor * createAnchor(KoTextDocument *txt, int frameNum)
Create an anchor for the floating frame identified by frameNum.
Definition KWFrameSet.cpp:377
virtual bool canRemovePage(int num)
Return true if page num can be removed, as far as this frameset is concerned.
Definition KWFrameSet.cpp:1129
virtual void load(TQDomElement &framesetElem, bool loadFrames=true)
load from XML - when loading
Definition KWFrameSet.cpp:909
bool isFloating() const
Return true if this frameset is floating (inline), false if it's fixed.
Definition KWFrameSet.h:372
virtual void frameDeleted(KWFrame *, bool)
Called by deleteFrame when it really deletes a frame (remove=true), to remove it from the table too.
Definition KWFrameSet.h:129
virtual void updateFrames(int flags=0xff)
Called when our frames change, or when another frameset's frames change.
Definition KWFrameSet.cpp:541
void saveCommon(TQDomElement &parentElem, bool saveFrames)
save the common attributes for the frameset
Definition KWFrameSet.cpp:868
TQPtrList< KWFrame > m_emptyList
always empty, for convenience in framesInPage
Definition KWFrameSet.h:493
KWTableFrameSet * groupmanager() const
returns the groupManager this frameset belongs to.
Definition KWFrameSet.h:408
virtual KoSize floatingFrameSize(int frameNum=0)
Get the size of the "floating frame" identified by frameNum.
Definition KWFrameSet.cpp:482
KWTextFrameSet * anchorFrameset() const
Return the frameset in which our anchor is - assuming isFloating()
Definition KWFrameSet.h:374
void setFrameBehavior(KWFrame::FrameBehavior fb)
set frameBehavior on all frames, see KWFrame for specifics
Definition KWFrameSet.cpp:1148
void setFloating()
Make this frameset floating (anchored), as close to its current position as possible.
Definition KWFrameSet.cpp:278
TQString name() const
get/set frameset name. For tables in particular, this must be unique
Definition KWFrameSet.h:428
TQRegion frameClipRegion(TQPainter *painter, KWFrame *frame, const TQRect &crect, KWViewMode *viewMode)
Determine the clipping rectangle for drawing the contents of frame with painter in the rectangle deli...
Definition KWFrameSet.cpp:1080
const TQPtrList< KWFrame > & framesInPage(int pageNum) const
Return list of frames in page pageNum.
Definition KWFrameSet.cpp:618
virtual KCommand * anchoredObjectCreateCommand(int frameNum)
Store command for creating an anchored object.
Definition KWFrameSet.cpp:489
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...
Definition KWFrameSet.cpp:862
bool isVisible(KWViewMode *viewMode=0L) const
Returns true if the frameset is visible.
Definition KWFrameSet.cpp:992
bool isFrameAtPos(const KWFrame *frame, const TQPoint &nPoint, bool borderOfFrameOnly=false) const
Return if the point is on the frame.
Definition KWFrameSet.cpp:1159
KoRect floatingFrameRect(int frameNum=0)
Get the rect of the "floating frame" identified by frameNum, in coordinates RELATIVE TO THE PARENT FR...
Definition KWFrameSet.cpp:466
KWFrame * frameAtPos(double _x, double _y) const
retrieve frame from x and y coords (unzoomed coords)
Definition KWFrameSet.cpp:503
virtual KCommand * anchoredObjectDeleteCommand(int frameNum)
Store command for deleting an anchored object.
Definition KWFrameSet.cpp:496
Class that knows about all the (visible) frames in the document and will act as a manager between the...
Definition KWFrameViewManager.h:51
KWFrameView * view(const KoPoint &point, SelectionType select, bool borderOnly=false) const
Returns a frameView representing a frame positioned at point, or 0 when no match found.
Definition KWFrameViewManager.cpp:216
an instance of a KWFrameView represents the view in the MVC model of a frame; there can be multiple K...
Definition KWFrameView.h:82
bool selected() const
returns if this frameView is selected. A selected frame is shown differently on screen.
Definition KWFrameView.h:93
void paintFrameAttributes(TQPainter *painter, const TQRect &crect, KWViewMode *vm, KoZoomHandler *zh)
Paint view based items of the frameView, like selected state.
Definition KWFrameView.cpp:131
NewFrameBehavior
What happens on new page (create a new frame and reconnect, no followup, make copy)
Definition KWFrame.h:132
TQRect outerRect(KWViewMode *viewMode) const
Return the zoomed rectangle for this frame, including the border - for drawing.
Definition KWFrame.cpp:185
void setZOrder(int z)
The z-order of the frame, relative to the other frames on the same page.
Definition KWFrame.h:155
bool isCopy() const
Drawing property: if isCopy, this frame is a copy of the previous frame in the frameset.
Definition KWFrame.h:138
const KoBorder & leftBorder() const
All borders can be custom drawn with their own colors etc.
Definition KWFrame.h:170
KoRect outerKoRect() const
Return the unzoomed rectangle, including the border, for the frames-on-top list.
Definition KWFrame.cpp:200
void load(TQDomElement &frameElem, KWFrameSet *frameSet, int syntaxVersion)
read attributes from XML.
Definition KWFrame.cpp:340
Class: KWTextFrameSet Contains text (KoTextObject) and frames to display that text.
Definition KWTextFrameSet.h:64
virtual void layout()
Invalidate all paragraphs and start re-formatting.
Definition KWTextFrameSet.cpp:827
This class extends KoTextParag for KWord-specific formatting stuff, custom items, loading and saving.
Definition KWTextParag.h:41
static const int OFFSET
hardcoded distance from the left side this viewmode starts its rendering
Definition KWViewMode.h:290
virtual bool isTextModeFrameset(KWFrameSet *) const
Answers the question if argument frameset has to be drawn as a text-mode text area if true,...
Definition KWViewMode.h:129
virtual TQPoint normalToView(const TQPoint &nPoint)=0
Normal coord -> view coord.
bool drawFrameBorders() const
Should we see frame borders? This setting doesn't always come from KWView...
Definition KWViewMode.h:105
virtual TQPoint viewToNormal(const TQPoint &vPoint)=0
View coord -> normal coord.
virtual bool isFrameSetVisible(const KWFrameSet *)
Should this frameset be visible in this viewmode? True by default, all are shown.
Definition KWViewMode.h:109
