Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

StyleManager Class Reference

#include <stylemanager.h>

Inheritance diagram for StyleManager:

Inheritance graph
[legend]
Collaboration diagram for StyleManager:

Collaboration graph
[legend]

List of all members.

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, KeyskeyMap ()

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_
StyleItemitem_
QGridLayout * layout_
QTabWidget * widget_
ShortcutWidgetshortcutWidget_
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
ScribusDocdoc_
PrefsContextprefs_
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" 
)

StyleManager::~StyleManager (  ) 


Member Function Documentation

void StyleManager::changeEvent ( QEvent *  e  )  [virtual]

Definition at line 83 of file stylemanager.cpp.

References languageChange().

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 (  ) 

Definition at line 222 of file stylemanager.cpp.

References doc_, and items_.

QMap<QString,Keys> StyleManager::keyMap (  ) 

void StyleManager::setDoc ( ScribusDoc doc  )  [slot]

void StyleManager::languageChange (  )  [slot]

void StyleManager::unitChange (  )  [slot]

Definition at line 166 of file stylemanager.cpp.

References doc_, items_, and slotSetupWidget().

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]

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]

void StyleManager::addNewType ( StyleItem item,
bool  loadFromDoc = true 
) [private]

void StyleManager::createNewStyle ( const QString &  typeName,
const QString &  fromParent = QString::null 
) [private]

void StyleManager::reloadStyleView ( bool  loadFromDoc = true  )  [private]

bool StyleManager::shortcutExists ( const QString &  keys  )  [private]

void StyleManager::updateActionName ( const QString &  oldName,
const QString &  newName 
) [private]

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]

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]

void StyleManager::slotImport (  )  [private, slot]

void StyleManager::slotEdit (  )  [private, slot]

void StyleManager::slotClone (  )  [private, slot]

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]

Definition at line 538 of file stylemanager.cpp.

Referenced by languageChange().

void StyleManager::slotRightClick ( const QPoint &  point  )  [private, slot]

void StyleManager::slotDoubleClick ( QTreeWidgetItem *  item,
int  column 
) [private, slot]

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]

void StyleManager::slotSetupWidget (  )  [private, slot]

void StyleManager::slotApplyStyle ( QTreeWidgetItem *  item  )  [private, slot]

void StyleManager::slotApplyStyle ( QTreeWidgetItem *  newitem,
QTreeWidgetItem *  olditem 
) [private, slot]

Definition at line 1128 of file stylemanager.cpp.

References slotApplyStyle().

void StyleManager::slotApplyStyle ( QTreeWidgetItem *  item,
int  column 
) [private, slot]

Definition at line 1133 of file stylemanager.cpp.

References slotApplyStyle().

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]

void StyleManager::slotApplyStyle ( QString  keyString  )  [private, slot]


Member Data Documentation

QList<StyleItem*> StyleManager::items_ [private]

QGridLayout* StyleManager::layout_ [private]

Definition at line 54 of file stylemanager.h.

Referenced by loadType(), and StyleManager().

QTabWidget* StyleManager::widget_ [private]

Definition at line 55 of file stylemanager.h.

Referenced by loadType(), and slotSetupWidget().

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().

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]

Definition at line 62 of file stylemanager.h.

Referenced by languageChange(), and slotRightClick().

QAction* StyleManager::rcpEditId_ [private]

Definition at line 63 of file stylemanager.h.

Referenced by languageChange(), and slotRightClick().

QAction* StyleManager::rcpCloneId_ [private]

Definition at line 64 of file stylemanager.h.

Referenced by languageChange(), and slotRightClick().

QAction* StyleManager::rcpToScrapId_ [private]

Definition at line 65 of file stylemanager.h.

Referenced by languageChange(), and slotRightClick().

bool StyleManager::isEditMode_ [private]