kword

KWFrame Class Reference

#include <KWFrame.h>

Inherits KoRect.

List of all members.


Detailed Description

This class represents a single frame.

A frame belongs to a frameset which states its contents. A frame does NOT have contents, the frameset stores that. A frame is really just a square that is used to place the content of a frameset.

Definition at line 69 of file KWFrame.h.


Public Types

enum  RunAround { RA_NO = 0, RA_BOUNDINGRECT = 1, RA_SKIP = 2 }
enum  RunAroundSide { RA_BIGGEST = 0, RA_LEFT = 1, RA_RIGHT = 2 }
enum  FrameBehavior { AutoExtendFrame = 0, AutoCreateNewFrame = 1, Ignore = 2 }
enum  SheetSide { AnySide = 0, OddSide = 1, EvenSide = 2 }
enum  NewFrameBehavior { Reconnect = 0, NoFollowup = 1, Copy = 2 }

Public Member Functions

 KWFrame (KWFrameSet *fs, double left, double top, double width, double height, RunAround ra=RA_BOUNDINGRECT)
 KWFrame (KWFrame *frame)
virtual ~KWFrame ()
double runAroundLeft () const
double runAroundRight () const
double runAroundTop () const
double runAroundBottom () const
void setRunAroundGap (double left, double right, double top, double bottom)
RunAround runAround () const
void setRunAround (RunAround _ra)
RunAroundSide runAroundSide () const
void setRunAroundSide (RunAroundSide rs)
FrameBehavior frameBehavior () const
void setFrameBehavior (FrameBehavior fb)
SheetSide sheetSide () const
void setSheetSide (SheetSide ss)
NewFrameBehavior newFrameBehavior () const
void setNewFrameBehavior (NewFrameBehavior nfb)
bool isCopy () const
void setCopy (bool copy)
KWFrameSetframeSet () const
void setFrameSet (KWFrameSet *fs)
int pageNumber () const
int pageNumber (KWDocument *doc) const
void setZOrder (int z)
int zOrder () const
KWFrameListframeStack ()
void setFrameStack (KWFrameList *fl)
const KoBorder & leftBorder () const
const KoBorder & rightBorder () const
const KoBorder & topBorder () const
const KoBorder & bottomBorder () const
void setLeftBorder (KoBorder _brd)
void setRightBorder (KoBorder _brd)
void setTopBorder (KoBorder _brd)
void setBottomBorder (KoBorder _brd)
QRect outerRect (KWViewMode *viewMode) const
KoRect outerKoRect () const
KoRect runAroundRect () const
const KoRect & rect () const
void frameBordersChanged ()
void updateRulerHandles ()
QBrush backgroundColor () const
void setBackgroundColor (const QBrush &_color)
bool isTransparent () const
KoRect innerRect () const
double innerWidth () const
double innerHeight () const
void setInternalY (double y)
double internalY () const
void setPaddingLeft (double b)
void setPaddingRight (double b)
void setPaddingTop (double b)
void setPaddingBottom (double b)
double paddingLeft () const
double paddingRight () const
double paddingTop () const
double paddingBottom () const
void setFramePadding (double _left, double _top, double right, double bottom)
KWFramegetCopy ()
void copySettings (KWFrame *frm)
void save (QDomElement &frameElem)
void load (QDomElement &frameElem, KWFrameSet *frameSet, int syntaxVersion)
void loadCommonOasisProperties (KoOasisContext &context, KWFrameSet *frameSet, const char *typeProperties)
void loadBorderProperties (KoStyleStack &styleStack)
QString saveOasisFrameStyle (KoGenStyles &mainStyles) const
void startOasisFrame (KoXmlWriter &xmlWriter, KoGenStyles &mainStyles, const QString &name, const QString &lastFrameName=QString::null) const
void saveBorderProperties (KoGenStyle &frameStyle) const
void saveMarginProperties (KoGenStyle &frameStyle) const
void saveMarginAttributes (KoXmlWriter &writer) const
void setMinimumFrameHeight (double h)
double minimumFrameHeight (void) const
bool frameAtPos (const QPoint &nPoint, bool borderOfFrameOnly=false) const
void setDrawFootNoteLine (bool b)
bool drawFootNoteLine () const

Static Public Member Functions

static bool compareFrameZOrder (KWFrame *f1, KWFrame *f2)

Member Enumeration Documentation

Runaround types RA_NO = No run around, all text is just printed.

RA_BOUNDINGRECT = run around the square of this frame. RA_SKIP = stop running text on the whole horizontal space this frame occupies.

Definition at line 77 of file KWFrame.h.

Runaround side - only meaningful when RA_BOUNDINGRECT is used.

Definition at line 81 of file KWFrame.h.

what should happen when the frame is full

Definition at line 118 of file KWFrame.h.

This frame will only be copied to: AnySide, OddSide or EvenSide.

Definition at line 128 of file KWFrame.h.

What happens on new page (create a new frame and reconnect, no followup, make copy).

Definition at line 134 of file KWFrame.h.


Constructor & Destructor Documentation

KWFrame::KWFrame ( KWFrameSet fs,
double  left,
double  top,
double  width,
double  height,
RunAround  ra = RA_BOUNDINGRECT 
)

Constructor.

Parameters:
fs parent frameset
left,top,width,height coordinates of the frame The page number will be automatically determined from the position of the frame.
ra the "runaround" setting, i.e. whether text should flow below the frame, around the frame, or avoiding the frame on the whole horizontal band.

Definition at line 70 of file KWFrame.cpp.

KWFrame::~KWFrame (  )  [virtual]

Destructor.

Definition at line 103 of file KWFrame.cpp.


Member Function Documentation

bool KWFrame::isCopy (  )  const [inline]

Drawing property: if isCopy, this frame is a copy of the previous frame in the frameset.

Definition at line 140 of file KWFrame.h.

KWFrameSet* KWFrame::frameSet (  )  const [inline]

Data stucture methods.

Definition at line 145 of file KWFrame.h.

int KWFrame::pageNumber (  )  const

The page on which this frame is.

Definition at line 116 of file KWFrame.cpp.

int KWFrame::pageNumber ( KWDocument *  doc  )  const

Same as pageNumber(), but works if the frame hasn't been added to a frameset yet.

Definition at line 130 of file KWFrame.cpp.

void KWFrame::setZOrder ( int  z  )  [inline]

The z-order of the frame, relative to the other frames on the same page.

Definition at line 157 of file KWFrame.h.

bool KWFrame::compareFrameZOrder ( KWFrame f1,
KWFrame f2 
) [static]

This is a method used to sort a list using the STL sorting methods.

Parameters:
f1 the first object
f2 the second object

Definition at line 750 of file KWFrame.cpp.

const KoBorder& KWFrame::leftBorder (  )  const [inline]

All borders can be custom drawn with their own colors etc.

Definition at line 172 of file KWFrame.h.

QRect KWFrame::outerRect ( KWViewMode viewMode  )  const

Return the _zoomed_ rectangle for this frame, including the border - for drawing.

Parameters:
viewMode needed to know if borders are visible or not

Definition at line 185 of file KWFrame.cpp.

KoRect KWFrame::outerKoRect (  )  const

Return the unzoomed rectangle, including the border, for the frames-on-top list.

The default border of size 1-pixel that is drawn on screen is _not_ included here [since it depends on the zoom]

Definition at line 200 of file KWFrame.cpp.

KoRect KWFrame::runAroundRect (  )  const

Return the rectangle for this frame including the border and the runaround gap.

This is the rectangle that the surrounding text must run around.

Definition at line 212 of file KWFrame.cpp.

const KoRect& KWFrame::rect (  )  const [inline]

Return the rectangle for this frame.

This method is just so that new code doesn't rely on "KWFrame inherits KoRect", which would be good to get rid of, at some point.

Definition at line 203 of file KWFrame.h.

void KWFrame::frameBordersChanged (  ) 

Marks a frame to have changed position/borders.

Make sure you call this when the frame borders changed so when its inline it will be moved.

Definition at line 167 of file KWFrame.cpp.

void KWFrame::setInternalY ( double  y  )  [inline]

The "internal Y" is the offset (in pt) of the real frame showed in this one ("real" means "the last that isn't a copy") This offset in pt is the sum of the height of the frames before that one.

For text frames, this is equivalent to the layout units (after multiplication).

Definition at line 225 of file KWFrame.h.

void KWFrame::setPaddingLeft ( double  b  )  [inline]

set left padding (distance between frame contents and frame border)

Definition at line 229 of file KWFrame.h.

void KWFrame::setPaddingRight ( double  b  )  [inline]

set right padding

Definition at line 231 of file KWFrame.h.

void KWFrame::setPaddingTop ( double  b  )  [inline]

set top padding

Definition at line 233 of file KWFrame.h.

void KWFrame::setPaddingBottom ( double  b  )  [inline]

set bottom padding

Definition at line 235 of file KWFrame.h.

double KWFrame::paddingLeft (  )  const [inline]

get left padding

Definition at line 238 of file KWFrame.h.

double KWFrame::paddingRight (  )  const [inline]

get right padding

Definition at line 240 of file KWFrame.h.

double KWFrame::paddingTop (  )  const [inline]

get top padding

Definition at line 242 of file KWFrame.h.

double KWFrame::paddingBottom (  )  const [inline]

get bottom padding

Definition at line 244 of file KWFrame.h.

KWFrame * KWFrame::getCopy (  ) 

returns a copy of self

Definition at line 135 of file KWFrame.cpp.

void KWFrame::save ( QDomElement &  frameElem  ) 

create XML to describe yourself

Definition at line 222 of file KWFrame.cpp.

void KWFrame::load ( QDomElement &  frameElem,
KWFrameSet frameSet,
int  syntaxVersion 
)

read attributes from XML.

headerOrFooter if true some defaults are different

Definition at line 340 of file KWFrame.cpp.

void KWFrame::startOasisFrame ( KoXmlWriter &  xmlWriter,
KoGenStyles &  mainStyles,
const QString &  name,
const QString &  lastFrameName = QString::null 
) const

Write out a draw:frame element and its style.

The caller is responsible for creating the child element and closing the draw:frame element. lastFrameName is the name of the previous frame in the same frameset; this is only used for copy-frames

Definition at line 544 of file KWFrame.cpp.

void KWFrame::setMinimumFrameHeight ( double  h  )  [inline]

The property minimum frame height is used to make the automatic frame shrinking code stop.

Each frame has a height based on its frame dimentions, but changes in content may change the sizes automatically. If all text is removed from a text frame it will grow smaller until the minimum frame height is reached, and it will not shrink below that.

Parameters:
h the new minimum height

Definition at line 281 of file KWFrame.h.

double KWFrame::minimumFrameHeight ( void   )  const [inline]

Returns:
the minimum frame height.
See also:
setMinimumFrameHeight() for details.

Definition at line 286 of file KWFrame.h.

bool KWFrame::frameAtPos ( const QPoint &  nPoint,
bool  borderOfFrameOnly = false 
) const

Return if the point is on the frame.

Parameters:
nPoint the point in normal coordinates.
borderOfFrameOnly when true an additional check is done if the point is on the border.

Definition at line 718 of file KWFrame.cpp.

void KWFrame::setDrawFootNoteLine ( bool  b  )  [inline]

Only applicable to frames of the main text frameset.

Set to true by KWFrameLayout if the "footnote line" should be drawn under this frame.

Definition at line 299 of file KWFrame.h.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys