Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

KStdAction Namespace Reference


Enumerations

enum  StdAction { , TipofDay }

Functions

KActioncreate (StdAction id, const char *name, const QObject *recvr, const char *slot, KActionCollection *parent)
KActionaction (StdAction act_enum, const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0L)
const char * name (StdAction id)
const char * stdName (StdAction act_enum)
 @obsolete. Use name

QStringList stdNames ()
KActionopenNew (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionopen (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KRecentFilesActionopenRecent (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionsave (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionsaveAs (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionrevert (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionclose (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionprint (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionprintPreview (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionmail (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionquit (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionundo (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionredo (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActioncut (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActioncopy (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionpaste (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionselectAll (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActiondeselect (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionfind (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionfindNext (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionfindPrev (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionreplace (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionactualSize (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionfitToPage (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionfitToWidth (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionfitToHeight (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionzoomIn (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionzoomOut (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionzoom (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionredisplay (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionup (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionback (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionforward (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionhome (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionprior (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionnext (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActiongoTo (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActiongotoPage (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActiongotoLine (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionfirstPage (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionlastPage (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionaddBookmark (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActioneditBookmarks (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionspelling (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KToggleActionshowMenubar (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KToggleActionshowToolbar (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KToggleToolBarActionshowToolbar (const char *toolBarName, KActionCollection *parent, const char *name=0)
KToggleActionshowStatusbar (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionsaveOptions (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionkeyBindings (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionpreferences (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionconfigureToolbars (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionconfigureNotifications (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionhelp (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionhelpContents (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionwhatsThis (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActiontipOfDay (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionreportBug (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionaboutApp (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0)
KActionaboutKDE (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

See also:
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.

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

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

Author:
Kurt Granroth <granroth@kde.org>


Enumeration Type Documentation

enum KStdAction::StdAction
 

The standard menubar and toolbar actions.

Enumeration values:
TipofDay 
Since:
3.1

Definition at line 118 of file kstdaction.h.

Referenced by action(), and stdName().


Function Documentation

KAction* aboutApp const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Display the application's About box.

KAction* aboutKDE const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Display the About KDE dialog.

KAction* action StdAction    act_enum,
const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0L
[inline]
 

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

Definition at line 172 of file kstdaction.h.

References create(), name(), and StdAction.

KAction* actualSize const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

View the document at its actual size.

KAction* addBookmark const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Add the current page to the bookmarks tree.

KAction* back const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Move back (web style menu).

KAction* close const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Close the current document.

KAction* configureNotifications const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

The Configure Notifications dialo

Since:
3.1

KAction* configureToolbars const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

The Customize Toolbar dialog.

KAction* copy const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Copy the selected area into the clipboard.

KAction* create StdAction    id,
const char *    name,
const QObject *    recvr,
const char *    slot,
KActionCollection   parent
 

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

Referenced by action().

KAction* cut const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Cut selected area and store it in the clipboard.

KAction* deselect const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Deselect any selected elements in the current document.

KAction* editBookmarks const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Edit the application bookmarks.

KAction* find const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Initiate a 'find' request in the current document.

KAction* findNext const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Find the next instance of a stored 'find'.

KAction* findPrev const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Find a previous instance of a stored 'find'.

KAction* firstPage const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Jump to the first page.

KAction* fitToHeight const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

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

KAction* fitToPage const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

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
 

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

KAction* forward const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Move forward (web style menu).

KAction* goTo const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Go to somewhere in general.

KAction* gotoLine const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Go to a specific line (dialog).

KAction* gotoPage const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Go to a specific page (dialog).

KAction* help const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Display the help.

KAction* helpContents const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Display the help contents.

KAction* home const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Go to the "Home" position or document.

KAction* keyBindings const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Display the configure key bindings dialog.

KAction* lastPage const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Jump to the last page.

KAction* mail const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Mail this document.

const char* name StdAction    id
 

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

Referenced by action(), and stdName().

KAction* next const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Scroll down one page.

KAction* open const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Open an existing file.

KAction* openNew const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Create a new document or window.

KRecentFilesAction* openRecent const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

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* paste const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

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

KAction* preferences const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Display the preferences/options dialog.

KAction* print const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Print the current document.

KAction* printPreview const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Show a print preview of the current document.

KAction* prior const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Scroll up one page.

KAction* quit const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Quit the program.

KAction* redisplay const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Redisplay or redraw the document.

KAction* redo const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Redo the last operation.

KAction* replace const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Find and replace matches.

KAction* reportBug const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Open up the Report Bug dialog.

KAction* revert const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

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

KAction* save const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Save the current document.

KAction* saveAs const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Save the current document under a different name.

KAction* saveOptions const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Display the save options dialog.

KAction* selectAll const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Select all elements in the current document.

KToggleAction* showMenubar const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Show/Hide the menubar.

KToggleAction* showStatusbar const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Show/Hide the statusbar.

KToggleToolBarAction* showToolbar const char *    toolBarName,
KActionCollection   parent,
const char *    name = 0
 

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

KToggleAction* showToolbar const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

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

Since:
3.1

KAction* spelling const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Pop up the spell checker.

QStringList stdNames  
 

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

Since:
3.1

KAction* tipOfDay const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Display "Tip of the Day"

Since:
3.1

KAction* undo const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Undo the last operation.

KAction* up const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Move up (web style menu).

KAction* whatsThis const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Trigger the What's This cursor.

KAction* zoom const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Popup a zoom dialog.

KAction* zoomIn const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Zoom in.

KAction* zoomOut const QObject *    recvr,
const char *    slot,
KActionCollection   parent,
const char *    name = 0
 

Zoom out.


Generated on Wed Aug 13 23:30:37 2003 for kdelibs by doxygen1.2.18