libs/kotext

KoStyleManager Class Reference

Manages all character, paragraph, table and table cell styles for any number of documents. More...

#include <KoStyleManager.h>

Inheritance diagram for KoStyleManager:

List of all members.

Public Slots

void alteredStyle (const KoTableCellStyle *style)
void alteredStyle (const KoTableRowStyle *style)
void alteredStyle (const KoTableColumnStyle *style)
void alteredStyle (const KoTableStyle *style)
void alteredStyle (const KoListStyle *style)
void alteredStyle (const KoCharacterStyle *style)
void alteredStyle (const KoParagraphStyle *style)

Signals

void styleAdded (KoTableCellStyle *)
void styleAdded (KoTableRowStyle *)
void styleAdded (KoTableColumnStyle *)
void styleAdded (KoTableStyle *)
void styleAdded (KoListStyle *)
void styleAdded (KoCharacterStyle *)
void styleAdded (KoParagraphStyle *)
void styleRemoved (KoTableCellStyle *)
void styleRemoved (KoTableRowStyle *)
void styleRemoved (KoTableColumnStyle *)
void styleRemoved (KoTableStyle *)
void styleRemoved (KoListStyle *)
void styleRemoved (KoCharacterStyle *)
void styleRemoved (KoParagraphStyle *)

Public Member Functions

 KoStyleManager (QObject *parent=0)
virtual ~KoStyleManager ()
void add (QTextDocument *document)
void add (KoTableCellStyle *style)
void add (KoTableRowStyle *style)
void add (KoTableColumnStyle *style)
void add (KoTableStyle *style)
void add (KoListStyle *style)
void add (KoParagraphStyle *style)
void add (KoCharacterStyle *style)
KoCharacterStylecharacterStyle (const QString &name) const
KoCharacterStylecharacterStyle (int id) const
QList< KoCharacterStyle * > characterStyles () const
virtual bool completeLoading (KoStore *store)
virtual bool completeSaving (KoStore *store, KoXmlWriter *manifestWriter, KoShapeSavingContext *context)
KoListStyledefaultListStyle () const
KoParagraphStyledefaultParagraphStyle () const
KoListStylelistStyle (const QString &name) const
KoListStylelistStyle (int id) const
QList< KoListStyle * > listStyles () const
KoListStyleoutlineStyle () const
KoParagraphStyleparagraphStyle (const QString &name) const
KoParagraphStyleparagraphStyle (int id) const
QList< KoParagraphStyle * > paragraphStyles () const
void remove (QTextDocument *document)
void remove (KoTableCellStyle *style)
void remove (KoTableRowStyle *style)
void remove (KoTableColumnStyle *style)
void remove (KoTableStyle *style)
void remove (KoListStyle *style)
void remove (KoParagraphStyle *style)
void remove (KoCharacterStyle *style)
void saveOdf (KoGenStyles &mainStyles)
void saveOdfDefaultStyles (KoGenStyles &mainStyles)
void setOutlineStyle (KoListStyle *listStyle)
KoTableCellStyletableCellStyle (const QString &name) const
KoTableCellStyletableCellStyle (int id) const
QList< KoTableCellStyle * > tableCellStyles () const
KoTableColumnStyletableColumnStyle (const QString &name) const
KoTableColumnStyletableColumnStyle (int id) const
QList< KoTableColumnStyle * > tableColumnStyles () const
KoTableRowStyletableRowStyle (const QString &name) const
KoTableRowStyletableRowStyle (int id) const
QList< KoTableRowStyle * > tableRowStyles () const
KoTableStyletableStyle (const QString &name) const
KoTableStyletableStyle (int id) const
QList< KoTableStyle * > tableStyles () const

Detailed Description

Manages all character, paragraph, table and table cell styles for any number of documents.

Definition at line 49 of file KoStyleManager.h.


Constructor & Destructor Documentation

KoStyleManager::KoStyleManager ( QObject parent = 0  )  [explicit]

Create a new style manager.

Parameters:
parent pass a parent to use qobject memory management

Definition at line 72 of file KoStyleManager.cpp.

KoStyleManager::~KoStyleManager (  )  [virtual]

Destructor.

Definition at line 92 of file KoStyleManager.cpp.


Member Function Documentation

void KoStyleManager::add ( QTextDocument document  ) 

Add a document for which the styles will be applied.

Whenever a style is changed (signified by a alteredStyle() call) all registered documents will be updated to reflect that change.

Definition at line 451 of file KoStyleManager.cpp.

void KoStyleManager::add ( KoTableCellStyle style  ) 

Add a new table cell style, automatically giving it a new styleId.

Definition at line 280 of file KoStyleManager.cpp.

void KoStyleManager::add ( KoTableRowStyle style  ) 

Add a new table row style, automatically giving it a new styleId.

Definition at line 270 of file KoStyleManager.cpp.

void KoStyleManager::add ( KoTableColumnStyle style  ) 

Add a new table column style, automatically giving it a new styleId.

Definition at line 260 of file KoStyleManager.cpp.

void KoStyleManager::add ( KoTableStyle style  ) 

Add a new table style, automatically giving it a new styleId.

Definition at line 250 of file KoStyleManager.cpp.

void KoStyleManager::add ( KoListStyle style  ) 

Add a new list style, automatically giving it a new styleId.

Definition at line 232 of file KoStyleManager.cpp.

void KoStyleManager::add ( KoParagraphStyle style  ) 

Add a new style, automatically giving it a new styleId.

Definition at line 215 of file KoStyleManager.cpp.

void KoStyleManager::add ( KoCharacterStyle style  ) 

Add a new style, automatically giving it a new styleId.

Definition at line 204 of file KoStyleManager.cpp.

void KoStyleManager::alteredStyle ( const KoTableCellStyle style  )  [slot]

Slot that should be called whenever a style is changed.

This will update all documents with the style. Note that successive calls are aggregated.

Definition at line 421 of file KoStyleManager.cpp.

void KoStyleManager::alteredStyle ( const KoTableRowStyle style  )  [slot]

Slot that should be called whenever a style is changed.

This will update all documents with the style. Note that successive calls are aggregated.

Definition at line 408 of file KoStyleManager.cpp.

void KoStyleManager::alteredStyle ( const KoTableColumnStyle style  )  [slot]

Slot that should be called whenever a style is changed.

This will update all documents with the style. Note that successive calls are aggregated.

Definition at line 395 of file KoStyleManager.cpp.

void KoStyleManager::alteredStyle ( const KoTableStyle style  )  [slot]

Slot that should be called whenever a style is changed.

This will update all documents with the style. Note that successive calls are aggregated.

Definition at line 382 of file KoStyleManager.cpp.

void KoStyleManager::alteredStyle ( const KoListStyle style  )  [slot]

Slot that should be called whenever a style is changed.

This will update all documents with the style. Note that successive calls are aggregated.

Definition at line 369 of file KoStyleManager.cpp.

void KoStyleManager::alteredStyle ( const KoCharacterStyle style  )  [slot]

Slot that should be called whenever a style is changed.

This will update all documents with the style. Note that successive calls are aggregated.

Definition at line 356 of file KoStyleManager.cpp.

void KoStyleManager::alteredStyle ( const KoParagraphStyle style  )  [slot]

Slot that should be called whenever a style is changed.

This will update all documents with the style. Note that successive calls are aggregated.

Definition at line 337 of file KoStyleManager.cpp.

KoCharacterStyle * KoStyleManager::characterStyle ( const QString name  )  const

Return the first characterStyle with the param user-visible-name.

Since the name does not have to be unique there can be multiple styles registered with that name, only the first is returned

Parameters:
name the name of the style.
See also:
characterStyle(id);

Definition at line 526 of file KoStyleManager.cpp.

KoCharacterStyle * KoStyleManager::characterStyle ( int  id  )  const

Return a characterStyle by its id.

From documents you can retrieve the id out of each QTextCharFormat by requesting the KoCharacterStyle::StyleId property.

Parameters:
id the unique Id to search for.
See also:
KoCharacterStyle::styleId()

Definition at line 472 of file KoStyleManager.cpp.

QList< KoCharacterStyle * > KoStyleManager::characterStyles (  )  const

return all the characterStyles registered.

Definition at line 612 of file KoStyleManager.cpp.

bool KoStyleManager::completeLoading ( KoStore *  store  )  [virtual]

reimplemented

Definition at line 647 of file KoStyleManager.cpp.

bool KoStyleManager::completeSaving ( KoStore *  store,
KoXmlWriter *  manifestWriter,
KoShapeSavingContext context 
) [virtual]

reimplemented

Definition at line 652 of file KoStyleManager.cpp.

KoListStyle * KoStyleManager::defaultListStyle (  )  const

Returns the default list style to be used for lists, headers, paragraphs that do not specify a list-style.

Definition at line 594 of file KoStyleManager.cpp.

KoParagraphStyle * KoStyleManager::defaultParagraphStyle (  )  const

Return the default paragraph style that will always be present in each document.

You can alter the style, but you can never delete it. The default is suppost to stay invisible to the user and its called i18n("[No Paragraph Style]") for that reason. Applications should not show this style in their document-level configure dialogs.

Definition at line 589 of file KoStyleManager.cpp.

KoListStyle * KoStyleManager::listStyle ( const QString name  )  const

Returns the first listStyle ith the param use-visible-name.

Definition at line 544 of file KoStyleManager.cpp.

KoListStyle * KoStyleManager::listStyle ( int  id  )  const

Return a list style by its id.

Definition at line 482 of file KoStyleManager.cpp.

QList< KoListStyle * > KoStyleManager::listStyles (  )  const

return all the listStyles registered.

Definition at line 622 of file KoStyleManager.cpp.

KoListStyle * KoStyleManager::outlineStyle (  )  const

Returns the outline style to be used for headers that are not specified as lists.

Definition at line 607 of file KoStyleManager.cpp.

KoParagraphStyle * KoStyleManager::paragraphStyle ( const QString name  )  const

Return the first paragraphStyle with the param user-visible-name.

Since the name does not have to be unique there can be multiple styles registered with that name, only the first is returned

Parameters:
name the name of the style.
See also:
paragraphStyle(id);

Definition at line 535 of file KoStyleManager.cpp.

KoParagraphStyle * KoStyleManager::paragraphStyle ( int  id  )  const

Return a paragraphStyle by its id.

From documents you can retrieve the id out of each QTextBlockFormat by requesting the KoParagraphStyle::StyleId property.

Parameters:
id the unique Id to search for.
See also:
KoParagraphStyle::styleId()

Definition at line 477 of file KoStyleManager.cpp.

QList< KoParagraphStyle * > KoStyleManager::paragraphStyles (  )  const

return all the paragraphStyles registered.

Definition at line 617 of file KoStyleManager.cpp.

void KoStyleManager::remove ( QTextDocument document  ) 

Remove a previously registered document.

Definition at line 462 of file KoStyleManager.cpp.

void KoStyleManager::remove ( KoTableCellStyle style  ) 

Remove a table cell style.

Definition at line 326 of file KoStyleManager.cpp.

void KoStyleManager::remove ( KoTableRowStyle style  ) 

Remove a table row style.

Definition at line 320 of file KoStyleManager.cpp.

void KoStyleManager::remove ( KoTableColumnStyle style  ) 

Remove a table column style.

Definition at line 314 of file KoStyleManager.cpp.

void KoStyleManager::remove ( KoTableStyle style  ) 

Remove a table style.

Definition at line 308 of file KoStyleManager.cpp.

void KoStyleManager::remove ( KoListStyle style  ) 

Remove a list style.

Definition at line 302 of file KoStyleManager.cpp.

void KoStyleManager::remove ( KoParagraphStyle style  ) 

Remove a style.

Definition at line 296 of file KoStyleManager.cpp.

void KoStyleManager::remove ( KoCharacterStyle style  ) 

Remove a style.

Definition at line 290 of file KoStyleManager.cpp.

void KoStyleManager::saveOdf ( KoGenStyles &  mainStyles  ) 

Save document styles.

Definition at line 105 of file KoStyleManager.cpp.

void KoStyleManager::saveOdfDefaultStyles ( KoGenStyles &  mainStyles  ) 

Save the default-style styles.

Definition at line 97 of file KoStyleManager.cpp.

void KoStyleManager::setOutlineStyle ( KoListStyle listStyle  ) 

Sets the outline style to be used for headers that are not specified as lists.

Definition at line 599 of file KoStyleManager.cpp.

void KoStyleManager::styleAdded ( KoTableCellStyle  )  [signal]
void KoStyleManager::styleAdded ( KoTableRowStyle  )  [signal]
void KoStyleManager::styleAdded ( KoTableColumnStyle  )  [signal]
void KoStyleManager::styleAdded ( KoTableStyle  )  [signal]
void KoStyleManager::styleAdded ( KoListStyle  )  [signal]
void KoStyleManager::styleAdded ( KoCharacterStyle  )  [signal]
void KoStyleManager::styleAdded ( KoParagraphStyle  )  [signal]
void KoStyleManager::styleRemoved ( KoTableCellStyle  )  [signal]
void KoStyleManager::styleRemoved ( KoTableRowStyle  )  [signal]
void KoStyleManager::styleRemoved ( KoTableColumnStyle  )  [signal]
void KoStyleManager::styleRemoved ( KoTableStyle  )  [signal]
void KoStyleManager::styleRemoved ( KoListStyle  )  [signal]
void KoStyleManager::styleRemoved ( KoCharacterStyle  )  [signal]
void KoStyleManager::styleRemoved ( KoParagraphStyle  )  [signal]
KoTableCellStyle * KoStyleManager::tableCellStyle ( const QString name  )  const

Return the first tableCellStyle with the param user-visible-name.

Since the name does not have to be unique there can be multiple styles registered with that name, only the first is returned

Parameters:
name the name of the style.
See also:
tableCellStyle(id);

Definition at line 580 of file KoStyleManager.cpp.

KoTableCellStyle * KoStyleManager::tableCellStyle ( int  id  )  const

Return a tableCellStyle by its id.

From documents you can retrieve the id out of each QTextTableCellFormat by requesting the KoTableCellStyle::StyleId property.

Parameters:
id the unique Id to search for.
See also:
KoTableCellStyle::styleId()

Definition at line 520 of file KoStyleManager.cpp.

QList< KoTableCellStyle * > KoStyleManager::tableCellStyles (  )  const

return all the tableCellStyles registered.

Definition at line 642 of file KoStyleManager.cpp.

KoTableColumnStyle * KoStyleManager::tableColumnStyle ( const QString name  )  const

Return the first tableColumnStyle with the param user-visible-name.

Since the name does not have to be unique there can be multiple styles registered with that name, only the first is returned

Parameters:
name the name of the style.
See also:
tableColumnStyle(id);

Definition at line 562 of file KoStyleManager.cpp.

KoTableColumnStyle * KoStyleManager::tableColumnStyle ( int  id  )  const

Return a tableColumnStyle by its id.

From documents you can retrieve the id out of the KoTableRowandColumnStyleManager

Parameters:
id the unique Id to search for.
See also:
KoTableColumnStyle::styleId()

Definition at line 510 of file KoStyleManager.cpp.

QList< KoTableColumnStyle * > KoStyleManager::tableColumnStyles (  )  const

return all the tableColumnStyles registered.

Definition at line 632 of file KoStyleManager.cpp.

KoTableRowStyle * KoStyleManager::tableRowStyle ( const QString name  )  const

Return the first tableRowStyle with the param user-visible-name.

Since the name does not have to be unique there can be multiple styles registered with that name, only the first is returned

Parameters:
name the name of the style.
See also:
tableRowStyle(id);

Definition at line 571 of file KoStyleManager.cpp.

KoTableRowStyle * KoStyleManager::tableRowStyle ( int  id  )  const

Return a tableRowStyle by its id.

From documents you can retrieve the id out of the KoTableRowandColumnStyleManager

Parameters:
id the unique Id to search for.
See also:
KoTableRowStyle::styleId()

Definition at line 515 of file KoStyleManager.cpp.

QList< KoTableRowStyle * > KoStyleManager::tableRowStyles (  )  const

return all the tableRowStyles registered.

Definition at line 637 of file KoStyleManager.cpp.

KoTableStyle * KoStyleManager::tableStyle ( const QString name  )  const

Return the first tableStyle with the param user-visible-name.

Since the name does not have to be unique there can be multiple styles registered with that name, only the first is returned

Parameters:
name the name of the style.
See also:
tableStyle(id);

Definition at line 553 of file KoStyleManager.cpp.

KoTableStyle * KoStyleManager::tableStyle ( int  id  )  const

Return a tableStyle by its id.

From documents you can retrieve the id out of each QTextTableFormat by requesting the KoTableStyle::StyleId property.

Parameters:
id the unique Id to search for.
See also:
KoTableStyle::styleId()

Definition at line 505 of file KoStyleManager.cpp.

QList< KoTableStyle * > KoStyleManager::tableStyles (  )  const

return all the tableStyles registered.

Definition at line 627 of file KoStyleManager.cpp.


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