Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

ScrAction Class Reference

#include <scraction.h>

List of all members.

Public Types

enum  ActionType {
  Normal, DataInt, DataDouble, DataQString,
  RecentFile, DLL, Window, RecentScript,
  UnicodeChar, Layer, ActionDLL, RecentPaste
}

Public Slots

void toggle ()

Signals

void triggeredData (int)
void triggeredData (double)
void triggeredData (QString)
void triggeredData (ScribusDoc *)
void toggledData (bool, int)
void toggledData (bool, double)
void toggledData (bool, QString)
void triggeredUnicodeShortcut (const QString &, int)

Public Member Functions

 ScrAction (QObject *parent)
 Constructor from QAction, sets menuType to Normal.
 ScrAction (const QString &menuText, QKeySequence accel, QObject *parent)
 Constructor from QAction, sets menuType to normal.
 ScrAction (ActionType mType, const QPixmap &icon16, const QPixmap &icon22, const QString &menuText, QKeySequence accel, QObject *parent, int extraInt=0, double extraDouble=0.0, QString extraQString=QString::null)
 Constructor for an action that may require a specific menu type, such as a DLL menu.
 ScrAction (const QPixmap &icon16, const QPixmap &icon22, const QString &menuText, QKeySequence accel, QObject *parent)
 Constructor for a normal action. Stores iconset.
 ~ScrAction ()
int getMenuIndex () const
 Return the stored menuIndex as QActions cannot deal with these well.
QString cleanMenuText ()
 Return a copy of the menu text, without the &s, possibility to remove ellipses in future.
bool isDLLAction () const
 Return true if action is a DLL.
int dllID () const
 Return DLL ID if the action is from a DLL, otherwise return -1.
void setToggleAction (bool isToggle, bool fakeToggle=false)
 Connect the internal toggle connections. Fake toggle actions are toggle actions but we connect activated() only, eg itemLock. This means they can be setOn() to the status of an item's bool, eg isLocked(), without toggling anything.
void saveShortcut ()
 Store the shortcut in a private variable as these must be removed in editmode.
void restoreShortcut ()
 Restore the saved shortcut to be the active one.
ActionType actionType ()
 Return the action data type.
int actionInt () const
 Return the action data of int action type.
double actionDouble () const
const QString actionQString ()
void setActionQString (const QString &)
void setTexts (const QString &newText, bool setTextToo=true)
 Set up text and menuText at the same time.

Protected Member Functions

void initScrAction ()
void addedTo (int index, QMenu *menu)
 Overridden addedTo QPopupmenu based function to save a pointer to the QPopupMenu we are adding to.

Protected Attributes

int menuIndex
int pluginID
int windowID
int layerID
int _dataInt
double _dataDouble
QString _dataQString
ActionType _actionType
QMenu * popupMenuAddedTo
QKeySequence savedKeySequence
bool shortcutSaved
bool fakeToggle

Private Slots

void triggeredToTriggeredData ()
 This passed the triggered() action signal in and back out but with some data, easier than overriding menu and menu bar classes for now.
void toggledToToggledData (bool ison)
 This passed the toggled() action signal in and back out but with some data, easier than overriding menu and menu bar classes for now.


Detailed Description

Author:
Craig Bradney

Definition at line 33 of file scraction.h.


Member Enumeration Documentation

Enumerator:
Normal 
DataInt 
DataDouble 
DataQString 
RecentFile 
DLL 
Window 
RecentScript 
UnicodeChar 
Layer 
ActionDLL 
RecentPaste 

Definition at line 38 of file scraction.h.


Constructor & Destructor Documentation

ScrAction::ScrAction ( QObject *  parent  ) 

Constructor from QAction, sets menuType to Normal.

Author:
Craig Bradney
Date:
Jan 2005
Parameters:
parent Parent object of this action

Definition at line 27 of file scraction.cpp.

References initScrAction().

ScrAction::ScrAction ( const QString &  menuText,
QKeySequence  accel,
QObject *  parent 
)

Constructor from QAction, sets menuType to normal.

Author:
Craig Bradney
Date:
Jan 2005
Parameters:
menuText Text to be in the menus for this action
accel Accelerator QKeySequence
parent Parent object of this action

Definition at line 32 of file scraction.cpp.

References initScrAction().

ScrAction::ScrAction ( ActionType  mType,
const QPixmap &  icon16,
const QPixmap &  icon22,
const QString &  menuText,
QKeySequence  accel,
QObject *  parent,
int  extraInt = 0,
double  extraDouble = 0.0,
QString  extraQString = QString::null 
)

Constructor for an action that may require a specific menu type, such as a DLL menu.

Author:
Craig Bradney
Date:
Jan 2005
Parameters:
mType menuType, of Normal, RecentFile or DLL
icon Iconset for the action
menuText Text to be in the menus for this action
accel Accelerator QKeySequence
parent Parent of this action
extraInt extra int value
extraDouble extra double value
extraQString extra QString value

Definition at line 38 of file scraction.cpp.

References _actionType, _dataDouble, _dataInt, _dataQString, DataDouble, DataInt, DataQString, DLL, initScrAction(), Layer, layerID, Normal, pluginID, RecentFile, RecentPaste, RecentScript, triggeredToTriggeredData(), UnicodeChar, Window, and windowID.

ScrAction::ScrAction ( const QPixmap &  icon16,
const QPixmap &  icon22,
const QString &  menuText,
QKeySequence  accel,
QObject *  parent 
)

Constructor for a normal action. Stores iconset.

Author:
Craig Bradney
Date:
Jan 2005
Parameters:
icon Iconset for the action
menuText Text to be in the menus for this action
accel Accelerator QKeySequence
parent Parent of this action

Definition at line 85 of file scraction.cpp.

References initScrAction().

ScrAction::~ScrAction (  ) 

Definition at line 102 of file scraction.cpp.


Member Function Documentation

int ScrAction::getMenuIndex (  )  const

Return the stored menuIndex as QActions cannot deal with these well.

Author:
Craig Bradney
Date:
Jan 2005
Return values:
int Index of menu the action was inserted into

Definition at line 172 of file scraction.cpp.

References menuIndex.

QString ScrAction::cleanMenuText (  ) 

Return a copy of the menu text, without the &s, possibility to remove ellipses in future.

Author:
Craig Bradney
Date:
Jan 2005
Return values:
QString Stripped copy of the menu text

Definition at line 167 of file scraction.cpp.

Referenced by setTexts().

bool ScrAction::isDLLAction (  )  const

Return true if action is a DLL.

Author:
Craig Bradney
Date:
Jan 2005
Return values:
bool True if action is from a DLL

Definition at line 177 of file scraction.cpp.

References _actionType, and DLL.

int ScrAction::dllID (  )  const

Return DLL ID if the action is from a DLL, otherwise return -1.

Author:
Craig Bradney
Date:
Jan 2005
Return values:
int DLL ID or -1

Definition at line 182 of file scraction.cpp.

References _actionType, DLL, and pluginID.

void ScrAction::setToggleAction ( bool  isToggle,
bool  fakeToggle = false 
)

Connect the internal toggle connections. Fake toggle actions are toggle actions but we connect activated() only, eg itemLock. This means they can be setOn() to the status of an item's bool, eg isLocked(), without toggling anything.

Author:
Craig Bradney
Date:
Feb 2005

Definition at line 189 of file scraction.cpp.

References _actionType, fakeToggle, Normal, and toggledToToggledData().

void ScrAction::saveShortcut (  ) 

Store the shortcut in a private variable as these must be removed in editmode.

Author:
Craig Bradney
Date:
Feb 2005

Definition at line 205 of file scraction.cpp.

References savedKeySequence, and shortcutSaved.

void ScrAction::restoreShortcut (  ) 

Restore the saved shortcut to be the active one.

Author:
Craig Bradney
Date:
Feb 2005

Definition at line 215 of file scraction.cpp.

References savedKeySequence, and shortcutSaved.

ScrAction::ActionType ScrAction::actionType (  ) 

Return the action data type.

Author:
Craig Bradney
Date:
Apr 2005

Definition at line 225 of file scraction.cpp.

References _actionType.

int ScrAction::actionInt (  )  const

Return the action data of int action type.

Author:
Craig Bradney
Date:
Apr 2005

Definition at line 230 of file scraction.cpp.

References _dataInt.

double ScrAction::actionDouble (  )  const

Definition at line 235 of file scraction.cpp.

References _dataDouble.

const QString ScrAction::actionQString (  ) 

Definition at line 240 of file scraction.cpp.

References _dataQString.

void ScrAction::setActionQString ( const QString &  s  ) 

Definition at line 259 of file scraction.cpp.

References _dataQString.

void ScrAction::setTexts ( const QString &  newText,
bool  setTextToo = true 
)

Set up text and menuText at the same time.

Definition at line 245 of file scraction.cpp.

References cleanMenuText().

void ScrAction::toggle (  )  [slot]

Definition at line 252 of file scraction.cpp.

References fakeToggle.

void ScrAction::triggeredData ( int   )  [signal]

void ScrAction::triggeredData ( double   )  [signal]

void ScrAction::triggeredData ( QString   )  [signal]

void ScrAction::triggeredData ( ScribusDoc  )  [signal]

void ScrAction::toggledData ( bool  ,
int   
) [signal]

Referenced by toggledToToggledData().

void ScrAction::toggledData ( bool  ,
double   
) [signal]

void ScrAction::toggledData ( bool  ,
QString   
) [signal]

void ScrAction::triggeredUnicodeShortcut ( const QString &  ,
int   
) [signal]

void ScrAction::initScrAction (  )  [protected]

Definition at line 93 of file scraction.cpp.

References _actionType, fakeToggle, menuIndex, Normal, savedKeySequence, and shortcutSaved.

Referenced by ScrAction().

void ScrAction::addedTo ( int  index,
QMenu *  menu 
) [protected]

Overridden addedTo QPopupmenu based function to save a pointer to the QPopupMenu we are adding to.

Author:
Craig Bradney
Date:
Jan 2005
Parameters:
index The saved index within the QPopupMenu
menu The menu we are adding this action to

Definition at line 158 of file scraction.cpp.

References menuIndex, and popupMenuAddedTo.

void ScrAction::triggeredToTriggeredData (  )  [private, slot]

This passed the triggered() action signal in and back out but with some data, easier than overriding menu and menu bar classes for now.

Author:
Craig Bradney
Date:
Jan 2005

Definition at line 106 of file scraction.cpp.

References _actionType, _dataDouble, _dataInt, _dataQString, ActionDLL, DataDouble, DataInt, DataQString, DLL, doc, Layer, layerID, pluginID, RecentFile, RecentPaste, RecentScript, triggeredData(), triggeredUnicodeShortcut(), UnicodeChar, Window, and windowID.

Referenced by ScrAction().

void ScrAction::toggledToToggledData ( bool  ison  )  [private, slot]

This passed the toggled() action signal in and back out but with some data, easier than overriding menu and menu bar classes for now.

Author:
Craig Bradney
Date:
Jan 2005
Parameters:
ison true if toggled = on

Definition at line 132 of file scraction.cpp.

References _actionType, _dataDouble, _dataInt, _dataQString, DataDouble, DataInt, DataQString, DLL, Layer, layerID, pluginID, RecentFile, RecentPaste, RecentScript, toggledData(), Window, and windowID.

Referenced by setToggleAction().


Member Data Documentation

int ScrAction::menuIndex [protected]

Definition at line 171 of file scraction.h.

Referenced by addedTo(), getMenuIndex(), and initScrAction().

int ScrAction::pluginID [protected]

Definition at line 172 of file scraction.h.

Referenced by dllID(), ScrAction(), toggledToToggledData(), and triggeredToTriggeredData().

int ScrAction::windowID [protected]

Definition at line 173 of file scraction.h.

Referenced by ScrAction(), toggledToToggledData(), and triggeredToTriggeredData().

int ScrAction::layerID [protected]

Definition at line 174 of file scraction.h.

Referenced by ScrAction(), toggledToToggledData(), and triggeredToTriggeredData().

int ScrAction::_dataInt [protected]

Definition at line 175 of file scraction.h.

Referenced by actionInt(), ScrAction(), toggledToToggledData(), and triggeredToTriggeredData().

double ScrAction::_dataDouble [protected]

QString ScrAction::_dataQString [protected]

QMenu* ScrAction::popupMenuAddedTo [protected]

Definition at line 179 of file scraction.h.

Referenced by addedTo().

QKeySequence ScrAction::savedKeySequence [protected]

Definition at line 180 of file scraction.h.

Referenced by initScrAction(), restoreShortcut(), and saveShortcut().

bool ScrAction::shortcutSaved [protected]

Definition at line 181 of file scraction.h.

Referenced by initScrAction(), restoreShortcut(), and saveShortcut().

bool ScrAction::fakeToggle [protected]

Definition at line 182 of file scraction.h.

Referenced by initScrAction(), setToggleAction(), and toggle().


The documentation for this class was generated from the following files:
Created with personalized Doxygen. This is documentation for GPL software Scribus - Open Source Desktop Publishing.