kword

#include <KWTextFrameSet.h>

Inheritance diagram for KWTextFrameSet:
KWFrameSet KWTableFrameSet::Cell

Public Types

enum  RelativePosition { InsideFrame , LeftOfFrame , TopOfFrame , AtEnd }
 
- Public Types inherited from KWFrameSet
enum  Info {
  FI_BODY = 0 , FI_FIRST_HEADER = 1 , FI_EVEN_HEADER = 2 , FI_ODD_HEADER = 3 ,
  FI_FIRST_FOOTER = 4 , FI_EVEN_FOOTER = 5 , FI_ODD_FOOTER = 6 , FI_FOOTNOTE = 7
}
 
enum  UpdateFramesFlags { UpdateFramesInPage = 1 , SortFrames = 2 }
 

Public Slots

void slotRepaintChanged ()
 

Signals

void frameDeleted (KWFrame *frame)
 
void mainTextHeightChanged ()
 
- Signals inherited from KWFrameSet
void repaintChanged (KWFrameSet *frameset)
 
void sigFrameAdded (KWFrame *)
 
void sigFrameRemoved (KWFrame *)
 
void sigNameChanged (KWFrameSet *)
 

Public Member Functions

 KWTextFrameSet (KWDocument *_doc, const TQString &name)
 
 KWTextFrameSet (KWDocument *doc, const TQDomElement &tag, KoOasisContext &context)
 
 ~KWTextFrameSet ()
 
virtual KWordFrameSetIface * dcopObject ()
 
virtual FrameSetType type () const
 
virtual KWFrameSetEdit * createFrameSetEdit (KWCanvas *canvas)
 
KoTextObject * textObject () const
 
KoTextDocument * textDocument () const
 
KWTextDocument * kwTextDocument () const
 
void setProtectContent (bool _protect)
 
bool protectContent () const
 
void clearUndoRedoInfo ()
 
KWFrame * documentToInternal (const KoPoint &dPoint, TQPoint &iPoint) const
 
KWFrame * documentToInternalMouseSelection (const KoPoint &dPoint, TQPoint &iPoint, RelativePosition &relPos, KWViewMode *viewMode) const
 
KWFrame * internalToDocument (const KoPoint &relPoint, KoPoint &dPoint) const
 
KWFrame * internalToDocument (const TQPoint &iPoint, KoPoint &dPoint) const
 
KWFrame * internalToDocumentWithHint (const TQPoint &iPoint, KoPoint &dPoint, const KoPoint &hintDPoint) const
 
KoPoint internalToDocumentKnowingFrame (const KoPoint &relPoint, KWFrame *theFrame) const
 
KoPoint internalToDocumentKnowingFrame (const TQPoint &iPoint, KWFrame *theFrame) const
 
TQPoint moveToPage (int currentPgNum, short int direction) const
 
virtual int availableHeight () const
 
bool isFrameEmpty (KWFrame *frame)
 
virtual bool canRemovePage (int num)
 
virtual void deleteFrame (unsigned int num, bool remove=true, bool recalc=true)
 
void deleteFrame (KWFrame *frm, bool remove=true, bool recalc=true)
 
virtual void updateFrames (int flags=0xff)
 
void updateViewArea (TQWidget *w, KWViewMode *viewMode, const TQPoint &nPointBottom)
 
virtual TQDomElement save (TQDomElement &parentElem, bool saveFrames=true)
 
virtual TQDomElement toXML (TQDomElement &parentElem, bool saveFrames=true)
 
virtual void load (TQDomElement &attributes, bool loadFrames=true)
 
void loadOasisContent (const TQDomElement &bodyElem, KoOasisContext &context)
 
KWFrame * loadOasis (const TQDomElement &frame, const TQDomElement &bodyElem, KoOasisContext &context)
 
KWFrame * loadOasisTextFrame (const TQDomElement &frameTag, const TQDomElement &tag, KoOasisContext &context)
 
void saveOasisContent (KoXmlWriter &writer, KoSavingContext &context) const
 
virtual void saveOasis (KoXmlWriter &writer, KoSavingContext &context, bool saveFrames) const
 
virtual TQString toPlainText () const
 
virtual void finalize ()
 
bool hasSelection () const
 
TQString selectedText () const
 
virtual void drawContents (TQPainter *painter, const TQRect &crect, const TQColorGroup &cg, bool onlyChanged, bool resetChanged, KWFrameSetEdit *edit, KWViewMode *viewMode, KWFrameViewManager *frameViewManager)
 
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)
 
virtual void drawFrameContents (KWFrame *frame, TQPainter *painter, const TQRect &fcrect, const TQColorGroup &cg, bool onlyChanged, bool resetChanged, KWFrameSetEdit *edit, KWViewMode *viewMode)
 
void drawCursor (TQPainter *p, KoTextCursor *cursor, bool cursorVisible, KWCanvas *canvas, KWFrame *currentFrame)
 
TQPoint cursorPos (KoTextCursor *cursor, KWCanvas *canvas, KWFrame *currentFrame)
 
KCommand * pasteOasis (KoTextCursor *cursor, const TQByteArray &data, bool removeSelected)
 
void insertTOC (KoTextCursor *cursor)
 
KNamedCommand * insertFrameBreakCommand (KoTextCursor *cursor)
 
void insertFrameBreak (KoTextCursor *cursor)
 
KCommand * setPageBreakingCommand (KoTextCursor *cursor, int pageBreaking)
 
TQRect paragRect (KoTextParag *parag) const
 
KCommand * deleteAnchoredFrame (KWAnchor *anchor)
 
void findPosition (const KoPoint &dPoint, KoTextParag *&parag, int &index)
 
void highlightPortion (KoTextParag *parag, int index, int length, KWCanvas *canvas, bool repaint=true, KDialogBase *dialog=0)
 
void removeHighlight (bool repaint=true)
 
virtual void addTextFrameSets (TQPtrList< KWTextFrameSet > &lst, bool onlyReadWrite=false)
 
void applyStyleChange (KoStyleChangeDefMap changed)
 
virtual void setVisible (bool v)
 
void setInlineFramesVisible (bool)
 
virtual void printDebug ()
 
virtual void layout ()
 
virtual void invalidate ()
 
virtual int paragraphs ()
 
virtual int paragraphsSelected ()
 
virtual bool statistics (TQProgressDialog *progress, ulong &charsWithSpace, ulong &charsWithoutSpace, ulong &words, ulong &sentences, ulong &syllables, ulong &lines, bool selected)
 
virtual void adjustMargins (int yp, int h, int reqMinWidth, int &leftMargin, int &rightMargin, int &pageWidth, KoTextParag *parag)
 
virtual int adjustFlow (int y, int w, int h)
 
int formatVertically (KoTextParag *parag, const TQRect &rect)
 
void fixParagWidth (KWTextParag *parag)
 
void ensureFormatted (KoTextParag *parag, bool emitAfterFormatting=true)
 
KWViewMode * currentViewMode () const
 
KWFrame * currentDrawnFrame () const
 
virtual KoTextFormat * currentFormat () const
 
virtual KCommand * setFormatCommand (const KoTextFormat *newFormat, int flags, bool zoomFont=false)
 
virtual const KoParagLayout * currentParagLayoutFormat () const
 
virtual bool rtl () const
 
virtual KCommand * setParagLayoutFormatCommand (KoParagLayout *newLayout, int flags, int marginIndex=-1)
 
virtual KCommand * setChangeCaseOfTextCommand (KoChangeCaseDia::TypeOfCase _type)
 
void renumberFootNotes (bool repaint=true)
 
virtual KWTextFrameSet * nextTextObject (KWFrameSet *)
 
bool minMaxInternalOnPage (int pageNum, int &topLU, int &bottomLU) const
 
KoTextParag * paragAtLUPos (int yLU) const
 
KWFootNoteFrameSet * insertFootNote (NoteType noteType, KWFootNoteVariable::Numbering numType, const TQString &manualString)
 
KoTextDocCommand * deleteTextCommand (KoTextDocument *textdoc, int id, int index, const TQMemArray< KoTextStringChar > &str, const CustomItemsMap &customItemsMap, const TQValueList< KoParagLayout > &oldParagLayouts)
 
TQString copyTextParag (KoXmlWriter &writer, KoSavingContext &context, int selectionId)
 
TQByteArray sortText (SortType type) const
 
KoLinkVariable * linkVariableUnderMouse (const KoPoint &dPoint)
 
KoVariable * variableUnderMouse (const KoPoint &dPoint)
 
- Public Member Functions inherited from KWFrameSet
 KWFrameSet (KWDocument *doc)
 
virtual ~KWFrameSet ()
 
virtual bool ownLine () const
 
Info frameSetInfo () const
 
void setFrameSetInfo (Info fi)
 
bool isAHeader () const
 
bool isAFooter () const
 
bool isHeaderOrFooter () const
 
bool isFootEndNote () const
 
const char * headerFooterTag () const
 
virtual bool isFootNote () const
 
virtual bool isEndNote () const
 
bool isMainFrameset () const
 
bool isMoveable () const
 
virtual void addFrame (KWFrame *_frame, bool recalc=true)
 
void deleteFrame (KWFrame *frm, bool remove=true, bool recalc=true)
 
virtual void frameDeleted (KWFrame *, bool)
 
void deleteAllFrames ()
 
void deleteAllCopies ()
 
KWFrame * frameAtPos (double _x, double _y) const
 
bool isFrameAtPos (const KWFrame *frame, const TQPoint &nPoint, bool borderOfFrameOnly=false) const
 
KWFrame * frame (unsigned int _num) const
 
const TQPtrList< KWFrame > & frameIterator () const
 
int frameFromPtr (KWFrame *frame)
 
unsigned int frameCount () const
 
bool isDeleted () const
 
virtual void createEmptyRegion (const TQRect &crect, TQRegion &emptyRegion, KWViewMode *viewMode)
 
void drawFrameAndBorders (KWFrame *frame, TQPainter *painter, const TQRect &crect, const TQColorGroup &cg, bool, bool, KWFrameSetEdit *edit, KWViewMode *viewMode, KWFrame *settingsFrame, bool drawUnderlyingFrames)
 
void drawFrameBorder (TQPainter *painter, KWFrame *frame, KWFrame *settingsFrame, const TQRect &crect, KWViewMode *viewMode)
 
virtual void drawPadding (KWFrame *frame, TQPainter *p, const TQRect &fcrect, const TQColorGroup &cg, KWViewMode *viewMode)
 
const TQPtrList< KWFrame > & framesInPage (int pageNum) const
 
bool hasFramesInPageArray () const
 
virtual bool canBeSavedAsInlineCharacter () const
 
KWFrame * loadOasisFrame (const TQDomElement &tag, KoOasisContext &context)
 
virtual void fromXML (TQDomElement &framesetElem, bool loadFrames=true, bool=true)
 
KWDocument * kWordDocument () const
 
void setFloating ()
 
void setAnchored (KWTextFrameSet *textfs, KoTextParag *parag, int index, bool placeHolderExists=false, bool repaint=true)
 
void setAnchored (KWTextFrameSet *textfs, int paragId, int index, bool placeHolderExists=false, bool repaint=true)
 
void setAnchored (KWTextFrameSet *textfs)
 
void setFixed ()
 
bool isFloating () const
 
KWTextFrameSet * anchorFrameset () const
 
void setAnchorFrameset (KWTextFrameSet *textfs)
 
KWAnchor * findAnchor (int frameNum)
 
virtual void setAnchorFormat (KoTextFormat *, int)
 
virtual KWAnchor * createAnchor (KoTextDocument *txt, int frameNum)
 
virtual void moveFloatingFrame (int frameNum, const KoPoint &position)
 
virtual KoSize floatingFrameSize (int frameNum=0)
 
KoRect floatingFrameRect (int frameNum=0)
 
virtual int floatingFrameBaseline (int)
 
virtual KCommand * anchoredObjectCreateCommand (int frameNum)
 
virtual KCommand * anchoredObjectDeleteCommand (int frameNum)
 
void setGroupManager (KWTableFrameSet *gm)
 
KWTableFrameSet * groupmanager () const
 
bool isProtectSize () const
 
void setProtectSize (bool _b)
 
bool isVisible (KWViewMode *viewMode=0L) const
 
TQString name () const
 
void setName (const TQString &name)
 
void setFrameBehavior (KWFrame::FrameBehavior fb)
 
void setNewFrameBehavior (KWFrame::NewFrameBehavior nfb)
 
virtual void printDebug (KWFrame *)
 
bool isPaintedBy (KWFrameSet *fs) const
 
virtual void setZOrder ()
 
void setPageManager (KWPageManager *pm)
 
KWPageManager * pageManager () const
 

Protected Slots

void slotAvailableHeightNeeded ()
 
void slotAfterFormatting (int bottom, KoTextParag *lastFormatted, bool *abort)
 
void slotNewCommand (KCommand *cmd)
 
void slotParagraphDeleted (KoTextParag *_parag)
 
void slotParagraphCreated (KoTextParag *_parag)
 
void slotParagraphModified (KoTextParag *_parag, int, int, int)
 

Protected Member Functions

 KWTextFrameSet (const TQString &name)
 
- Protected Member Functions inherited from KWFrameSet
void saveCommon (TQDomElement &parentElem, bool saveFrames)
 
TQRegion frameClipRegion (TQPainter *painter, KWFrame *frame, const TQRect &crect, KWViewMode *viewMode)
 
void deleteAnchor (KWAnchor *anchor)
 
virtual void deleteAnchors ()
 
virtual void createAnchors (KoTextParag *parag, int index, bool placeHolderExists=false, bool repaint=true)
 

Additional Inherited Members

- Static Public Member Functions inherited from KWFrameSet
static KWFrame * settingsFrame (const KWFrame *frame)
 
- Protected Attributes inherited from KWFrameSet
KWDocument * m_doc
 
TQPtrList< KWFrame > m_frames
 
TQPtrVector< TQPtrList< KWFrame > > m_framesInPage
 
int m_firstPage
 
TQPtrList< KWFrame > m_emptyList
 
Info m_info
 
KWTableFrameSet * m_groupmanager
 
bool m_visible
 
bool m_protectSize
 
TQString m_name
 
KWTextFrameSet * m_anchorTextFs
 
KWordFrameSetIface * m_dcop
 
KWPageManager * m_pageManager
 

Detailed Description

Class: KWTextFrameSet Contains text (KoTextObject) and frames to display that text.

This class implements the KoTextFormatInterface methods for "apply to the whole text object". This is how "setBold", "setItalic" etc. can apply to a whole text frameset.

Definition at line 63 of file KWTextFrameSet.h.

Member Enumeration Documentation

◆ RelativePosition

used by documentToInternalMouseSelection()

Definition at line 100 of file KWTextFrameSet.h.

Constructor & Destructor Documentation

◆ KWTextFrameSet() [1/3]

KWTextFrameSet::KWTextFrameSet ( KWDocument *  _doc,
const TQString &  name 
)

Cnstructor.

Definition at line 105 of file KWTextFrameSet.cpp.

◆ KWTextFrameSet() [2/3]

KWTextFrameSet::KWTextFrameSet ( KWDocument *  doc,
const TQDomElement &  tag,
KoOasisContext &  context 
)

Used for OASIS loading.

Definition at line 118 of file KWTextFrameSet.cpp.

◆ ~KWTextFrameSet()

KWTextFrameSet::~KWTextFrameSet ( )

Destructor.

Definition at line 1381 of file KWTextFrameSet.cpp.

◆ KWTextFrameSet() [3/3]

KWTextFrameSet::KWTextFrameSet ( const TQString &  name)
protected

Definition at line 130 of file KWTextFrameSet.cpp.

Member Function Documentation

◆ addTextFrameSets()

void KWTextFrameSet::addTextFrameSets ( TQPtrList< KWTextFrameSet > &  lst,
bool  onlyReadWrite = false 
)
virtual

Reimplemented from KWFrameSet.

Definition at line 1939 of file KWTextFrameSet.cpp.

◆ adjustFlow()

int KWTextFrameSet::adjustFlow ( int  y,
int  w,
int  h 
)
virtual

reimplemented from KoTextParag, adjusts y and returns the shift.

Definition at line 1356 of file KWTextFrameSet.cpp.

◆ adjustMargins()

void KWTextFrameSet::adjustMargins ( int  yp,
int  h,
int  reqMinWidth,
int &  leftMargin,
int &  rightMargin,
int &  pageWidth,
KoTextParag *  parag 
)
virtual

reimplemented from KoTextFlow, implements flowing around frames etc.

Definition at line 1095 of file KWTextFrameSet.cpp.

◆ applyStyleChange()

void KWTextFrameSet::applyStyleChange ( KoStyleChangeDefMap  changed)

Update the paragraph that use the given style, after this style was changed.

The flags tell which changes should be applied.

Parameters
changedthe changed style map

Definition at line 2855 of file KWTextFrameSet.cpp.

◆ availableHeight()

int KWTextFrameSet::availableHeight ( ) const
virtual

Return the available height in pixels (sum of all frames' height, with zoom applied) Used to know if we need to create more pages.

Definition at line 1521 of file KWTextFrameSet.cpp.

◆ canRemovePage()

bool KWTextFrameSet::canRemovePage ( int  num)
virtual

Return true if page num can be removed, as far as this frameset is concerned.

Reimplemented from KWFrameSet.

Definition at line 2518 of file KWTextFrameSet.cpp.

◆ clearUndoRedoInfo()

void KWTextFrameSet::clearUndoRedoInfo ( )

Definition at line 2850 of file KWTextFrameSet.cpp.

◆ createFrameSetEdit()

KWFrameSetEdit * KWTextFrameSet::createFrameSetEdit ( KWCanvas *  )
virtual

Create a framesetedit object to edit this frameset in canvas.

Reimplemented from KWFrameSet.

Definition at line 203 of file KWTextFrameSet.cpp.

◆ currentDrawnFrame()

KWFrame * KWTextFrameSet::currentDrawnFrame ( ) const
inline

The frame that we are currently drawing in drawFrame.

Stored here since we can't pass it through TQRT's drawing methods. Used by e.g. KWAnchor.

Definition at line 270 of file KWTextFrameSet.h.

◆ currentFormat()

KoTextFormat * KWTextFrameSet::currentFormat ( ) const
virtual

Let KoTextFormatInterface access the current format.

Definition at line 2861 of file KWTextFrameSet.cpp.

◆ currentParagLayoutFormat()

const KoParagLayout * KWTextFrameSet::currentParagLayoutFormat ( ) const
virtual

Let KoTextFormatInterface access the current parag layout.

Definition at line 2886 of file KWTextFrameSet.cpp.

◆ currentViewMode()

KWViewMode * KWTextFrameSet::currentViewMode ( ) const
inline

The viewmode that was passed to drawContents.

Special hook for KWAnchor. Don't use.

Definition at line 267 of file KWTextFrameSet.h.

◆ cursorPos()

TQPoint KWTextFrameSet::cursorPos ( KoTextCursor *  cursor,
KWCanvas *  canvas,
KWFrame *  currentFrame 
)

Definition at line 4064 of file KWTextFrameSet.cpp.

◆ dcopObject()

KWordFrameSetIface * KWTextFrameSet::dcopObject ( )
virtual

Reimplemented from KWFrameSet.

Definition at line 195 of file KWTextFrameSet.cpp.

◆ deleteAnchoredFrame()

KCommand * KWTextFrameSet::deleteAnchoredFrame ( KWAnchor *  anchor)

Definition at line 2789 of file KWTextFrameSet.cpp.

◆ deleteFrame() [1/2]

void KWTextFrameSet::deleteFrame ( KWFrame *  frm,
bool  remove = true,
bool  recalc = true 
)
inline

Definition at line 140 of file KWTextFrameSet.h.

◆ deleteFrame() [2/2]

void KWTextFrameSet::deleteFrame ( unsigned int  num,
bool  remove = true,
bool  recalc = true 
)
virtual

Delete a frame from the set of frames this frameSet has.

Parameters
numThe frameNumber to be removed.
removepassing true means that there can not be an undo of the action.
recalcdo an updateFrames()

Reimplemented from KWFrameSet.

Definition at line 2546 of file KWTextFrameSet.cpp.

◆ deleteTextCommand()

KoTextDocCommand * KWTextFrameSet::deleteTextCommand ( KoTextDocument *  textdoc,
int  id,
int  index,
const TQMemArray< KoTextStringChar > &  str,
const CustomItemsMap &  customItemsMap,
const TQValueList< KoParagLayout > &  oldParagLayouts 
)

Definition at line 3002 of file KWTextFrameSet.cpp.

◆ documentToInternal()

KWFrame * KWTextFrameSet::documentToInternal ( const KoPoint &  dPoint,
TQPoint &  iPoint 
) const

Convert the dPoint in the normal coordinate system (and in pt) into a point (iPoint) in the internal qtextdoc coordinates (in layout units).

Definition at line 225 of file KWTextFrameSet.cpp.

◆ documentToInternalMouseSelection()

KWFrame * KWTextFrameSet::documentToInternalMouseSelection ( const KoPoint &  dPoint,
TQPoint &  iPoint,
RelativePosition &  relPos,
KWViewMode *  viewMode 
) const

Definition at line 263 of file KWTextFrameSet.cpp.

◆ drawContents()

void KWTextFrameSet::drawContents ( TQPainter *  painter,
const TQRect &  crect,
const TQColorGroup &  cg,
bool  onlyChanged,
bool  resetChanged,
KWFrameSetEdit *  edit,
KWViewMode *  viewMode,
KWFrameViewManager *  frameViewManager 
)
virtual

Paint this frameset.

Parameters
painterThe painter in which to draw the contents of the frameset
crectThe rectangle (in scrollview "contents coordinates", i.e. "view coords") to be painted
cgThe colorgroup from which to get the colors
onlyChangedIf true, only redraw what has changed (see KWCanvas::repaintChanged)
resetChangedIf true, set the changed flag to false after drawing.
editIf set, this frameset is being edited, so a cursor is needed.
viewModeFor coordinate conversion, always set.
frameViewManagerthe frameViewManager;

The way this "onlyChanged/resetChanged" works is: when something changes, all views are asked to redraw themselves with onlyChanged=true. But all views except the last one shouldn't reset the changed flag to false, otherwise the other views wouldn't repaint anything. So resetChanged is called with "false" for all views except the last one, and with "true" for the last one, so that it resets the flag.

Framesets shouldn't reimplement this one in theory [but KWTableFrameSet has to].

Reimplemented from KWFrameSet.

Reimplemented in KWTableFrameSet::Cell.

Definition at line 475 of file KWTextFrameSet.cpp.

◆ drawCursor()

void KWTextFrameSet::drawCursor ( TQPainter *  p,
KoTextCursor *  cursor,
bool  cursorVisible,
KWCanvas *  canvas,
KWFrame *  currentFrame 
)

Definition at line 683 of file KWTextFrameSet.cpp.

◆ drawFrame()

void KWTextFrameSet::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 
)
virtual

Draw a particular frame of this frameset.

This is called by drawContents and is what framesets must reimplement.

Parameters
fcrectrectangle to be repainted, in the frame's coordinate system, in pixels. Doesn't include padding.
crectrectangle to be repainted, in view coordinates. Includes padding. Default implementation does double-buffering and calls drawFrameContents.
framethe frame to draw
painterthe painter to draw to
settingsFrameThe frame from which we take the settings (usually frame, but not with Copy behaviour)
cgThe colorgroup from which to get the colors
onlyChangedIf true, only redraw what has changed (see KWCanvas::repaintChanged)
resetChangedIf true, set the changed flag to false after drawing.
editIf set, this frameset is being edited, so a cursor is needed.
viewModeFor coordinate conversion, always set.
drawUnderlyingFramesif the frame implements it, then it should draw underlying frames.
translationOffsetoffset this method will translate the paiter before doing its work.

Reimplemented from KWFrameSet.

Definition at line 561 of file KWTextFrameSet.cpp.

◆ drawFrameContents()

void KWTextFrameSet::drawFrameContents ( KWFrame *  frame,
TQPainter *  painter,
const TQRect &  fcrect,
const TQColorGroup &  cg,
bool  onlyChanged,
bool  resetChanged,
KWFrameSetEdit *  edit,
KWViewMode *  viewMode 
)
virtual

Implement this one instead of drawFrame to benefit from double-buffering AND transparency handling (painting frames below this one) automatically.

You MUST reimplement one or the other, or you'll get infinite recursion ;)

In this method, the painter has been translated to the frame's coordinate system

Parameters
fcrectrectangle to be repainted, in the frame's coordinate system, in pixels. Doesn't include padding.
framethe frame to draw
painterthe painter to draw to
cgThe colorgroup from which to get the colors
onlyChangedIf true, only redraw what has changed (see KWCanvas::repaintChanged)
resetChangedIf true, set the changed flag to false after drawing.
editIf set, this frameset is being edited, so a cursor is needed.
viewModeFor coordinate conversion, always set.

Reimplemented from KWFrameSet.

Definition at line 575 of file KWTextFrameSet.cpp.

◆ ensureFormatted()

void KWTextFrameSet::ensureFormatted ( KoTextParag *  parag,
bool  emitAfterFormatting = true 
)

Make sure this paragraph is formatted If formatting happens, the afterFormatting signal will only be emitted if emitAfterFormatting is true.

This prevents re-entrancy if ensureFormatting is called by canRemovePage (from another frameset's slotAfterFormatting)

Definition at line 1950 of file KWTextFrameSet.cpp.

◆ finalize()

void KWTextFrameSet::finalize ( )
virtual

Called once the frameset has been completely loaded or constructed.

The default implementation calls updateFrames() and zoom(). Call the parent :)

Reimplemented from KWFrameSet.

Definition at line 1912 of file KWTextFrameSet.cpp.

◆ findPosition()

void KWTextFrameSet::findPosition ( const KoPoint &  dPoint,
KoTextParag *&  parag,
int &  index 
)

Definition at line 2736 of file KWTextFrameSet.cpp.

◆ fixParagWidth()

void KWTextFrameSet::fixParagWidth ( KWTextParag *  parag)

Called by KWTextFormatter::postFormat()

Definition at line 1362 of file KWTextFrameSet.cpp.

◆ formatVertically()

int KWTextFrameSet::formatVertically ( KoTextParag *  parag,
const TQRect &  rect 
)

Called by KWTextFormatter.

Implements page breaking, breaking around frames, etc.

Definition at line 1192 of file KWTextFrameSet.cpp.

◆ frameDeleted

void KWTextFrameSet::frameDeleted ( KWFrame *  frame)
signal

Tell the Edit object that this frame got deleted.

◆ hasSelection()

bool KWTextFrameSet::hasSelection ( ) const

return true if some text is selected

Definition at line 2806 of file KWTextFrameSet.cpp.

◆ highlightPortion()

void KWTextFrameSet::highlightPortion ( KoTextParag *  parag,
int  index,
int  length,
KWCanvas *  canvas,
bool  repaint = true,
KDialogBase *  dialog = 0 
)

Highlighting support (for search/replace, spellchecking etc.)

Definition at line 2821 of file KWTextFrameSet.cpp.

◆ insertFootNote()

KWFootNoteFrameSet * KWTextFrameSet::insertFootNote ( NoteType  noteType,
KWFootNoteVariable::Numbering  numType,
const TQString &  manualString 
)

Insert a footnote (var and frameset).

Shared code for loading and inserting from GUI.

Definition at line 3051 of file KWTextFrameSet.cpp.

◆ insertFrameBreak()

void KWTextFrameSet::insertFrameBreak ( KoTextCursor *  cursor)

Definition at line 2705 of file KWTextFrameSet.cpp.

◆ insertFrameBreakCommand()

KNamedCommand * KWTextFrameSet::insertFrameBreakCommand ( KoTextCursor *  cursor)

Definition at line 2686 of file KWTextFrameSet.cpp.

◆ insertTOC()

void KWTextFrameSet::insertTOC ( KoTextCursor *  cursor)

Definition at line 2660 of file KWTextFrameSet.cpp.

◆ internalToDocument() [1/2]

KWFrame * KWTextFrameSet::internalToDocument ( const KoPoint &  relPoint,
KoPoint &  dPoint 
) const

Convert the in the internal qtextdoc coordinates (in layout units) into a point in the document coordinate system (in pt).

Also returns the frame in which this point is.

Definition at line 1526 of file KWTextFrameSet.cpp.

◆ internalToDocument() [2/2]

KWFrame * KWTextFrameSet::internalToDocument ( const TQPoint &  iPoint,
KoPoint &  dPoint 
) const

Definition at line 1654 of file KWTextFrameSet.cpp.

◆ internalToDocumentKnowingFrame() [1/2]

KoPoint KWTextFrameSet::internalToDocumentKnowingFrame ( const KoPoint &  relPoint,
KWFrame *  theFrame 
) const

A variant of internalToDocument, when the frame is already known.

Both faster, and more correct for inline frames that spawn over multiple containing frames

Definition at line 429 of file KWTextFrameSet.cpp.

◆ internalToDocumentKnowingFrame() [2/2]

KoPoint KWTextFrameSet::internalToDocumentKnowingFrame ( const TQPoint &  iPoint,
KWFrame *  theFrame 
) const

Definition at line 441 of file KWTextFrameSet.cpp.

◆ internalToDocumentWithHint()

KWFrame * KWTextFrameSet::internalToDocumentWithHint ( const TQPoint &  iPoint,
KoPoint &  dPoint,
const KoPoint &  hintDPoint 
) const

Same as internalToDocument, but goes directly to the normal coords (zoomed) since this method is used for view stuff only (mouse).

Parameters
hintDPointhint, in case of copied frames. If specified, its y value will be used as a minimum on the returned result, to prefer a frame over any of its copies (e.g. in the header/footer case).
iPointinternal document point
dPointthe other point

Definition at line 380 of file KWTextFrameSet.cpp.

◆ invalidate()

void KWTextFrameSet::invalidate ( )
virtual

Invalidate all paragraphs (causes a re-flow of the text upon next redraw)

Reimplemented from KWFrameSet.

Definition at line 834 of file KWTextFrameSet.cpp.

◆ isFrameEmpty()

bool KWTextFrameSet::isFrameEmpty ( KWFrame *  frame)

Return true if the last frame is empty.

Definition at line 2495 of file KWTextFrameSet.cpp.

◆ kwTextDocument()

KWTextDocument * KWTextFrameSet::kwTextDocument ( ) const

Definition at line 213 of file KWTextFrameSet.cpp.

◆ layout()

void KWTextFrameSet::layout ( )
virtual

Invalidate all paragraphs and start re-formatting.

Reimplemented from KWFrameSet.

Definition at line 827 of file KWTextFrameSet.cpp.

◆ linkVariableUnderMouse()

KoLinkVariable * KWTextFrameSet::linkVariableUnderMouse ( const KoPoint &  dPoint)

Definition at line 3082 of file KWTextFrameSet.cpp.

◆ load()

void KWTextFrameSet::load ( TQDomElement &  framesetElem,
bool  loadFrames = true 
)
virtual

load from XML - when loading

Reimplemented from KWFrameSet.

Definition at line 1874 of file KWTextFrameSet.cpp.

◆ loadOasis()

KWFrame * KWTextFrameSet::loadOasis ( const TQDomElement &  frame,
const TQDomElement &  bodyElem,
KoOasisContext &  context 
)

Load a complete textbox (frame and text)

Definition at line 1751 of file KWTextFrameSet.cpp.

◆ loadOasisContent()

void KWTextFrameSet::loadOasisContent ( const TQDomElement &  bodyElem,
KoOasisContext &  context 
)

Load the contents of a frame (i.e. the text)

Definition at line 1746 of file KWTextFrameSet.cpp.

◆ loadOasisTextFrame()

KWFrame * KWTextFrameSet::loadOasisTextFrame ( const TQDomElement &  frameTag,
const TQDomElement &  tag,
KoOasisContext &  context 
)

Load a frame and add it to this frameset - called by KWOasisLoader.

Definition at line 1711 of file KWTextFrameSet.cpp.

◆ mainTextHeightChanged

void KWTextFrameSet::mainTextHeightChanged ( )
signal

Tell the text viewmode that the height of the text might have changed.

◆ minMaxInternalOnPage()

bool KWTextFrameSet::minMaxInternalOnPage ( int  pageNum,
int &  topLU,
int &  bottomLU 
) const

Return the min and max LU coordinates for the text in the given page, if the frameset has any frames in this page.

Used by e.g. KWDoc::sectionTitle and KWFrameLayout.

Definition at line 2756 of file KWTextFrameSet.cpp.

◆ moveToPage()

TQPoint KWTextFrameSet::moveToPage ( int  currentPgNum,
short int  direction 
) const

Implementation of Ctrl+PageUp/PageDown Returns a point in layout units (for placing the cursor)

Definition at line 447 of file KWTextFrameSet.cpp.

◆ nextTextObject()

virtual KWTextFrameSet * KWTextFrameSet::nextTextObject ( KWFrameSet *  )
inlinevirtual

Iteration over text objects - used by KWBgSpellCheck.

Reimplemented from KWFrameSet.

Definition at line 295 of file KWTextFrameSet.h.

◆ paragAtLUPos()

KoTextParag * KWTextFrameSet::paragAtLUPos ( int  yLU) const

Find the parag at the given Y position (in LU)

Definition at line 2778 of file KWTextFrameSet.cpp.

◆ paragraphs()

int KWTextFrameSet::paragraphs ( )
virtual

Reimplemented from KWFrameSet.

Definition at line 846 of file KWTextFrameSet.cpp.

◆ paragraphsSelected()

int KWTextFrameSet::paragraphsSelected ( )
virtual

Reimplemented from KWFrameSet.

Definition at line 855 of file KWTextFrameSet.cpp.

◆ paragRect()

TQRect KWTextFrameSet::paragRect ( KoTextParag *  parag) const

Definition at line 2721 of file KWTextFrameSet.cpp.

◆ pasteOasis()

KCommand * KWTextFrameSet::pasteOasis ( KoTextCursor *  cursor,
const TQByteArray &  data,
bool  removeSelected 
)

Definition at line 2628 of file KWTextFrameSet.cpp.

◆ printDebug()

void KWTextFrameSet::printDebug ( )
virtual

Reimplemented from KWFrameSet.

Definition at line 1661 of file KWTextFrameSet.cpp.

◆ protectContent()

bool KWTextFrameSet::protectContent ( ) const
inlinevirtual

Implements KWFrameSet.

Definition at line 91 of file KWTextFrameSet.h.

◆ removeHighlight()

void KWTextFrameSet::removeHighlight ( bool  repaint = true)

Definition at line 2845 of file KWTextFrameSet.cpp.

◆ renumberFootNotes()

void KWTextFrameSet::renumberFootNotes ( bool  repaint = true)

(Assuming this==main frameset), recalc the foot note numbers

Definition at line 2922 of file KWTextFrameSet.cpp.

◆ rtl()

bool KWTextFrameSet::rtl ( ) const
virtual

Definition at line 2891 of file KWTextFrameSet.cpp.

◆ save()

virtual TQDomElement KWTextFrameSet::save ( TQDomElement &  parentElem,
bool  saveFrames = true 
)
inlinevirtual

save to XML - when saving

Implements KWFrameSet.

Definition at line 158 of file KWTextFrameSet.h.

◆ saveOasis()

void KWTextFrameSet::saveOasis ( KoXmlWriter &  writer,
KoSavingContext &  context,
bool  saveFrames 
) const
virtual

Save a complete textbox (frame and text)

Implements KWFrameSet.

Definition at line 1833 of file KWTextFrameSet.cpp.

◆ saveOasisContent()

void KWTextFrameSet::saveOasisContent ( KoXmlWriter &  writer,
KoSavingContext &  context 
) const

Save the contents of a frame (i.e. the text)

Definition at line 1764 of file KWTextFrameSet.cpp.

◆ selectedText()

TQString KWTextFrameSet::selectedText ( ) const

returns the selected text [without formatting] if hasSelection()

Definition at line 2811 of file KWTextFrameSet.cpp.

◆ setChangeCaseOfTextCommand()

KCommand * KWTextFrameSet::setChangeCaseOfTextCommand ( KoChangeCaseDia::TypeOfCase  _type)
virtual

Definition at line 2866 of file KWTextFrameSet.cpp.

◆ setFormatCommand()

KCommand * KWTextFrameSet::setFormatCommand ( const KoTextFormat *  newFormat,
int  flags,
bool  zoomFont = false 
)
virtual

Let KoTextFormatInterface set the modified format.

Definition at line 2878 of file KWTextFrameSet.cpp.

◆ setInlineFramesVisible()

void KWTextFrameSet::setInlineFramesVisible ( bool  visible)

Show or hide all inline frames that are inside this frameset.

Definition at line 1928 of file KWTextFrameSet.cpp.

◆ setPageBreakingCommand()

KCommand * KWTextFrameSet::setPageBreakingCommand ( KoTextCursor *  cursor,
int  pageBreaking 
)

Definition at line 2587 of file KWTextFrameSet.cpp.

◆ setParagLayoutFormatCommand()

KCommand * KWTextFrameSet::setParagLayoutFormatCommand ( KoParagLayout *  newLayout,
int  flags,
int  marginIndex = -1 
)
virtual

Let KoTextFormatInterface set a modified current parag layout.

Definition at line 2897 of file KWTextFrameSet.cpp.

◆ setProtectContent()

void KWTextFrameSet::setProtectContent ( bool  _protect)
inlinevirtual

Implements KWFrameSet.

Definition at line 90 of file KWTextFrameSet.h.

◆ setVisible()

void KWTextFrameSet::setVisible ( bool  v)
virtual

set the visibility of the frameset.

Reimplemented from KWFrameSet.

Definition at line 1922 of file KWTextFrameSet.cpp.

◆ slotAfterFormatting

void KWTextFrameSet::slotAfterFormatting ( int  bottom,
KoTextParag *  lastFormatted,
bool *  abort 
)
protectedslot

Definition at line 2262 of file KWTextFrameSet.cpp.

◆ slotAvailableHeightNeeded

void KWTextFrameSet::slotAvailableHeightNeeded ( )
protectedslot

Definition at line 218 of file KWTextFrameSet.cpp.

◆ slotNewCommand

void KWTextFrameSet::slotNewCommand ( KCommand *  cmd)
protectedslot

Definition at line 1945 of file KWTextFrameSet.cpp.

◆ slotParagraphCreated

void KWTextFrameSet::slotParagraphCreated ( KoTextParag *  _parag)
protectedslot

Definition at line 185 of file KWTextFrameSet.cpp.

◆ slotParagraphDeleted

void KWTextFrameSet::slotParagraphDeleted ( KoTextParag *  _parag)
protectedslot

Definition at line 190 of file KWTextFrameSet.cpp.

◆ slotParagraphModified

void KWTextFrameSet::slotParagraphModified ( KoTextParag *  _parag,
int  _type,
int  start,
int  length 
)
protectedslot

Definition at line 180 of file KWTextFrameSet.cpp.

◆ slotRepaintChanged

void KWTextFrameSet::slotRepaintChanged ( )
slot

Definition at line 841 of file KWTextFrameSet.cpp.

◆ sortText()

TQByteArray KWTextFrameSet::sortText ( SortType  type) const

Sort selected paragraphs Return a complete OASIS store, ready for "pasting".

Definition at line 3007 of file KWTextFrameSet.cpp.

◆ statistics()

bool KWTextFrameSet::statistics ( TQProgressDialog *  progress,
ulong &  charsWithSpace,
ulong &  charsWithoutSpace,
ulong &  words,
ulong &  sentences,
ulong &  syllables,
ulong &  lines,
bool  selected 
)
virtual

Calculate statistics for this frameset.

Reimplemented from KWFrameSet.

Definition at line 867 of file KWTextFrameSet.cpp.

◆ textDocument()

KoTextDocument * KWTextFrameSet::textDocument ( ) const

Definition at line 208 of file KWTextFrameSet.cpp.

◆ textObject()

KoTextObject * KWTextFrameSet::textObject ( ) const
inline

Return the contained text object.

Definition at line 85 of file KWTextFrameSet.h.

◆ toPlainText()

TQString KWTextFrameSet::toPlainText ( ) const
virtual

Reimplemented from KWFrameSet.

Definition at line 2816 of file KWTextFrameSet.cpp.

◆ toXML()

virtual TQDomElement KWTextFrameSet::toXML ( TQDomElement &  parentElem,
bool  saveFrames = true 
)
inlinevirtual

save to XML - when copying to clipboard (includes floating framesets)

Reimplemented from KWFrameSet.

Definition at line 161 of file KWTextFrameSet.h.

◆ type()

virtual FrameSetType KWTextFrameSet::type ( ) const
inlinevirtual

The type of frameset.

Use this to differentiate between different instantiations of the framesets. Each implementation will return a different frameType.

Reimplemented from KWFrameSet.

Definition at line 80 of file KWTextFrameSet.h.

◆ updateFrames()

void KWTextFrameSet::updateFrames ( int  flags = 0xff)
virtual

reshuffle frames so text is always displayed from top-left down and then right.

Parameters
flags

Reimplemented from KWFrameSet.

Definition at line 1437 of file KWTextFrameSet.cpp.

◆ updateViewArea()

void KWTextFrameSet::updateViewArea ( TQWidget *  w,
KWViewMode *  viewMode,
const TQPoint &  nPointBottom 
)

Views notify the KWTextFrameSet of which area of the text they're looking at, so that formatMore() ensures it's always formatted correctly.

Parameters
wthe wigdet (usually kwcanvas) that identifies the view
wthe current viewmode (to make sure the frameset is visible)
nPointBottomthe max the view looks at, in normal coordinates
viewModethe current viewMode

Definition at line 2555 of file KWTextFrameSet.cpp.

◆ variableUnderMouse()

KoVariable * KWTextFrameSet::variableUnderMouse ( const KoPoint &  dPoint)

Definition at line 3074 of file KWTextFrameSet.cpp.


The documentation for this class was generated from the following files: