lib

#include <KoParagCounter.h>

Public Types

enum  Numbering { NUM_NONE = 2 , NUM_LIST = 0 , NUM_CHAPTER = 1 , NUM_FOOTNOTE = 3 }
enum  Style {
  STYLE_NONE = 0 , STYLE_NUM = 1 , STYLE_ALPHAB_L = 2 , STYLE_ALPHAB_U = 3 ,
  STYLE_ROM_NUM_L = 4 , STYLE_ROM_NUM_U = 5 , STYLE_CUSTOMBULLET = 6 , STYLE_CUSTOM = 7 ,
  STYLE_CIRCLEBULLET = 8 , STYLE_SQUAREBULLET = 9 , STYLE_DISCBULLET = 10 , STYLE_BOXBULLET = 11
}

Public Member Functions

void invalidate ()
int number (const KoTextParag *paragraph)
TQString levelText (const KoTextParag *paragraph)
TQString text (const KoTextParag *paragraph)
int width (const KoTextParag *paragraph)
int bulletX ()
void load (TQDomElement &element)
void save (TQDomElement &element)
void loadOasis (KoOasisContext &context, int restartNumbering, bool orderedList, bool heading, int level, bool loadingStyle=false)
void loadOasisListStyle (const TQDomElement &listStyle, const TQDomElement &listStyleProperties, const TQDomElement &listStyleTextProperties, int restartNumbering, bool orderedList, bool heading, int level, bool loadingStyle)
void saveOasis (KoGenStyle &listStyle, bool savingStyle=false) const
void saveOasisListLevel (KoXmlWriter &listLevelWriter, bool includeLevelAndProperties, bool savingStyle=false) const
bool operator== (const KoParagCounter &c2) const
bool operator!= (const KoParagCounter &c2) const
Numbering numbering () const
void setNumbering (Numbering n)
Style style () const
void setStyle (Style s)
bool restartCounter () const
void setRestartCounter (bool restart)
bool isBullet () const
unsigned int depth () const
void setDepth (unsigned int d)
int displayLevels () const
void setDisplayLevels (int l)
int startNumber () const
void setStartNumber (int s)
TQString prefix () const
void setPrefix (TQString p)
TQString suffix () const
void setSuffix (TQString s)
TQChar customBulletCharacter () const
void setCustomBulletCharacter (TQChar c)
TQString customBulletFont () const
void setCustomBulletFont (TQString f)
TQString custom () const
void setCustom (TQString c)
int alignment () const
void setAlignment (int a)
void printRTDebug (KoTextParag *parag)

Static Public Member Functions

static bool isBullet (Style style)
static KoTextFormat * counterFormat (const KoTextParag *paragraph)
static TQString makeRomanNumber (int n)
static TQString makeAlphaUpperNumber (int n)
static TQString makeAlphaLowerNumber (int n)
static int fromRomanNumber (const TQString &)
static int fromAlphaUpperNumber (const TQString &)
static int fromAlphaLowerNumber (const TQString &)

Detailed Description

This is the structure associated with a paragraph (KoTextParag), to define the bullet or numbering of the paragraph.

Definition at line 36 of file KoParagCounter.h.

Member Enumeration Documentation

◆ Numbering

enum KoParagCounter::Numbering

Definition at line 99 of file KoParagCounter.h.

◆ Style

enum KoParagCounter::Style

Definition at line 108 of file KoParagCounter.h.

Constructor & Destructor Documentation

◆ KoParagCounter()

KoParagCounter::KoParagCounter ( )

Definition at line 35 of file KoParagCounter.cpp.

Member Function Documentation

◆ alignment()

int KoParagCounter::alignment ( ) const

Counter alignment.

Definition at line 606 of file KoParagCounter.cpp.

◆ bulletX()

int KoParagCounter::bulletX ( )

X position of the bullet ( i.e.

width of prefix ) Unit : LU pixels

Definition at line 808 of file KoParagCounter.cpp.

◆ counterFormat()

KoTextFormat * KoParagCounter::counterFormat ( const KoTextParag * paragraph)
static

Return the format to use for the counter.

This does no caching, it's merely to centralize code.

◆ custom()

TQString KoParagCounter::custom ( ) const

The string STYLE_CUSTOM.

Definition at line 66 of file KoParagCounter.cpp.

◆ customBulletCharacter()

TQChar KoParagCounter::customBulletCharacter ( ) const

The character and font for STYLE_CUSTOMBULLET.

Definition at line 71 of file KoParagCounter.cpp.

◆ customBulletFont()

TQString KoParagCounter::customBulletFont ( ) const

Definition at line 76 of file KoParagCounter.cpp.

◆ depth()

unsigned int KoParagCounter::depth ( ) const

The level of the numbering.

Depth of 0 means the major numbering. (1, 2, 3...) Depth of 1 is 1.1, 1.2, 1.3 etc.

Definition at line 81 of file KoParagCounter.cpp.

◆ displayLevels()

int KoParagCounter::displayLevels ( ) const

Number of levels whose numbers are displayed at the current level.

Definition at line 601 of file KoParagCounter.cpp.

◆ fromAlphaLowerNumber()

int KoParagCounter::fromAlphaLowerNumber ( const TQString & string)
static

Definition at line 948 of file KoParagCounter.cpp.

◆ fromAlphaUpperNumber()

int KoParagCounter::fromAlphaUpperNumber ( const TQString & string)
static

Definition at line 927 of file KoParagCounter.cpp.

◆ fromRomanNumber()

int KoParagCounter::fromRomanNumber ( const TQString & string)
static

Definition at line 880 of file KoParagCounter.cpp.

◆ invalidate()

void KoParagCounter::invalidate ( )

Invalidate the internal cache.

Use it whenever the number associated with this counter may have changed.

Definition at line 86 of file KoParagCounter.cpp.

◆ isBullet() [1/2]

bool KoParagCounter::isBullet ( ) const

Does this counter have a bullet style?

Definition at line 110 of file KoParagCounter.cpp.

◆ isBullet() [2/2]

bool KoParagCounter::isBullet ( Style style)
static

Helper function for finding out if a style is a bullet.

Definition at line 95 of file KoParagCounter.cpp.

◆ levelText()

TQString KoParagCounter::levelText ( const KoTextParag * paragraph)

Return the current value of the counter as a text.

This returns only the current level, e.g. "1."

Definition at line 633 of file KoParagCounter.cpp.

◆ load()

void KoParagCounter::load ( TQDomElement & element)

KOffice-1.3 loading code.

Definition at line 115 of file KoParagCounter.cpp.

◆ loadOasis()

void KoParagCounter::loadOasis ( KoOasisContext & context,
int restartNumbering,
bool orderedList,
bool heading,
int level,
bool loadingStyle = false )

Load from OASIS XML.

Parameters
headingtrue if heading, false if normal list
level1-based
loadingStyletrue if loading a style, false if loading a paragraph
contextthe context
restartNumberingif -1 then don't restart numbering, use the style value
orderedListif true, make sure the parag will will be initialised as an ordered list otherwise it may be initialised as a unordered list.

Definition at line 179 of file KoParagCounter.cpp.

◆ loadOasisListStyle()

void KoParagCounter::loadOasisListStyle ( const TQDomElement & listStyle,
const TQDomElement & listStyleProperties,
const TQDomElement & listStyleTextProperties,
int restartNumbering,
bool orderedList,
bool heading,
int level,
bool loadingStyle )

Part of loadOasis that is shared with KWVariableSettings::loadOasis for footnotes/endnotes.

Definition at line 189 of file KoParagCounter.cpp.

◆ makeAlphaLowerNumber()

TQString KoParagCounter::makeAlphaLowerNumber ( int n)
static

Definition at line 866 of file KoParagCounter.cpp.

◆ makeAlphaUpperNumber()

TQString KoParagCounter::makeAlphaUpperNumber ( int n)
static

Definition at line 852 of file KoParagCounter.cpp.

◆ makeRomanNumber()

TQString KoParagCounter::makeRomanNumber ( int n)
static

Definition at line 839 of file KoParagCounter.cpp.

◆ number()

int KoParagCounter::number ( const KoTextParag * paragraph)

Return the current value of the counter as a number.

◆ numbering()

KoParagCounter::Numbering KoParagCounter::numbering ( ) const

Numbering type and style.

Definition at line 431 of file KoParagCounter.cpp.

◆ operator!=()

bool KoParagCounter::operator!= ( const KoParagCounter & c2) const
inline

Definition at line 97 of file KoParagCounter.h.

◆ operator==()

bool KoParagCounter::operator== ( const KoParagCounter & c2) const

Definition at line 49 of file KoParagCounter.cpp.

◆ prefix()

TQString KoParagCounter::prefix ( ) const

Prefix and suffix strings.

Definition at line 496 of file KoParagCounter.cpp.

◆ printRTDebug()

void KoParagCounter::printRTDebug ( KoTextParag * parag)

Definition at line 970 of file KoParagCounter.cpp.

◆ restartCounter()

bool KoParagCounter::restartCounter ( ) const

Should this counter start at "startNumber" (instead of being the 'last counter of the same type + 1').

Definition at line 621 of file KoParagCounter.cpp.

◆ save()

void KoParagCounter::save ( TQDomElement & element)

KOffice-1.3 saving code.

Definition at line 501 of file KoParagCounter.cpp.

◆ saveOasis()

void KoParagCounter::saveOasis ( KoGenStyle & listStyle,
bool savingStyle = false ) const

Save as OASIS XML.

Definition at line 265 of file KoParagCounter.cpp.

◆ saveOasisListLevel()

void KoParagCounter::saveOasisListLevel ( KoXmlWriter & listLevelWriter,
bool includeLevelAndProperties,
bool savingStyle = false ) const

Part of saveOasis that is shared with KoStyleCollection::saveOasisOutlineStyles and KWVariableSettings::saveOasis for footnotes/endnotes.

Definition at line 283 of file KoParagCounter.cpp.

◆ setAlignment()

void KoParagCounter::setAlignment ( int a)

Definition at line 578 of file KoParagCounter.cpp.

◆ setCustom()

void KoParagCounter::setCustom ( TQString c)

Definition at line 531 of file KoParagCounter.cpp.

◆ setCustomBulletCharacter()

void KoParagCounter::setCustomBulletCharacter ( TQChar c)

Definition at line 537 of file KoParagCounter.cpp.

◆ setCustomBulletFont()

void KoParagCounter::setCustomBulletFont ( TQString f)

Definition at line 543 of file KoParagCounter.cpp.

◆ setDepth()

void KoParagCounter::setDepth ( unsigned int d)

Definition at line 549 of file KoParagCounter.cpp.

◆ setDisplayLevels()

void KoParagCounter::setDisplayLevels ( int l)

Definition at line 572 of file KoParagCounter.cpp.

◆ setNumbering()

void KoParagCounter::setNumbering ( Numbering n)

Definition at line 555 of file KoParagCounter.cpp.

◆ setPrefix()

void KoParagCounter::setPrefix ( TQString p)

Definition at line 561 of file KoParagCounter.cpp.

◆ setRestartCounter()

void KoParagCounter::setRestartCounter ( bool restart)

Definition at line 626 of file KoParagCounter.cpp.

◆ setStartNumber()

void KoParagCounter::setStartNumber ( int s)

Definition at line 566 of file KoParagCounter.cpp.

◆ setStyle()

void KoParagCounter::setStyle ( Style s)

Definition at line 584 of file KoParagCounter.cpp.

◆ setSuffix()

void KoParagCounter::setSuffix ( TQString s)

Definition at line 590 of file KoParagCounter.cpp.

◆ startNumber()

int KoParagCounter::startNumber ( ) const

Starting number.

Definition at line 596 of file KoParagCounter.cpp.

◆ style()

KoParagCounter::Style KoParagCounter::style ( ) const

Definition at line 611 of file KoParagCounter.cpp.

◆ suffix()

TQString KoParagCounter::suffix ( ) const

Definition at line 616 of file KoParagCounter.cpp.

◆ text()

TQString KoParagCounter::text ( const KoTextParag * paragraph)

Return the current value of the counter as a text.

This returns the full text, all levels included (if displayLevels>1), e.g. "1.2.1." if displayLevels==3.

◆ width()

int KoParagCounter::width ( const KoTextParag * paragraph)

Work out the width of the text required for this counter.

Unit : LU pixels

Member Data Documentation

◆ counterFormat

KoTextFormat * KoParagCounter::counterFormat

Definition at line 239 of file KoParagCounter.h.

◆ number

int KoParagCounter::number

Definition at line 235 of file KoParagCounter.h.

◆ parent

KoTextParag * KoParagCounter::parent

Definition at line 238 of file KoParagCounter.h.

◆ text

TQString KoParagCounter::text

Definition at line 236 of file KoParagCounter.h.

◆ width

int KoParagCounter::width

Definition at line 237 of file KoParagCounter.h.


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