lib Library API Documentation

KoParagLayout Class Reference

This class holds the paragraph-specific formatting information It's separated from KoTextParag so that it can be copied in the undo/redo history, and in KoParagStyle. More...

#include <koparaglayout.h>

Collaboration diagram for KoParagLayout:

Collaboration graph
[legend]
List of all members.

Public Types

enum  {
  Alignment = 1, BulletNumber = 2, Margins = 4, LineSpacing = 8,
  Borders = 16, Tabulator = 32, PageBreaking = 64, All = Alignment | BulletNumber | Margins | LineSpacing | Borders | Tabulator | PageBreaking
}
enum  {
  BreakBetweenLines = 0, KeepLinesTogether = 1, HardFrameBreakBefore = 2, HardFrameBreakAfter = 4,
  KeepWithPrevious = 8, KeepWithNext = 16
}
enum  SpacingType {
  LS_SINGLE = 0, LS_ONEANDHALF = -1, LS_DOUBLE = -2, LS_CUSTOM = -3,
  LS_AT_LEAST = -4, LS_MULTIPLE = -5, LS_FIXED = -6
}

Public Member Functions

 KoParagLayout (const KoParagLayout &layout)
double lineSpacingValue () const
void setLineSpacingValue (double _value)
bool hasBorder () const
void setTabList (const KoTabulatorList &tabList)
const KoTabulatorListtabList () const
void operator= (const KoParagLayout &)
int compare (const KoParagLayout &layout) const
void saveParagLayout (QDomElement &parentElem, int alignment) const
void saveOasis (KoGenStyle &gs, KoSavingContext &context, bool savingStyle) const

Static Public Member Functions

static void loadParagLayout (KoParagLayout &layout, const QDomElement &parentElem, int docVersion=2)
static void loadOasisParagLayout (KoParagLayout &layout, KoOasisContext &context)
static Qt::AlignmentFlags loadOasisAlignment (const QCString &str)
static QCString saveOasisAlignment (Qt::AlignmentFlags alignment)

Public Attributes

enum KoParagLayout:: { ... }  Flags
double margins [5]
SpacingType lineSpacingType
char unused
char pageBreaking
char direction
char alignment
KoBorder leftBorder
KoBorder rightBorder
KoBorder topBorder
KoBorder bottomBorder
KoParagCountercounter
KoParagStylestyle

Static Public Attributes

static QStringshadowCssCompat = 0L

Detailed Description

This class holds the paragraph-specific formatting information It's separated from KoTextParag so that it can be copied in the undo/redo history, and in KoParagStyle.

Definition at line 38 of file koparaglayout.h.


Member Enumeration Documentation

anonymous enum
 

This enum is used to mark parts of a KoParagLayout as changed (i.e.

when changing them in the dialog/stylist)

Definition at line 48 of file koparaglayout.h.

anonymous enum
 

Page breaking flags.

Definition at line 60 of file koparaglayout.h.

enum KoParagLayout::SpacingType
 

Line spacing values Assuming h is the height of the biggest char in the line, and v is the linespacing value, the total line height is:.

Single: h 1.5/2/multiple: v*h Custom (aka "line distance"): h + v At least: >= v Fixed: v

Definition at line 83 of file koparaglayout.h.


Member Function Documentation

int KoParagLayout::compare const KoParagLayout layout  )  const
 

Return a set of flags showing the differences between this and 'layout'.

Definition at line 67 of file koparaglayout.cc.

References alignment, bottomBorder, counter, leftBorder, lineSpacing, lineSpacingType, m_tabList, margins, KoParagCounter::numbering(), pageBreaking, rightBorder, and topBorder.

void KoParagLayout::saveParagLayout QDomElement parentElem,
int  alignment
const
 

Save this parag layout to XML.

This format is used by KWord for paragraphs, and by KPresenter+KWord for styles.

Definition at line 637 of file koparaglayout.cc.

References bottomBorder, counter, direction, KoCharStyle::displayName(), leftBorder, lineSpacing, lineSpacingType, margins, KoParagCounter::numbering(), pageBreaking, KoBorder::penWidth(), rightBorder, KoParagCounter::save(), KoBorder::save(), style, tabList(), and topBorder.

Referenced by KoParagStyle::saveStyle().

void KoParagLayout::loadParagLayout KoParagLayout layout,
const QDomElement parentElem,
int  docVersion = 2
[static]
 

Load this parag layout from XML.

This format is used by KWord for paragraphs, and by KPresenter+KWord for styles.

Definition at line 136 of file koparaglayout.cc.

References KoTabulator::alignChar, alignment, bottomBorder, counter, direction, KoTabulator::filling, leftBorder, lineSpacing, lineSpacingType, KoParagCounter::load(), margins, pageBreaking, KoTabulator::ptPos, KoTabulator::ptWidth, rightBorder, KoBorder::setPenWidth(), setTabList(), KoTextFormat::shadowAsCss(), topBorder, and KoTabulator::type.

Referenced by KoParagStyle::loadStyle().

void KoParagLayout::loadOasisParagLayout KoParagLayout layout,
KoOasisContext context
[static]
 

Load this parag layout from Oasis XML.

Definition at line 425 of file koparaglayout.cc.

References KoTabulator::alignChar, alignment, bottomBorder, direction, KoTabulator::filling, leftBorder, lineSpacing, lineSpacingType, KoBorder::loadFoBorder(), loadOasisAlignment(), margins, pageBreaking, KoUnit::parseValue(), KoTabulator::ptPos, KoTabulator::ptWidth, rightBorder, KoBorder::setPenWidth(), setTabList(), KoOasisContext::styleStack(), topBorder, and KoTabulator::type.

Referenced by KoParagStyle::loadStyle().

void KoParagLayout::saveOasis KoGenStyle gs,
KoSavingContext context,
bool  savingStyle
const
 

Save this parag layout to Oasis XML.

Parameters:
savingStyle true if this is saved as part of a user style, false when saving a paragraph

Definition at line 783 of file koparaglayout.cc.

References KoXmlWriter::addAttribute(), KoXmlWriter::addAttributePt(), KoGenStyle::addChildElement(), KoGenStyle::addProperty(), KoGenStyle::addPropertyPt(), alignment, KoXmlWriter::endElement(), KoSavingContext::hasColumns(), margins, KoBorder::penWidth(), KoBorder::saveFoBorder(), saveOasisAlignment(), and KoXmlWriter::startElement().

Referenced by KoParagStyle::saveStyle().

Qt::AlignmentFlags KoParagLayout::loadOasisAlignment const QCString str  )  [static]
 

Convert an alignment string into an alignment flag (load).

Definition at line 402 of file koparaglayout.cc.

Referenced by loadOasisParagLayout().

QCString KoParagLayout::saveOasisAlignment Qt::AlignmentFlags  alignment  )  [static]
 

Convert an alignment flag into an alignment string (save).

Definition at line 416 of file koparaglayout.cc.

Referenced by saveOasis(), and KoParagCounter::saveOasisListLevel().


Member Data Documentation

enum { ... } KoParagLayout::Flags
 

This enum is used to mark parts of a KoParagLayout as changed (i.e.

when changing them in the dialog/stylist)

double KoParagLayout::margins[5]
 

left, right, top, bottom, firstLineSpacing - in pt

Definition at line 71 of file koparaglayout.h.

Referenced by compare(), loadOasisParagLayout(), loadParagLayout(), saveOasis(), and saveParagLayout().

char KoParagLayout::alignment
 

Alignment flag (AlignAuto/AlignLeft/AlignRight/AlignJustify).

Definition at line 95 of file koparaglayout.h.

Referenced by compare(), loadOasisParagLayout(), loadParagLayout(), saveOasis(), and KoParagStyle::saveStyle().

KoParagCounter* KoParagLayout::counter
 

can be 0 if no counter set

Definition at line 98 of file koparaglayout.h.

Referenced by compare(), loadParagLayout(), saveParagLayout(), and KoParagStyle::saveStyle().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for lib Library Version 1.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Feb 13 09:41:12 2006 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003