19#include "KWFrameList.h"
21#include "KWFrameSet.h"
22#include "KWTextFrameSet.h"
23#include "KWDocument.h"
24#include "KWViewMode.h"
25#include "KWPageManager.h"
37 TQValueList<KWFrame *> frames;
41 for ( TQValueVector<KWFrame*>::const_iterator it = m_frames.begin(), end = m_frames.end(); it != end && *it != m_frame; ++it) {
50 TQValueList<KWFrame *> frames;
54 for ( TQValueVector<KWFrame*>::const_iterator it = m_frames.begin(), end = m_frames.end(); it != end; ++it) {
58 frames.append( frame );
60 else if ( frame == m_frame )
67void KWFrameList::setFrames(
const TQPtrList<KWFrame> &frames) {
70 if ( m_doc->layoutViewMode() && !m_doc->layoutViewMode()->
hasFrames() )
73 TQPtrList<KWFrameSet> parentFramesets;
76 parentFramesets.append(fs);
82 TQPtrListIterator<KWFrame> it( frames );
83 for ( ; it.current() ; ++it )
85 KWFrame* daFrame = it.current();
87 if ( m_frame == daFrame ) {
88 m_frames.append( daFrame );
100 daFrame->
frameSet()->isPaintedBy(m_frame->frameSet())) )
104 if ( m_frame->frameSet()->isFloating() )
106 KoRect intersect = m_frame->intersect( daFrame->
outerKoRect() );
107 if ( !intersect.isEmpty() )
108 m_frames.append( daFrame );
114 int pageNumber = m_doc->pageManager()->pageNumber(m_frame);
115 updateZOrderFor(m_doc->framesInPage( pageNumber,
false ));
117 if (pageNumber != oldPageNum)
118 updateZOrderFor(m_doc->framesInPage( oldPageNum,
false ));
122 int pageNumber = m_doc->pageManager()->pageNumber(m_frame);
125 updateZOrderFor(m_doc->framesInPage( pageNumber,
false ));
128void KWFrameList::updateZOrderFor(
const TQPtrList<KWFrame> &frames) {
130 kdDebug(32001) <<
"KWFrameList::updateZOrderFor " << frames.count() <<
" frames"<< endl;
136 TQPtrListIterator<KWFrame> iter(frames);
137 while( iter.current() ) {
138 KWFrame *frame = iter.current();
139 Q_ASSERT( frame->frameStack() );
141 frame->frameStack()->setFrames(frames);
143 numberAdded += frame->frameStack()->m_frames.count();
149 kdDebug(32001) <<
" updateZOrderFor took " << (float)(dt.elapsed()) / 1000 <<
" seconds, added " << numberAdded <<
" frames" << endl;
154KWFrameList *KWFrameList::getFirstFrameList(KWDocument *doc) {
155 for (TQPtrListIterator<KWFrameSet> fsit = doc->framesetsIterator(); fsit.current() ; ++fsit ) {
156 KWFrame *frame = fsit.current()->frame(0);
157 if (frame && frame->frameStack())
158 return frame->frameStack();
164 for(
int i=pageTo; i >= pageFrom; i--) {
165 TQPtrList<KWFrame> framesOnPage = doc->framesInPage( i,
false );
166 KWFrame *f = framesOnPage.first();
168 Q_ASSERT(f->frameStack());
169 f->frameStack()->setFrames(framesOnPage);
170 f = framesOnPage.next();
193 f->frameStack()->
update();
This class calculates and caches a list of frames that are on top or below the KWFrame instance this ...
static void recalcAllFrames(KWDocument *doc)
Update the z-ordering for all frames of the whole document.
void update()
Update the z-ordering around the frame we host the framelist for.
TQValueList< KWFrame * > framesBelow() const
Fetches the frames below the frame this frameList is for.
KWFrameList(KWDocument *doc, KWFrame *theFrame)
Constructor.
static void recalcFrames(KWDocument *doc, int pageFrom, int pageTo)
Update the z-ordering for all frames in the page section of the whole document.
void updateAfterMove(int oldPageNum)
Update the z-ordering around the frame we host the framelist for.
static void createFrameList(KWFrame *f, KWDocument *doc)
Factory method to create and attach a new instance of a framelist.
TQValueList< KWFrame * > framesOnTop() const
Fetches the frames on top of the frame this frameList is for.
Class: KWFrameSet Base type, a frameset holds content as well as frames to show that content.
const TQPtrList< KWFrame > & frameIterator() const
Iterator over the child frames.
bool isFloating() const
Return true if this frameset is floating (inline), false if it's fixed.
KWTableFrameSet * groupmanager() const
returns the groupManager this frameset belongs to.
KWTextFrameSet * anchorFrameset() const
Return the frameset in which our anchor is - assuming isFloating().
This class represents a single frame.
KWFrameSet * frameSet() const
Data stucture methods.
static bool compareFrameZOrder(KWFrame *f1, KWFrame *f2)
This is a method used to sort a list using the STL sorting methods.
KoRect outerKoRect() const
Return the unzoomed rectangle, including the border, for the frames-on-top list.
virtual bool hasFrames()
Does this viewmode know anything about frames?