namespace KStdAction

# namespace KStdAction | Convenience methods to access all standard KDE actions. More...
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Types

- enum StdAction { ActionNone, New, Open, OpenRecent, Save, SaveAs, Revert, Close, Print, PrintPreview, Mail, Quit, Undo, Redo, Cut, Copy, Paste, SelectAll, Deselect, 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, TipofDay, ConfigureNotifications }

#### Public Methods

- KAction* create ( StdAction id, const char *name, const QObject *recvr, const char *slot, KActionCollection* parent )
- inline KAction* create ( StdAction id, const QObject *recvr, const char *slot, KActionCollection* parent )
- inline KAction * action (StdAction act_enum, const QObject *recvr, const char *slot, KActionCollection *parent, const char *name = 0L )
- const char* name ( StdAction id )
- inline const char* stdName (StdAction act_enum)
- QStringList stdNames ()
- KAction * openNew (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * open (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KRecentFilesAction * openRecent (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * save (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * saveAs (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * revert (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * close (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * print (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * printPreview (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * mail (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * quit (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * undo (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * redo (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * cut (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * copy (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * paste (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * selectAll (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * deselect (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * find (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * findNext (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * findPrev (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * replace (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * actualSize (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * fitToPage (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * fitToWidth (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * fitToHeight (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * zoomIn (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * zoomOut (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * zoom (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * redisplay (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * up (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * back (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * forward (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * home (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * prior (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * next (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * goTo (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * gotoPage (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * gotoLine (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * firstPage (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * lastPage (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * addBookmark (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * editBookmarks (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * spelling (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KToggleAction * showMenubar (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KToggleAction * showToolbar (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KToggleToolBarAction * showToolbar (const char* toolBarName, KActionCollection* parent, const char *name = 0 )
- KToggleAction * showStatusbar (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * saveOptions (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * keyBindings (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * preferences (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * configureToolbars (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * configureNotifications (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name = 0)
- KAction * help (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * helpContents (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * whatsThis (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * tipOfDay (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * reportBug (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * aboutApp (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )
- KAction * aboutKDE (const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 )

## 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 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 { ActionNone, New, Open, OpenRecent, Save, SaveAs, Revert, Close, Print, PrintPreview, Mail, Quit, Undo, Redo, Cut, Copy, Paste, SelectAll, Deselect, 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, TipofDay, ConfigureNotifications } | ### StdAction

The standard menubar and toolbar actions.

KAction* create ( StdAction id, const char *name, const QObject *recvr, const char *slot, KActionCollection* parent ) | ### create

Creates an action corresponding to the KStdAction::StdAction enum.

inline KAction* create ( StdAction id, const QObject *recvr, const char *slot, KActionCollection* parent ) | ### create

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

@obsolete. Creates an action corresponding to the KStdAction::StdAction enum.

const char* name ( StdAction id ) | ### name

This will return the internal name of a given standard action.

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

QStringList stdNames () | ### stdNames

Returns a list of all standard names. Used by KAccelManager to give those heigher weight.

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

Create a new document or window.

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

Open an existing file.

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

Open a recently used document.

Parameters:

slot | The SLOT to invoke when a URL is selected. Its signature is of the form slotURLSelected( const KURL & ).

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

Save the current document.

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

Save the current document under a different name.

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

Revert the current document to the last saved version (essentially will undo all changes).

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

Close the current document.

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

Print the current document.

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

Show a print preview of the current document.

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

Mail this document.

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

Quit the program.

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

Undo the last operation.

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

Redo the last operation.

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

Cut selected area and store it in the clipboard.

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

Copy the selected area into the clipboard.

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

Paste the contents of clipboard at the current mouse or cursor position.

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

Select all elements in the current document.

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

Deselect any selected elements in the current document.

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

Initiate a 'find' request in the current document.

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

Find the next instance of a stored 'find'.

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

Find a previous instance of a stored 'find'.

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

Find and replace matches.

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

View the document at its actual size.

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

Fit the document view to the size of the current window.

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

Fit the document view to the width of the current window.

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

Fit the document view to the height of the current window.

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

Zoom in.

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

Zoom out.

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

Popup a zoom dialog.

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

Redisplay or redraw the document.

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

Move up (web style menu).

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

Move back (web style menu).

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

Move forward (web style menu).

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

Go to the "Home" position or document.

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

Scroll up one page.

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

Scroll down one page.

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

Go to somewhere in general.

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

Go to a specific page (dialog).

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

Go to a specific line (dialog).

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

Jump to the first page.

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

Jump to the last page.

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

Add the current page to the bookmarks tree.

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

Edit the application bookmarks.

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

Pop up the spell checker.

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

Show/Hide the menubar.

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

@obsolete. toolbar actions are created automatically now in the Settings menu. Don't use this anymore Show/Hide the primary toolbar.

KToggleToolBarAction * showToolbar (const char* toolBarName, KActionCollection* parent, const char *name = 0 ) | ### showToolbar

@obsolete. toolbar actions are created automatically now in the Settings menu. Don't use this anymore Show/Hide the primary toolbar.

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

Show/Hide the statusbar.

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

Display the save options dialog.

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

Display the configure key bindings dialog.

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

Display the preferences/options dialog.

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

The Customize Toolbar dialog.

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

The Configure Notifications dialo

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

Display the help.

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

Display the help contents.

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

Trigger the What's This cursor.

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

Display "Tip of the Day"

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

Open up the Report Bug dialog.

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

Display the application's About box.

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

Display the About KDE dialog.

- Author: Kurt Granroth
- Generated: root on macppc.ports.openbsd.org on Sat Sep 6 10:36:37 2003, using kdoc 2.0a54.