StyleItem Class Reference
Represents a style type that can be added to the Style Manager. More...
#include <styleitem.h>

Public Member Functions | |
| StyleItem () | |
| virtual | ~StyleItem () |
| virtual QTabWidget * | widget ()=0 |
| return the QWidget for editing style's properties | |
| virtual QString | typeNamePlural ()=0 |
| name of the style (plural) (Paragraph Styles, Character Styles...) | |
| virtual QString | typeNameSingular ()=0 |
| name of the style (singular) (Paragraph Style, Character Style...) | |
| virtual void | currentDoc (ScribusDoc *doc)=0 |
| Whenever style manager is shown attached StyleItems get the current doc. | |
| virtual QList< StyleName > | styles (bool reloadFromDoc=true)=0 |
| existing styles in this category | |
| virtual void | reload ()=0 |
| Reload styles and remove all cached (and possibly changed ones). | |
| virtual void | selected (const QStringList &styleNames)=0 |
| Whenever this function is called StyleItem must update the main. | |
| virtual QString | fromSelection () const =0 |
| Return the name of the style in this category applied to the. | |
| virtual void | toSelection (const QString &styleName) const =0 |
| Apply style called styleName to the documents current selection. | |
| virtual QString | newStyle ()=0 |
| Create a new temp. style with default values and return the. | |
| virtual QString | newStyle (const QString &fromStyle)=0 |
| Create a new temp. style which is a clone of the style called fromStyle. | |
| virtual void | apply ()=0 |
| apply changes made to the currently selected style(s) | |
| virtual void | editMode (bool isOn) |
| When SM switches to or away from edit mode this function is called. | |
| virtual QString | shortcut (const QString &stylename) const =0 |
| returns the key combination for the style's shortcut | |
| virtual void | setShortcut (const QString &shortcut)=0 |
| set the key combination for the selected style's shortcut | |
| virtual void | deleteStyles (const QList< RemoveItem > &removeList)=0 |
| User has requested to delete all the selected styles. | |
| virtual void | nameChanged (const QString &newName)=0 |
| Called when the currently selected style's name has changed. | |
| virtual QString | getUniqueName (const QString &base)=0 |
| Return a unique name for a style using the base in the name. | |
| virtual void | languageChange ()=0 |
| reload all the gui strings whenever this method is called | |
| virtual void | unitChange ()=0 |
| document unit has been changed, upgrade widgets | |
| QString | typeName () |
Private Member Functions | |
| StyleItem (const StyleItem &) | |
| void | operator= (const StyleItem &) |
Detailed Description
Represents a style type that can be added to the Style Manager.palette.
This class is ment to be used as a parent class for any style types that are wanted to be configured using the Style Manager palette.
- Date:
- November 2005
Definition at line 37 of file styleitem.h.
Constructor & Destructor Documentation
| StyleItem::StyleItem | ( | ) |
Definition at line 11 of file styleitem.cpp.
| StyleItem::~StyleItem | ( | ) | [virtual] |
Definition at line 14 of file styleitem.cpp.
| StyleItem::StyleItem | ( | const StyleItem & | ) | [private] |
Definition at line 17 of file styleitem.cpp.
Member Function Documentation
| virtual QTabWidget* StyleItem::widget | ( | ) | [pure 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.
Implemented in SMLineStyle, SMParagraphStyle, and SMCharacterStyle.
Referenced by StyleManager::loadType(), and StyleManager::slotSetupWidget().
| virtual QString StyleItem::typeNamePlural | ( | ) | [pure virtual] |
name of the style (plural) (Paragraph Styles, Character Styles...)
Implemented in SMLineStyle, SMParagraphStyle, and SMCharacterStyle.
Referenced by typeName().
| virtual QString StyleItem::typeNameSingular | ( | ) | [pure virtual] |
name of the style (singular) (Paragraph Style, Character Style...)
Implemented in SMLineStyle, SMParagraphStyle, and SMCharacterStyle.
| virtual void StyleItem::currentDoc | ( | ScribusDoc * | doc | ) | [pure virtual] |
Whenever style manager is shown attached StyleItems get the current doc.
passed to them with this function.
Implemented in SMLineStyle, SMParagraphStyle, and SMCharacterStyle.
| virtual QList<StyleName> StyleItem::styles | ( | bool | reloadFromDoc = true |
) | [pure virtual] |
existing styles in this category
return the names of cached styles (even if those are changed)
- Parameters:
-
reloadFromDoc should 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.
Implemented in SMLineStyle, SMParagraphStyle, and SMCharacterStyle.
Referenced by StyleManager::addNewType(), StyleManager::nameIsUnique(), and StyleManager::slotDelete().
| virtual void StyleItem::reload | ( | ) | [pure 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.
Implemented in SMLineStyle, SMParagraphStyle, and SMCharacterStyle.
Referenced by StyleManager::reloadStyleView().
| virtual void StyleItem::selected | ( | const QStringList & | styleNames | ) | [pure 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:
-
styleNames styles selected for editing
Implemented in SMLineStyle, SMParagraphStyle, and SMCharacterStyle.
Referenced by StyleManager::slotSetupWidget().
| virtual QString StyleItem::fromSelection | ( | ) | const [pure 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.
Implemented in SMLineStyle, SMParagraphStyle, and SMCharacterStyle.
| virtual void StyleItem::toSelection | ( | const QString & | styleName | ) | const [pure virtual] |
Apply style called styleName to the documents current selection.
- Parameters:
-
styleName name of the style to be applied to the documents current selection
Implemented in SMLineStyle, SMParagraphStyle, and SMCharacterStyle.
Referenced by StyleManager::slotApplyStyle().
| virtual QString StyleItem::newStyle | ( | ) | [pure virtual] |
Create a new temp. style with default values and return the.
name of the newly created style.
- Returns:
- name of the created style
Implemented in SMLineStyle, SMParagraphStyle, and SMCharacterStyle.
Referenced by StyleManager::createNewStyle().
| virtual QString StyleItem::newStyle | ( | const QString & | fromStyle | ) | [pure virtual] |
Create a new temp. style which is a clone of the style called fromStyle.
- Parameters:
-
fromStyle name of the style to clone
- Returns:
- name of the created style
Implemented in SMLineStyle, SMParagraphStyle, and SMCharacterStyle.
| virtual void StyleItem::apply | ( | ) | [pure 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)
Implemented in SMLineStyle, SMParagraphStyle, and SMCharacterStyle.
| virtual void StyleItem::editMode | ( | bool | isOn | ) | [inline, virtual] |
When SM switches to or away from edit mode this function is called.
- Parameters:
-
isOn true if SM is in edit mode false if SM has just closed edit mode
Reimplemented in SMParagraphStyle, and SMCharacterStyle.
Definition at line 148 of file styleitem.h.
| virtual QString StyleItem::shortcut | ( | const QString & | stylename | ) | const [pure virtual] |
returns the key combination for the style's shortcut
Implemented in SMLineStyle, SMParagraphStyle, and SMCharacterStyle.
Referenced by StyleManager::addNewType(), StyleManager::slotSetupWidget(), and StyleManager::slotShortcutChanged().
| virtual void StyleItem::setShortcut | ( | const QString & | shortcut | ) | [pure virtual] |
set the key combination for the selected style's shortcut
Implemented in SMLineStyle, SMParagraphStyle, and SMCharacterStyle.
Referenced by StyleManager::slotShortcutChanged().
| virtual void StyleItem::deleteStyles | ( | const QList< RemoveItem > & | removeList | ) | [pure virtual] |
User has requested to delete all the selected styles.
- Parameters:
-
removeList list 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.
Implemented in SMLineStyle, SMParagraphStyle, and SMCharacterStyle.
Referenced by StyleManager::slotDelete().
| virtual void StyleItem::nameChanged | ( | const QString & | newName | ) | [pure virtual] |
Called when the currently selected style's name has changed.
Implemented in SMLineStyle, SMParagraphStyle, and SMCharacterStyle.
Referenced by StyleManager::slotNameChanged().
| virtual QString StyleItem::getUniqueName | ( | const QString & | base | ) | [pure virtual] |
Return a unique name for a style using the base in the name.
Implemented in SMLineStyle, SMParagraphStyle, and SMCharacterStyle.
| virtual void StyleItem::languageChange | ( | ) | [pure virtual] |
reload all the gui strings whenever this method is called
Implemented in SMLineStyle, SMParagraphStyle, and SMCharacterStyle.
| virtual void StyleItem::unitChange | ( | ) | [pure virtual] |
document unit has been changed, upgrade widgets
Implemented in SMLineStyle, SMParagraphStyle, and SMCharacterStyle.
| QString StyleItem::typeName | ( | ) | [inline] |
Definition at line 178 of file styleitem.h.
References typeNamePlural().
Referenced by StyleManager::addNewType(), StyleManager::createNewStyle(), StyleManager::slotApplyStyle(), StyleManager::slotImport(), StyleManager::slotSetupWidget(), and StyleManager::updateActionName().
| void StyleItem::operator= | ( | const StyleItem & | ) | [private] |
Definition at line 20 of file styleitem.cpp.
The documentation for this class was generated from the following files:
