KoParagCounter Class Reference
This is the structure associated with a paragraph (KoTextParag), to define the bullet or numbering of the paragraph. More...
#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) |
QString | levelText (const KoTextParag *paragraph) |
QString | text (const KoTextParag *paragraph) |
int | width (const KoTextParag *paragraph) |
int | bulletX () |
void | load (QDomElement &element) |
void | save (QDomElement &element) |
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) |
QString | prefix () const |
void | setPrefix (QString p) |
QString | suffix () const |
void | setSuffix (QString s) |
QChar | customBulletCharacter () const |
void | setCustomBulletCharacter (QChar c) |
QString | customBulletFont () const |
void | setCustomBulletFont (QString f) |
QString | custom () const |
void | setCustom (QString c) |
int | alignment () const |
void | setAlignment (int a) |
Static Public Member Functions | |
bool | isBullet (Style style) |
KoTextFormat * | counterFormat (const KoTextParag *paragraph) |
QString | makeRomanNumber (int n) |
QString | makeAlphaUpperNumber (int n) |
QString | makeAlphaLowerNumber (int n) |
int | fromRomanNumber (const QString &) |
int | fromAlphaUpperNumber (const QString &) |
int | fromAlphaLowerNumber (const QString &) |
Detailed Description
This is the structure associated with a paragraph (KoTextParag), to define the bullet or numbering of the paragraph.
Definition at line 32 of file koparagcounter.h.
Member Function Documentation
|
Invalidate the internal cache. Use it whenever the number associated with this counter may have changed. Definition at line 81 of file koparagcounter.cc. Referenced by load(). |
|
Return the current value of the counter as a number.
Referenced by levelText(). |
|
Return the current value of the counter as a text. This returns only the current level, e.g. "1." Definition at line 442 of file koparagcounter.cc. References isBullet(), and number(). |
|
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. |
|
Work out the width of the text required for this counter. Unit : LU pixels |
|
X position of the bullet ( i.e. width of prefix ) Unit : LU pixels Definition at line 611 of file koparagcounter.cc. References prefix(), and KoTextZoomHandler::ptToLayoutUnitPt(). |
|
XML support.
Definition at line 110 of file koparagcounter.cc. References invalidate(). Referenced by KoParagLayout::loadParagLayout(). |
|
Numbering type and style.
Definition at line 240 of file koparagcounter.cc. Referenced by KoParagLayout::compare(), and KoParagLayout::saveParagLayout(). |
|
Should this counter start at "startNumber" (instead of being the 'last counter of the same type + 1').
Definition at line 430 of file koparagcounter.cc. |
|
Does this counter have a bullet style?
Definition at line 105 of file koparagcounter.cc. Referenced by levelText(). |
|
Helper function for finding out if a style is a bullet.
Definition at line 90 of file koparagcounter.cc. |
|
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 76 of file koparagcounter.cc. |
|
Number of levels whose numbers are displayed at the current level.
Definition at line 410 of file koparagcounter.cc. |
|
Starting number.
Definition at line 405 of file koparagcounter.cc. |
|
Prefix and suffix strings.
Definition at line 305 of file koparagcounter.cc. Referenced by bulletX(). |
|
The character and font for STYLE_CUSTOMBULLET.
Definition at line 66 of file koparagcounter.cc. |
|
The string STYLE_CUSTOM.
Definition at line 61 of file koparagcounter.cc. |
|
Counter alignment.
Definition at line 415 of file koparagcounter.cc. |
|
Return the format to use for the counter. This does no caching, it's merely to centralize code. |
The documentation for this class was generated from the following files: