Scribus
Open source desktop publishing at your fingertips
SMParagraphStyle Class Reference
Inheritance diagram for SMParagraphStyle:
Collaboration diagram for SMParagraphStyle:

Signals

void selectionDirty ()
 

Public Member Functions

 SMParagraphStyle (StyleSet< CharStyle > *cstyles)
 
QTabWidget * widget ()
 return the QWidget for editing style's properties More...
 
QString typeNamePlural ()
 name of the style (plural) (Paragraph Styles, Character Styles...)
 
QString typeNameSingular ()
 name of the style (singular) (Paragraph Style, Character Style...)
 
void setCurrentDoc (ScribusDoc *doc)
 Whenever style manager is shown attached StyleItems get the current doc. More...
 
QList< StyleName > styles (bool reloadFromDoc=true)
 existing styles in this category More...
 
void reload ()
 Reload styles and remove all cached (and possibly changed ones). More...
 
void selected (const QStringList &styleNames)
 Whenever this function is called StyleItem must update the main. More...
 
QString fromSelection () const
 Return the name of the style in this category applied to the. More...
 
void toSelection (const QString &styleName) const
 Apply style called styleName to the documents current selection. More...
 
QString newStyle ()
 Create a new temp. style with default values and return the. More...
 
QString newStyle (const QString &fromStyle)
 Create a new temp. style which is a clone of the style called fromStyle. More...
 
void apply ()
 apply changes made to the currently selected style(s) More...
 
void editMode (bool isOn)
 When SM switches to or away from edit mode this function is called. More...
 
bool isDefaultStyle (const QString &stylename) const
 returns if the style is a default style
 
void setDefaultStyle (bool ids)
 set if the style is a default style
 
QString shortcut (const QString &stylename) const
 returns the key combination for the style's shortcut
 
void setShortcut (const QString &shortcut)
 set the key combination for the selected style's shortcut
 
void deleteStyles (const QList< RemoveItem > &removeList)
 User has requested to delete all the selected styles. More...
 
void nameChanged (const QString &newName)
 Called when the currently selected style's name has changed.
 
QString getUniqueName (const QString &name)
 Return a unique name for a style using the base in the name.
 
void languageChange ()
 reload all the gui strings whenever this method is called
 
void unitChange ()
 document unit has been changed, upgrade widgets
 
StyleSet< ParagraphStyle > * tmpStyles ()
 
- Public Member Functions inherited from StyleItem
QString typeName ()
 

Member Function Documentation

void SMParagraphStyle::apply ( )
virtual

apply changes made to the currently selected style(s)

When a user has edited a style (s)he can either cancel or apply changes. On cancel and ok button clicks no action is needed from the StyleItem but if a user chooses to press button apply StyleItem's function apply() is called and StyleItem must upgrade the style and apply it where ever that style is used in the document. (cancel will be disabled after this)

Implements StyleItem.

void SMParagraphStyle::deleteStyles ( const QList< RemoveItem > &  removeList)
virtual

User has requested to delete all the selected styles.

Parameters
removeListlist of styles to be deleted. RemoveItem::first is the style to be deleted and RemoveItem::second is the style to replace the deleted style with. If no replacement was requested RemoveItem::second has been set to QString::null.

Implements StyleItem.

void SMParagraphStyle::editMode ( bool  isOn)
virtual

When SM switches to or away from edit mode this function is called.

Parameters
isOntrue if SM is in edit mode false if SM has just closed edit mode

Reimplemented from StyleItem.

QString SMParagraphStyle::fromSelection ( ) const
virtual

Return the name of the style in this category applied to the.

selected object(s) in the current document or QString::null if there is no selection in the document.

If there are multiple objects selected only return a style name if the same style is applied on all selected objects. If they doesn't share the same style then return QString::null.

Implements StyleItem.

QString SMParagraphStyle::newStyle ( )
virtual

Create a new temp. style with default values and return the.

name of the newly created style.

Returns
name of the created style

Implements StyleItem.

QString SMParagraphStyle::newStyle ( const QString &  fromStyle)
virtual

Create a new temp. style which is a clone of the style called fromStyle.

Parameters
fromStylename of the style to clone
Returns
name of the created style

Implements StyleItem.

void SMParagraphStyle::reload ( )
virtual

Reload styles and remove all cached (and possibly changed ones).

This function will be called whenever a user clicks on the reset button. Resetting styles means loading them from the doc replacing all cached styles and without applying changes to the previously cached styles.

Implements StyleItem.

void SMParagraphStyle::selected ( const QStringList &  styleNames)
virtual

Whenever this function is called StyleItem must update the main.

widget with the corresponding data.

Whenever user selects a style from the style list in the manager this slot is called from the StyleItem. StyleItem must then update the main widget with the data related to the selected item and then just wait for apply() to apply the changes user made (with the main widget). When implementing this method one should note that there may be more than a single style selected.

Parameters
styleNamesstyles selected for editing

Implements StyleItem.

void SMParagraphStyle::setCurrentDoc ( ScribusDoc doc)
virtual

Whenever style manager is shown attached StyleItems get the current doc.

passed to them with this function.

Implements StyleItem.

QList< StyleName > SMParagraphStyle::styles ( bool  reloadFromDoc = true)
virtual

existing styles in this category

return the names of cached styles (even if those are changed)

Parameters
reloadFromDocshould the styles be loaded from the document or should function return currently cached and possibly changed styles
Returns
Name of the styles and their parent as a QValueList. StyleName::first is the style name and StyleName::second it's parent's name. If the StyleItem has no parent StyleName::second should be set to QString::null.

Implements StyleItem.

void SMParagraphStyle::toSelection ( const QString &  styleName) const
virtual

Apply style called styleName to the documents current selection.

Parameters
styleNamename of the style to be applied to the documents current selection

Implements StyleItem.

QTabWidget * SMParagraphStyle::widget ( )
virtual

return the QWidget for editing style's properties

This is the widget where the attributes of style are edited. It will be placed on the main tab widget's Properties page. Whenever a selected style is edited StyleItem should emit the signal selectionDirty() if it is the first time style is edited after applying previous changes.

Implements StyleItem.


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