Scribus
Open source desktop publishing at your fingertips
ScrAction Class Reference

#include <scraction.h>

Inheritance diagram for ScrAction:
Collaboration diagram for ScrAction:

Public Types

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

Public Slots

void toggle ()
 

Signals

void triggeredData (QVariant)
 
void triggeredData (int)
 
void triggeredData (double)
 
void triggeredData (QString)
 
void triggeredData (ScribusDoc *)
 
void triggeredData (QWidget *, ScribusDoc *)
 
void toggledData (bool, int)
 
void toggledData (bool, double)
 
void toggledData (bool, QString)
 
void triggeredUnicodeShortcut (int)
 

Public Member Functions

 ScrAction (QObject *parent)
 Constructor from QAction, sets menuType to Normal. More...
 
 ScrAction (const QString &menuText, QKeySequence accel, QObject *parent)
 Constructor from QAction, sets menuType to normal. More...
 
 ScrAction (ActionType aType, const QString &menuText, QKeySequence accel, QObject *parent, QVariant d=QVariant())
 Constructor for an action that may require a specific menu type, such as a DLL menu. More...
 
 ScrAction (ActionType aType, const QPixmap &icon16, const QPixmap &icon22, const QString &menuText, QKeySequence accel, QObject *parent, QVariant d=QVariant())
 
 ScrAction (const QPixmap &icon16, const QPixmap &icon22, const QString &menuText, QKeySequence accel, QObject *parent)
 Constructor for a normal action. Stores iconset. More...
 
 ScrAction (QKeySequence accel, QObject *parent, QVariant data=QVariant())
 Constructor for a Unicode action. More...
 
int getMenuIndex () const
 Return the stored menuIndex as QActions cannot deal with these well. More...
 
QString cleanMenuText ()
 Return a copy of the menu text, without the &s, possibility to remove ellipses in future. More...
 
void setToolTipFromTextAndShortcut ()
 
void setStatusTextAndShortcut (const QString &statusText)
 
bool isDLLAction () const
 Return true if action is a DLL. More...
 
int dllID () const
 Return DLL ID if the action is from a DLL, otherwise return -1. More...
 
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. More...
 
void saveShortcut ()
 Store the shortcut in a private variable as these must be removed in editmode. More...
 
void restoreShortcut ()
 Restore the saved shortcut to be the active one. More...
 
ActionType actionType ()
 Return the action data type. More...
 
int actionInt () const
 Return the action data of int action type. More...
 
double actionDouble () const
 
const QString actionQString ()
 
void setActionQString (const QString &)
 
void setTexts (const QString &newText)
 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. More...
 

Protected Attributes

int menuIndex
 
ActionType _actionType
 
QMenu * popupMenuAddedTo
 
QKeySequence savedKeySequence
 
bool shortcutSaved
 
bool fakeToggle
 
QIcon m_icon
 

Detailed Description

Author
Craig Bradney

Constructor & Destructor Documentation

ScrAction::ScrAction ( QObject *  parent)

Constructor from QAction, sets menuType to Normal.

Author
Craig Bradney
Date
Jan 2005
Parameters
parentParent object of this action
ScrAction::ScrAction ( const QString &  menuText,
QKeySequence  accel,
QObject *  parent 
)

Constructor from QAction, sets menuType to normal.

Author
Craig Bradney
Date
Jan 2005
Parameters
menuTextText to be in the menus for this action
accelAccelerator QKeySequence
parentParent object of this action
ScrAction::ScrAction ( ActionType  aType,
const QString &  menuText,
QKeySequence  accel,
QObject *  parent,
QVariant  d = QVariant() 
)

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

Author
Craig Bradney
Date
Jan 2005
Parameters
mTypemenuType, of Normal, RecentFile or DLL
icon16Iconset for the action
icon22Iconset for the action
menuTextText to be in the menus for this action
accelAccelerator QKeySequence
parentParent of this action
extraIntextra int value
extraDoubleextra double value
extraQStringextra QString value
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
iconIconset for the action
menuTextText to be in the menus for this action
accelAccelerator QKeySequence
parentParent of this action
ScrAction::ScrAction ( QKeySequence  accel,
QObject *  parent,
QVariant  data = QVariant() 
)

Constructor for a Unicode action.

Author
Craig Bradney
Date
Mar 2008
Parameters
accelAccelerator QKeySequence
parentParent of this action
extraIntextra int value
extraQStringextra QString value

Member Function Documentation

int ScrAction::actionInt ( ) const

Return the action data of int action type.

Author
Craig Bradney
Date
Apr 2005
ScrAction::ActionType ScrAction::actionType ( )

Return the action data type.

Author
Craig Bradney
Date
Apr 2005
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
indexThe saved index within the QPopupMenu
menuThe menu we are adding this action to
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
QStringStripped copy of the menu text
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
intDLL ID or -1
int ScrAction::getMenuIndex ( ) const

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

Author
Craig Bradney
Date
Jan 2005
Return values
intIndex of menu the action was inserted into
bool ScrAction::isDLLAction ( ) const

Return true if action is a DLL.

Author
Craig Bradney
Date
Jan 2005
Return values
boolTrue if action is from a DLL
void ScrAction::restoreShortcut ( )

Restore the saved shortcut to be the active one.

Author
Craig Bradney
Date
Feb 2005
void ScrAction::saveShortcut ( )

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

Author
Craig Bradney
Date
Feb 2005
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

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