StyleManager Class Reference
#include <stylemanager.h>


Public Slots | |
| void | setDoc (ScribusDoc *doc) |
| void | languageChange () |
| void | unitChange () |
Signals | |
| void | closed () |
Public Member Functions | |
| StyleManager (QWidget *parent=0, const char *name="StyleManager") | |
| ~StyleManager () | |
| virtual void | changeEvent (QEvent *e) |
| void | addStyle (StyleItem *item) |
| void | updateColorList () |
| QMap< QString, Keys > | keyMap () |
Protected Member Functions | |
| void | hideEvent (QHideEvent *e) |
| Stores the geometry of the window when hiding. | |
| void | closeEvent (QCloseEvent *e) |
| Sample way to grab keystrokes, simply calls superclass at this point. | |
| void | showEvent (QShowEvent *e) |
Private Slots | |
| void | slotOk () |
| void | slotApply () |
| void | slotDelete () |
| void | slotImport () |
| void | slotEdit () |
| void | slotClone () |
| void | slotNew () |
| void | slotNewPopup (QAction *) |
| Open "New Style" widget from "New" GUI button. | |
| void | slotNewPopup () |
| Overloaded slot for context QMenu handling. QActions inserted by QMenu::addAction() can handle triggered() related slots only. | |
| void | slotScrap () |
| void | slotRightClick (const QPoint &point) |
| void | slotDoubleClick (QTreeWidgetItem *item, int column) |
| void | slotNameChanged (const QString &name) |
| void | slotShortcutChanged (const QString &shortcut) |
| void | slotSetupWidget () |
| void | slotApplyStyle (QTreeWidgetItem *item) |
| void | slotApplyStyle (QTreeWidgetItem *newitem, QTreeWidgetItem *olditem) |
| void | slotApplyStyle (QTreeWidgetItem *item, int column) |
| void | slotDocSelectionChanged () |
| void | slotDocStylesChanged () |
| void | slotDirty () |
| void | slotClean () |
| void | slotApplyStyle (QString keyString) |
Private Member Functions | |
| void | insertShortcutPage (QTabWidget *twidget) |
| bool | nameIsUnique (const QString &name) |
| QPair< QString, QStringList > | namesFromSelection () |
| void | loadType (const QString &name) |
| void | addNewType (StyleItem *item, bool loadFromDoc=true) |
| void | createNewStyle (const QString &typeName, const QString &fromParent=QString::null) |
| void | reloadStyleView (bool loadFromDoc=true) |
| bool | shortcutExists (const QString &keys) |
| void | updateActionName (const QString &oldName, const QString &newName) |
| void | setSelection (const QList< QPair< QString, QString > > &selected) |
| void | setOkButtonText () |
Private Attributes | |
| QList< StyleItem * > | items_ |
| StyleItem * | item_ |
| QGridLayout * | layout_ |
| QTabWidget * | widget_ |
| ShortcutWidget * | shortcutWidget_ |
| QString | currentType_ |
| QMenu * | newPopup_ |
| QMenu * | rightClickPopup_ |
| QAction * | rcpNewId_ |
| QAction * | rcpDeleteId_ |
| QAction * | rcpEditId_ |
| QAction * | rcpCloneId_ |
| QAction * | rcpToScrapId_ |
| bool | isEditMode_ |
| bool | isStoryEditMode_ |
| QPoint | editPosition_ |
| QString | rcStyle_ |
| QString | rcType_ |
| QString | exitEditModeOk_ |
| QString | enterEditModeOk_ |
| QString | doneText |
| QString | editText |
| ScribusDoc * | doc_ |
| PrefsContext * | prefs_ |
| QMap< QString, QPointer < ScrAction > > | styleActions_ |
| QMap< QString, QString > | styleClassesPS_ |
| QMap< QString, QString > | styleClassesSP_ |
Static Private Attributes | |
| static const int | NAME_COL = 0 |
| static const int | SHORTCUT_COL = 1 |
| static const QString | SEPARATOR = "$$$$" |
Detailed Description
Definition at line 24 of file stylemanager.h.
Constructor & Destructor Documentation
| StyleManager::StyleManager | ( | QWidget * | parent = 0, |
|
| const char * | name = "StyleManager" | |||
| ) |
Definition at line 35 of file stylemanager.cpp.
References editPosition_, PrefsFile::getContext(), PrefsContext::getInt(), PrefsManager::instance(), isEditMode_, isStoryEditMode_, languageChange(), layout_, newPopup_, prefs_, PrefsManager::prefsFile, rightClickPopup_, slotApply(), slotClean(), slotClone(), slotDelete(), slotDoubleClick(), slotImport(), slotNew(), slotNewPopup(), slotOk(), and slotRightClick().
| StyleManager::~StyleManager | ( | ) |
Definition at line 1304 of file stylemanager.cpp.
References isEditMode_, prefs_, PrefsContext::set(), ScrPaletteBase::storePosition(), and ScrPaletteBase::storeVisibility().
Member Function Documentation
| void StyleManager::changeEvent | ( | QEvent * | e | ) | [virtual] |
| void StyleManager::addStyle | ( | StyleItem * | item | ) |
Definition at line 231 of file stylemanager.cpp.
References addNewType(), items_, languageChange(), and slotDirty().
Referenced by ScribusMainWindow::initPalettes().
| void StyleManager::updateColorList | ( | ) |
| QMap<QString,Keys> StyleManager::keyMap | ( | ) |
| void StyleManager::setDoc | ( | ScribusDoc * | doc | ) | [slot] |
Definition at line 185 of file stylemanager.cpp.
References addNewType(), doc_, items_, ScribusDoc::m_Selection, newPopup_, rightClickPopup_, slotDocSelectionChanged(), and styleActions_.
Referenced by ScribusMainWindow::DoFileClose(), ScribusMainWindow::doFileNew(), ScribusMainWindow::newActWin(), scribus_newstyledialog(), and ScribusMainWindow::slotEditPaste().
| void StyleManager::languageChange | ( | ) | [slot] |
Definition at line 93 of file stylemanager.cpp.
References addNewType(), doneText, editText, enterEditModeOk_, exitEditModeOk_, isEditMode_, items_, ShortcutWidget::languageChange(), newPopup_, rcpCloneId_, rcpDeleteId_, rcpEditId_, rcpNewId_, rcpToScrapId_, rightClickPopup_, setOkButtonText(), shortcutWidget_, slotClone(), slotDelete(), slotEdit(), slotImport(), slotScrap(), styleClassesPS_, styleClassesSP_, and tr().
Referenced by addStyle(), changeEvent(), and StyleManager().
| void StyleManager::unitChange | ( | ) | [slot] |
| void StyleManager::closed | ( | ) | [signal] |
Referenced by closeEvent(), and hideEvent().
| void StyleManager::hideEvent | ( | QHideEvent * | ) | [protected] |
Stores the geometry of the window when hiding.
Reimplemented from ScrPaletteBase.
Definition at line 1259 of file stylemanager.cpp.
References closed(), ScrPaletteBase::hideEvent(), isEditMode_, prefs_, PrefsContext::set(), ScrPaletteBase::storePosition(), and ScrPaletteBase::storeVisibility().
| void StyleManager::closeEvent | ( | QCloseEvent * | closeEvent | ) | [protected, virtual] |
Sample way to grab keystrokes, simply calls superclass at this point.
Captures the close event and changes it to hide
Reimplemented from ScrPaletteBase.
Definition at line 1272 of file stylemanager.cpp.
References closed(), ScrPaletteBase::closeEvent(), isEditMode_, prefs_, PrefsContext::set(), ScrPaletteBase::storePosition(), and ScrPaletteBase::storeVisibility().
| void StyleManager::showEvent | ( | QShowEvent * | e | ) | [protected] |
Definition at line 1285 of file stylemanager.cpp.
References PrefsContext::getInt(), isStoryEditMode_, p, prefs_, setOkButtonText(), and slotEdit().
| void StyleManager::insertShortcutPage | ( | QTabWidget * | twidget | ) | [private] |
Definition at line 923 of file stylemanager.cpp.
References shortcutWidget_, slotShortcutChanged(), and tr().
Referenced by loadType().
| bool StyleManager::nameIsUnique | ( | const QString & | name | ) | [private] |
Definition at line 1054 of file stylemanager.cpp.
References item_, and StyleItem::styles().
Referenced by slotNameChanged().
| QPair< QString, QStringList > StyleManager::namesFromSelection | ( | ) | [private] |
Definition at line 1187 of file stylemanager.cpp.
References StyleViewItem::isRoot(), NAME_COL, rcStyle_, rcType_, and StyleViewItem::rootName().
Referenced by slotSetupWidget().
| void StyleManager::loadType | ( | const QString & | name | ) | [private] |
Definition at line 1227 of file stylemanager.cpp.
References insertShortcutPage(), item_, items_, layout_, shortcutWidget_, StyleItem::widget(), and widget_.
Referenced by createNewStyle(), slotApplyStyle(), slotRightClick(), and slotSetupWidget().
| void StyleManager::addNewType | ( | StyleItem * | item, | |
| bool | loadFromDoc = true | |||
| ) | [private] |
Definition at line 770 of file stylemanager.cpp.
References ScrAction::DataQString, doc_, item_, NAME_COL, StyleViewItem::rootName(), SEPARATOR, StyleItem::shortcut(), SHORTCUT_COL, slotApplyStyle(), styleActions_, StyleItem::styles(), StyleItem::typeName(), and ScribusDoc::view().
Referenced by addStyle(), languageChange(), reloadStyleView(), and setDoc().
| void StyleManager::createNewStyle | ( | const QString & | typeName, | |
| const QString & | fromParent = QString::null | |||
| ) | [private] |
Definition at line 660 of file stylemanager.cpp.
References doc_, item_, loadType(), NAME_COL, StyleItem::newStyle(), StyleViewItem::setDirty(), slotSetupWidget(), and StyleItem::typeName().
Referenced by slotClone(), slotDoubleClick(), and slotNewPopup().
| void StyleManager::reloadStyleView | ( | bool | loadFromDoc = true |
) | [private] |
Definition at line 877 of file stylemanager.cpp.
References addNewType(), item_, items_, NAME_COL, StyleItem::reload(), StyleViewItem::rootName(), and StyleViewItem::setDirty().
Referenced by slotClean(), slotDelete(), and slotImport().
| bool StyleManager::shortcutExists | ( | const QString & | keys | ) | [private] |
Definition at line 1019 of file stylemanager.cpp.
References PrefsManager::appPrefs, PrefsManager::instance(), ApplicationPrefs::KeyActions, and styleActions_.
Referenced by slotShortcutChanged().
| void StyleManager::updateActionName | ( | const QString & | oldName, | |
| const QString & | newName | |||
| ) | [private] |
Definition at line 965 of file stylemanager.cpp.
References ScrAction::DataQString, doc_, item_, SEPARATOR, slotApplyStyle(), styleActions_, StyleItem::typeName(), and ScribusDoc::view().
Referenced by slotNameChanged().
| void StyleManager::setSelection | ( | const QList< QPair< QString, QString > > & | selected | ) | [private] |
Definition at line 442 of file stylemanager.cpp.
References NAME_COL, and StyleViewItem::rootName().
Referenced by slotImport().
| void StyleManager::setOkButtonText | ( | ) | [private] |
Definition at line 177 of file stylemanager.cpp.
References doneText, editText, isEditMode_, isStoryEditMode_, and CommonStrings::tr_OK.
Referenced by languageChange(), showEvent(), and slotOk().
| void StyleManager::slotOk | ( | ) | [private, slot] |
Definition at line 700 of file stylemanager.cpp.
References editPosition_, enterEditModeOk_, exitEditModeOk_, ScrPaletteBase::hide(), isEditMode_, isStoryEditMode_, items_, prefs_, PrefsContext::set(), setOkButtonText(), slotApply(), slotApplyStyle(), slotClean(), slotDocSelectionChanged(), slotSetupWidget(), and tr().
Referenced by slotClone(), slotDelete(), slotDoubleClick(), slotEdit(), slotImport(), slotNewPopup(), and StyleManager().
| void StyleManager::slotApply | ( | ) | [private, slot] |
Definition at line 239 of file stylemanager.cpp.
References items_, and slotClean().
Referenced by slotOk(), and StyleManager().
| void StyleManager::slotDelete | ( | ) | [private, slot] |
Definition at line 250 of file stylemanager.cpp.
References StyleItem::deleteStyles(), isEditMode_, item_, SMReplaceDia::items(), rcStyle_, reloadStyleView(), slotOk(), and StyleItem::styles().
Referenced by languageChange(), and StyleManager().
| void StyleManager::slotImport | ( | ) | [private, slot] |
Definition at line 288 of file stylemanager.cpp.
References SMStyleImport::characterStyles(), SMStyleImport::clashRename(), StyleSet< STYLE >::create(), SMCharacterStyle::currentDoc(), SMParagraphStyle::currentDoc(), doc_, StyleSet< STYLE >::find(), PrefsContext::get(), PrefsFile::getContext(), SMLineStyle::getUniqueName(), SMCharacterStyle::getUniqueName(), SMParagraphStyle::getUniqueName(), PrefsManager::instance(), isEditMode_, items_, SMStyleImport::lineStyles(), ScribusDoc::loadStylesFromFile(), ScribusDoc::PageColors, SMStyleImport::paragraphStyles(), PrefsManager::prefsFile, FileLoader::ReadColors(), reloadStyleView(), CustomFDialog::selectedFile(), PrefsContext::set(), Style::setName(), setSelection(), slotDirty(), slotOk(), slotSetupWidget(), FileLoader::TestFile(), SMLineStyle::tmpLines, SMCharacterStyle::tmpStyles(), SMParagraphStyle::tmpStyles(), tr(), and StyleItem::typeName().
Referenced by languageChange(), and StyleManager().
| void StyleManager::slotEdit | ( | ) | [private, slot] |
Definition at line 467 of file stylemanager.cpp.
References isEditMode_, StyleViewItem::isRoot(), rcStyle_, rcType_, StyleViewItem::rootName(), slotOk(), and styleClassesSP_.
Referenced by languageChange(), showEvent(), and slotDoubleClick().
| void StyleManager::slotClone | ( | ) | [private, slot] |
Definition at line 496 of file stylemanager.cpp.
References createNewStyle(), isEditMode_, StyleViewItem::isRoot(), NAME_COL, rcStyle_, rcType_, StyleViewItem::rootName(), slotOk(), and styleClassesSP_.
Referenced by languageChange(), and StyleManager().
| void StyleManager::slotNew | ( | ) | [private, slot] |
Definition at line 544 of file stylemanager.cpp.
References newPopup_.
Referenced by StyleManager().
| void StyleManager::slotNewPopup | ( | QAction * | i | ) | [private, slot] |
Open "New Style" widget from "New" GUI button.
Definition at line 554 of file stylemanager.cpp.
References createNewStyle(), isEditMode_, rcStyle_, rcType_, and slotOk().
| void StyleManager::slotNewPopup | ( | ) | [private, slot] |
Overloaded slot for context QMenu handling. QActions inserted by QMenu::addAction() can handle triggered() related slots only.
Definition at line 571 of file stylemanager.cpp.
References rcpNewId_.
Referenced by slotRightClick(), and StyleManager().
| void StyleManager::slotScrap | ( | ) | [private, slot] |
| void StyleManager::slotRightClick | ( | const QPoint & | point | ) | [private, slot] |
Definition at line 576 of file stylemanager.cpp.
References isEditMode_, StyleViewItem::isRoot(), loadType(), newPopup_, rcpCloneId_, rcpDeleteId_, rcpEditId_, rcpNewId_, rcpToScrapId_, rcStyle_, rcType_, rightClickPopup_, StyleViewItem::rootName(), slotNewPopup(), styleClassesPS_, and tr().
Referenced by StyleManager().
| void StyleManager::slotDoubleClick | ( | QTreeWidgetItem * | item, | |
| int | column | |||
| ) | [private, slot] |
Definition at line 628 of file stylemanager.cpp.
References createNewStyle(), isEditMode_, StyleViewItem::isRoot(), rcStyle_, rcType_, StyleViewItem::rootName(), slotEdit(), and slotOk().
Referenced by StyleManager().
| void StyleManager::slotNameChanged | ( | const QString & | name | ) | [private, slot] |
Definition at line 937 of file stylemanager.cpp.
References item_, NAME_COL, StyleItem::nameChanged(), nameIsUnique(), and updateActionName().
Referenced by slotSetupWidget().
| void StyleManager::slotShortcutChanged | ( | const QString & | shortcut | ) | [private, slot] |
Definition at line 985 of file stylemanager.cpp.
References ScrAction::DataQString, doc_, item_, NAME_COL, StyleViewItem::rootName(), SEPARATOR, StyleItem::setShortcut(), ShortcutWidget::setShortcut(), StyleItem::shortcut(), SHORTCUT_COL, shortcutExists(), shortcutWidget_, slotApplyStyle(), styleActions_, tr(), CommonStrings::tr_OK, CommonStrings::trWarning, and ScribusDoc::view().
Referenced by insertShortcutPage().
| void StyleManager::slotSetupWidget | ( | ) | [private, slot] |
Definition at line 1066 of file stylemanager.cpp.
References item_, loadType(), namesFromSelection(), StyleItem::selected(), ShortcutWidget::setShortcut(), StyleItem::shortcut(), shortcutWidget_, slotNameChanged(), tr(), StyleItem::typeName(), StyleItem::widget(), and widget_.
Referenced by createNewStyle(), slotClean(), slotImport(), slotOk(), and unitChange().
| void StyleManager::slotApplyStyle | ( | QTreeWidgetItem * | item | ) | [private, slot] |
Definition at line 1109 of file stylemanager.cpp.
References isEditMode_, StyleViewItem::isRoot(), item_, loadType(), NAME_COL, StyleViewItem::rootName(), slotDocSelectionChanged(), StyleItem::toSelection(), and StyleItem::typeName().
Referenced by addNewType(), slotApplyStyle(), slotDocSelectionChanged(), slotOk(), slotShortcutChanged(), and updateActionName().
| void StyleManager::slotApplyStyle | ( | QTreeWidgetItem * | newitem, | |
| QTreeWidgetItem * | olditem | |||
| ) | [private, slot] |
| void StyleManager::slotApplyStyle | ( | QTreeWidgetItem * | item, | |
| int | column | |||
| ) | [private, slot] |
| void StyleManager::slotDocSelectionChanged | ( | ) | [private, slot] |
Definition at line 1138 of file stylemanager.cpp.
References isEditMode_, items_, NAME_COL, StyleViewItem::rootName(), and slotApplyStyle().
Referenced by setDoc(), slotApplyStyle(), and slotOk().
| void StyleManager::slotDocStylesChanged | ( | ) | [private, slot] |
Definition at line 1177 of file stylemanager.cpp.
| void StyleManager::slotDirty | ( | ) | [private, slot] |
Definition at line 829 of file stylemanager.cpp.
References StyleViewItem::setDirty().
Referenced by addStyle(), and slotImport().
| void StyleManager::slotClean | ( | ) | [private, slot] |
Definition at line 848 of file stylemanager.cpp.
References isEditMode_, item_, items_, reloadStyleView(), StyleViewItem::setDirty(), and slotSetupWidget().
Referenced by slotApply(), slotOk(), and StyleManager().
| void StyleManager::slotApplyStyle | ( | QString | keyString | ) | [private, slot] |
Definition at line 1041 of file stylemanager.cpp.
References isEditMode_, item_, loadType(), SEPARATOR, slotDocSelectionChanged(), and StyleItem::toSelection().
Member Data Documentation
QList<StyleItem*> StyleManager::items_ [private] |
Definition at line 52 of file stylemanager.h.
Referenced by addStyle(), languageChange(), loadType(), reloadStyleView(), setDoc(), slotApply(), slotClean(), slotDocSelectionChanged(), slotImport(), slotOk(), unitChange(), and updateColorList().
StyleItem* StyleManager::item_ [private] |
Definition at line 53 of file stylemanager.h.
Referenced by addNewType(), createNewStyle(), loadType(), nameIsUnique(), reloadStyleView(), slotApplyStyle(), slotClean(), slotDelete(), slotNameChanged(), slotSetupWidget(), slotShortcutChanged(), and updateActionName().
QGridLayout* StyleManager::layout_ [private] |
QTabWidget* StyleManager::widget_ [private] |
ShortcutWidget* StyleManager::shortcutWidget_ [private] |
Definition at line 56 of file stylemanager.h.
Referenced by insertShortcutPage(), languageChange(), loadType(), slotSetupWidget(), and slotShortcutChanged().
QString StyleManager::currentType_ [private] |
Definition at line 57 of file stylemanager.h.
QMenu* StyleManager::newPopup_ [private] |
Definition at line 58 of file stylemanager.h.
Referenced by languageChange(), setDoc(), slotNew(), slotRightClick(), and StyleManager().
QMenu* StyleManager::rightClickPopup_ [private] |
Definition at line 59 of file stylemanager.h.
Referenced by languageChange(), setDoc(), slotRightClick(), and StyleManager().
QAction* StyleManager::rcpNewId_ [private] |
Definition at line 61 of file stylemanager.h.
Referenced by languageChange(), slotNewPopup(), and slotRightClick().
QAction* StyleManager::rcpDeleteId_ [private] |
QAction* StyleManager::rcpEditId_ [private] |
QAction* StyleManager::rcpCloneId_ [private] |
QAction* StyleManager::rcpToScrapId_ [private] |
bool StyleManager::isEditMode_ [private] |
Definition at line 67 of file stylemanager.h.
Referenced by closeEvent(), hideEvent(), languageChange(), setOkButtonText(), slotApplyStyle(), slotClean(),
