kword
KWFrameSetEdit.cpp00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "KWFrameSetEdit.h"
00022 #include "KWView.h"
00023 #include "KWCanvas.h"
00024 #include "KWFrame.h"
00025 #include "KWAnchor.h"
00026 #include "KWFrameSet.h"
00027 #include "KWTextFrameSet.h"
00028
00029 #include <KoTextParag.h>
00030
00031 KWFrameSetEdit::KWFrameSetEdit( KWFrameSet * fs, KWCanvas * canvas )
00032 : m_fs(fs), m_canvas(canvas), m_currentFrame( fs->frame(0) )
00033 {
00034 }
00035
00036 void KWFrameSetEdit::drawContents( QPainter *p, const QRect &crect,
00037 const QColorGroup &cg, bool onlyChanged, bool resetChanged,
00038 KWViewMode *viewMode, KWFrameViewManager *fvm )
00039 {
00040
00041 frameSet()->drawContents( p, crect, cg, onlyChanged, resetChanged, this, viewMode, fvm );
00042 }
00043
00044 bool KWFrameSetEdit::exitLeft()
00045 {
00046 if ( m_fs->isFloating() ) {
00047 KWAnchor* anchor = m_fs->findAnchor( 0 );
00048 int index = anchor->index();
00049 KoTextParag *parag = anchor->paragraph();
00050
00051 m_canvas->editTextFrameSet( m_fs->anchorFrameset(), parag, index );
00052 return true;
00053 }
00054 return false;
00055 }
00056
00057 bool KWFrameSetEdit::exitRight()
00058 {
00059 if ( m_fs->isFloating() ) {
00060 KWAnchor* anchor = m_fs->findAnchor( 0 );
00061 int index = anchor->index();
00062 KoTextParag *parag = anchor->paragraph();
00063
00064 m_canvas->editTextFrameSet( m_fs->anchorFrameset(), parag, index+1 );
00065 return true;
00066 }
00067 return false;
00068 }
|