# class KStdAction | Convenience methods to access all standard KDE actions. More...
Definition | `#include <kstdaction.h>`
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### 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

- KStdAction ()
- ~KStdAction ()

#### Public Static Methods

- static KAction * 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

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

See also: http://developer.kde.org/documentation/standards/kde/style/basics/index.html, .

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 } | ### StdAction

The standard menubar and toolbar actions.

KStdAction () | ### KStdAction

Constructor.

~KStdAction () | ### ~KStdAction

Destructor.

KAction * action (StdAction act_enum, const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### action

[static]

Retrieve the action corresponding to the KStdAction::StdAction enum.

const char* stdName (StdAction act_enum) | ### stdName

[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 ) | ### openNew

[static]

KAction * open (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### open

[static]

Open an existing file.

KRecentFilesAction * openRecent (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### openRecent

[static]

Open a recently used document.

KAction * save (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### save

[static]

Save the current document.

KAction * saveAs (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### saveAs

[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 ) | ### revert

[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 ) | ### close

[static]

Close the current document.

KAction * print (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### print

[static]

Print the current document.

KAction * printPreview (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### printPreview

[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 ) | ### mail

[static]

Mail this document.

KAction * quit (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### quit

[static]

Quit the program.

KAction * undo (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### undo

[static]

Undo the last operation.

KAction * redo (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### redo

[static]

Redo the last operation.

KAction * cut (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### cut

[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 ) | ### copy

[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 ) | ### paste

[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 ) | ### selectAll

[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 ) | ### find

[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 ) | ### findNext

[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 ) | ### findPrev

[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 ) | ### replace

[static]

Find and replace matches.

KAction * actualSize (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### actualSize

[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 ) | ### fitToPage

[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 ) | ### fitToWidth

[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 ) | ### fitToHeight

[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 ) | ### zoomIn

[static]

Zoom in.

KAction * zoomOut (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### zoomOut

[static]

Zoom out.

KAction * zoom (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### zoom

[static]

Popup a zoom dialog.

KAction * redisplay (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### redisplay

[static]

Redisplay or redraw the document.

KAction * up (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### up

[static]

Move up (web style menu).

KAction * back (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### back

[static]

Move back (web style menu).

KAction * forward (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### forward

[static]

Move forward (web style menu).

KAction * home (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### home

[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 ) | ### prior

[static]

Scroll up one page.

KAction * next (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### next

[static]

Scroll down one page.

KAction * goTo (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### goTo

[static]

Go to somewhere in general.

KAction * gotoPage (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### gotoPage

[static]

Go to a specific page (dialog).

KAction * gotoLine (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### gotoLine

[static]

Go to a specific line (dialog).

KAction * firstPage (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### firstPage

[static]

Jump to the first page.

KAction * lastPage (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### lastPage

[static]

Jump to the last page.

KAction * addBookmark (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### addBookmark

[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 ) | ### editBookmarks

[static]

Edit the application bookmarks.

KAction * spelling (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### spelling

[static]

Pop up the spell checker.

KToggleAction * showMenubar (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### showMenubar

[static]

Show/Hide the menubar.

KToggleAction * showToolbar (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### showToolbar

[static]

Show/Hide the primary toolbar.

KToggleAction * showStatusbar (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### showStatusbar

[static]

Show/Hide the statusbar.

KAction * saveOptions (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### saveOptions

[static]

Display the save options dialog.

KAction * keyBindings (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### keyBindings

[static]

Display the configure key bindings dialog.

KAction * preferences (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### preferences

[static]

Display the preferences/options dialog.

KAction * configureToolbars (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### configureToolbars

[static]

The Customize Toolbar dialog.

KAction * help (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### help

[static]

Display the help.

KAction * helpContents (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### helpContents

[static]

Display the help contents.

KAction * whatsThis (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### whatsThis

[static]

Trigger the What's This cursor.

KAction * reportBug (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### reportBug

[static]

Open up the Report Bug dialog.

KAction * aboutApp (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### aboutApp

[static]

Display the application's About box.

KAction * aboutKDE (const QObject *recvr = 0, const char *slot = 0, QObject *parent = 0, const char *name = 0L ) | ### aboutKDE

[static]

Display the About KDE dialog.

- Author: Kurt Granroth <granroth@kde.org>
- Generated: root@i386.ports.openbsd.org on Wed Apr 25 13:58:24 2001, using kdoc 2.0a53.