class KStdAction
|
Convenience methods to access all standard KDE actions. More... |
|
|
Public Types
- enum StdAction {New=1, Open, OpenRecent, Save, SaveAs, Revert, Close, Print, PrintPreview, Mail, Quit, Undo, Redo, Cut, Copy, Paste, SelectAll, Find, FindNext, FindPrev, Replace, ActualSize, FitToPage, FitToWidth, FitToHeight, ZoomIn, ZoomOut, Zoom, Redisplay, Up, Back, Forward, Home, Prior, Next, Goto, GotoPage, GotoLine, FirstPage, LastPage, AddBookmark, EditBookmarks, Spelling, ShowMenubar, ShowToolbar, ShowStatusbar, SaveOptions, KeyBindings, Preferences, ConfigureToolbars, Help, HelpContents, WhatsThis, ReportBug, AboutApp, AboutKDE, NULL1, NULL2, NULL3, NULL4, NULL5, NULL6, NULL7, NULL8, NULL9, NULL10, NULL11, NULL12, NULL13, NULL14, NULL15, NULL16, NULL17, NULL18, NULL19, NULL20 }
Public Methods
Public Static Methods
- static QAction * action (StdAction act_enum, const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static const char* stdName (StdAction act_enum)
- static KAction * openNew (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * open (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KRecentFilesAction * openRecent (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * save (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * saveAs (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * revert (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * close (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * print (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * printPreview (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * mail (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * quit (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * undo (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * redo (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * cut (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * copy (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * paste (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * selectAll (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * find (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * findNext (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * findPrev (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * replace (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * actualSize (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * fitToPage (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * fitToWidth (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * fitToHeight (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * zoomIn (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * zoomOut (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * zoom (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * redisplay (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * up (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * back (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * forward (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * home (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * prior (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * next (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * goTo (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * gotoPage (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * gotoLine (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * firstPage (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * lastPage (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * addBookmark (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * editBookmarks (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * spelling (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KToggleAction * showMenubar (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KToggleAction * showToolbar (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KToggleAction * showStatusbar (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * saveOptions (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * keyBindings (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * preferences (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * configureToolbars (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * help (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * helpContents (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * whatsThis (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * reportBug (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * aboutApp (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
- static KAction * aboutKDE (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
Detailed Description
Convenience methods to access all standard KDE actions.
These actions should be used instead of hardcoding menubar and
toolbar items. Using these actions helps your application easily
conform to the KDE UI Style Guide
( @see http://developer.kde.org/documentation/standards/kde/style/basics/index.html ).
All of the documentation for KAction holds for KStdAction
also. When in doubt on how things work, check the KAction
documention first.
Simple Example:
In general, using standard actions should be a drop in replacement
for regular actions. For example, if you previously had:
KAction *newAct = new KAction(i18n("&New"), QIconSet(BarIcon("filenew")),
KStdAccel::key(KStdAccel::New), this,
SLOT(fileNew()), actionCollection());
You could drop that and replace it with:
KAction *newAct = KStdAction::openNew(this, SLOT(fileNew()),
actionCollection());
Non-standard Usages
It is possible to use the standard actions in various
non-recommended ways. Say, for instance, you wanted to have a
standard action (with the associated correct text and icon and
accelerator, etc) but you didn't want it to go in the standard
place (this is not recommended, by the way). One way to do this is
to simply not use the XML UI framework and plug it into wherever
you want. If you do want to use the XML UI framework (good!), then
it is still possible.
Basically, the XML building code matches names in the XML code with
the internal names of the actions. You can find out the internal
names of each of the standard actions by using the stdName
action like so: KStdAction::stdName(KStdAction::Cut) would return
'edit_cut'. The XML building code will match 'edit_cut' to the
attribute in the global XML file and place your action there.
However, you can change the internal name. In this example, just
do something like:
(void)KStdAction::cut(this, SLOT(editCut()), actionCollection(), "my_cut");
Now, in your local XML resource file (e.g., yourappui.rc), simply
put 'my_cut' where you want it to go.
Another non-standard usage concerns getting a pointer to an
existing action if, say, you want to enable or disable the action.
You could do it the recommended way and just grab a pointer when
you instantiate it as in the the 'openNew' example above... or you
could do it the hard way:
KAction *cut = actionCollection()->action(KStdAction::stdName(KStdAction::Cut));
Another non-standard usage concerns instantiating the action in the
first place. Usually, you would use the static member functions as
shown above (e.g., 'KStdAction::cut(this, SLOT, parent)'). You
may, however, do this using the enums provided. This author can't
think of a reason why you would want to.. but hey, if you do,
here's how:
(void)KStdAction::action(KStdAction::New, this, SLOT(fileNew()), actionCollection());
(void)KStdAction::action(KStdAction::Cut, this, SLOT(editCut()), actionCollection());
enum StdAction {New=1, Open, OpenRecent, Save, SaveAs, Revert, Close, Print, PrintPreview, Mail, Quit, Undo, Redo, Cut, Copy, Paste, SelectAll, Find, FindNext, FindPrev, Replace, ActualSize, FitToPage, FitToWidth, FitToHeight, ZoomIn, ZoomOut, Zoom, Redisplay, Up, Back, Forward, Home, Prior, Next, Goto, GotoPage, GotoLine, FirstPage, LastPage, AddBookmark, EditBookmarks, Spelling, ShowMenubar, ShowToolbar, ShowStatusbar, SaveOptions, KeyBindings, Preferences, ConfigureToolbars, Help, HelpContents, WhatsThis, ReportBug, AboutApp, AboutKDE, NULL1, NULL2, NULL3, NULL4, NULL5, NULL6, NULL7, NULL8, NULL9, NULL10, NULL11, NULL12, NULL13, NULL14, NULL15, NULL16, NULL17, NULL18, NULL19, NULL20 }
|
The standard menubar and toolbar actions.
Constructor.
Destructor.
QAction * action (StdAction act_enum, const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Retrieve the action corresponding to the
KStdAction::StdAction enum.
const char* stdName (StdAction act_enum)
|
[static]
This will return the internal name of a given standard action.
KAction * openNew (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Create a new document or window.
KAction * open (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Open an existing file.
[static]
Open a recently used document.
KAction * save (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Save the current document.
KAction * saveAs (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Save the current document under a different name.
KAction * revert (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Revert the current document to the last saved version
(essentially will undo all changes).
KAction * close (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Close the current document.
KAction * print (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Print the current document.
KAction * printPreview (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Show a print preview of the current document.
KAction * mail (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Mail this document
KAction * quit (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Quit the program.
KAction * undo (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Undo the last operation.
KAction * redo (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Redo the last operation.
KAction * cut (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Cut selected area and store it in the clipboard.
KAction * copy (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Copy the selected area into the clipboard.
KAction * paste (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Paste the contents of clipboard at the current mouse or cursor
position.
KAction * selectAll (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Select all elements in the current document.
KAction * find (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Initiate a 'find' request in the current document.
KAction * findNext (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Find the next instance of a stored 'find'.
KAction * findPrev (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Find a previous instance of a stored 'find'.
KAction * replace (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Find and replace matches.
KAction * actualSize (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
View the document at its actual size.
KAction * fitToPage (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Fit the document view to the size of the current window.
KAction * fitToWidth (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Fit the document view to the width of the current window.
KAction * fitToHeight (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Fit the document view to the height of the current window.
KAction * zoomIn (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Zoom in.
KAction * zoomOut (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Zoom out.
KAction * zoom (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Popup a zoom dialog.
KAction * redisplay (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Redisplay or redraw the document.
KAction * up (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Move up (web style menu).
KAction * back (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Move back (web style menu).
KAction * forward (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Move forward (web style menu).
KAction * home (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Go to the "Home" position or document.
KAction * prior (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Scroll up one page.
KAction * next (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Scroll down one page.
KAction * goTo (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Go to somewhere.. in general
KAction * gotoPage (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Go to a specific page (dialog).
KAction * gotoLine (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Go to a specific line (dialog).
KAction * firstPage (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Jump to the first page.
KAction * lastPage (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Jump to the last page.
KAction * addBookmark (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Add the current page to the bookmarks tree.
KAction * editBookmarks (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Edit the application bookmarks.
KAction * spelling (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Popup the spell checker
[static]
Show/Hide the menubar.
[static]
Show/Hide the primary toolbar.
[static]
Show/Hide the statusbar.
KAction * saveOptions (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Display the save options dialog
KAction * keyBindings (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Display the configure key bindings dialog.
KAction * preferences (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Display the preferences/options dialog.
KAction * configureToolbars (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
The Customize Toolbar dialog
KAction * help (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Display the help.
KAction * helpContents (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Display the help contents.
KAction * whatsThis (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Trigger the What's This cursor
KAction * reportBug (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Open up the Report Bug dialog
KAction * aboutApp (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Display the About app box
KAction * aboutKDE (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L )
|
[static]
Display the About KDE dialog
- Author: Kurt Granroth <granroth@kde.org>
- Generated: dfaure@faure on Sun Mar 26 14:24:24 2000, using kdoc 2.0a35.