00001 /* This file is part of the KDE libraries
00002 Copyright (C) 1999,2000 Kurt Granroth <granroth@kde.org>
00003 Copyright (C) 2001,2002 Ellis Whitehead <ellis@kde.org>
00004
00005 This library is free software; you can redistribute it and/or
00006 modify it under the terms of the GNU Library General Public
00007 License version 2 as published by the Free Software Foundation.
00008
00009 This library is distributed in the hope that it will be useful,
00010 but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00012 Library General Public License for more details.
00013
00014 You should have received a copy of the GNU Library General Public License
00015 along with this library; see the file COPYING.LIB. If not, write to
00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017 Boston, MA 02110-1301, USA.
00018 */
00019 #ifndef KSTDACTION_H
00020 #define KSTDACTION_H
00021
00022 class QObject;
00023 class QWidget;
00024 class KAction;
00025 class KActionCollection;
00026 class KRecentFilesAction;
00027 class KToggleAction;
00028 class KToggleToolBarAction;
00029 class KToggleFullScreenAction;
00030
00031 #include <qstringlist.h>
00032
00033 #include <kdelibs_export.h>
00034
00117 namespace KStdAction
00118 {
00122 enum StdAction {
00123 ActionNone,
00124
00125 // File Menu
00126 New, Open, OpenRecent, Save, SaveAs, Revert, Close,
00127 Print, PrintPreview, Mail, Quit,
00128
00129 // Edit Menu
00130 Undo, Redo, Cut, Copy, Paste, SelectAll, Deselect, Find, FindNext, FindPrev,
00131 Replace,
00132
00133 // View Menu
00134 ActualSize, FitToPage, FitToWidth, FitToHeight, ZoomIn, ZoomOut,
00135 Zoom, Redisplay,
00136
00137 // Go Menu
00138 Up, Back, Forward, Home, Prior, Next, Goto, GotoPage, GotoLine,
00139 FirstPage, LastPage,
00140
00141 // Bookmarks Menu
00142 AddBookmark, EditBookmarks,
00143
00144 // Tools Menu
00145 Spelling,
00146
00147 // Settings Menu
00148 ShowMenubar, ShowToolbar, ShowStatusbar,
00149 SaveOptions, KeyBindings,
00150 Preferences, ConfigureToolbars,
00151
00152 // Help Menu
00153 Help, HelpContents, WhatsThis, ReportBug, AboutApp, AboutKDE,
00154 TipofDay,
00155
00156 // Another settings menu item
00157 ConfigureNotifications,
00158 FullScreen,
00159 Clear,
00160 PasteText,
00161 SwitchApplicationLanguage
00162 };
00163
00168 KDEUI_EXPORT KAction* create( StdAction id, const char *name,
00169 const QObject *recvr, const char *slot,
00170 KActionCollection* parent );
00171
00172 inline KAction* create( StdAction id,
00173 const QObject *recvr, const char *slot,
00174 KActionCollection* parent )
00175 { return KStdAction::create( id, 0, recvr, slot, parent ); }
00176
00181 inline KAction *action(StdAction act_enum,
00182 const QObject *recvr, const char *slot,
00183 KActionCollection *parent, const char *name = 0L )
00184 { return KStdAction::create( act_enum, name, recvr, slot, parent ); }
00185
00189 KDEUI_EXPORT const char* name( StdAction id );
00190
00192 inline const char* stdName(StdAction act_enum) { return name( act_enum ); }
00193
00199 KDEUI_EXPORT QStringList stdNames();
00200
00204 KDEUI_EXPORT KAction *openNew(const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 );
00205
00209 KDEUI_EXPORT KAction *open(const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 );
00210
00220 KDEUI_EXPORT KRecentFilesAction *openRecent(const QObject *recvr, const char *slot, KActionCollection* parent, const char *name = 0 );
00221
00225 KDEUI_EXPORT KAction *save(const QObject *recvr, const char *slot,
00226 KActionCollection* parent, const char *name = 0 );
00227
00231 KDEUI_EXPORT KAction *saveAs(const QObject *recvr, const char *slot,
00232 KActionCollection* parent, const char *name = 0 );
00233
00238 KDEUI_EXPORT KAction *revert(const QObject *recvr, const char *slot,
00239 KActionCollection* parent, const char *name = 0 );
00240
00244 KDEUI_EXPORT KAction *close(const QObject *recvr, const char *slot,
00245 KActionCollection* parent, const char *name = 0 );
00246
00250 KDEUI_EXPORT KAction *print(const QObject *recvr, const char *slot,
00251 KActionCollection* parent, const char *name = 0 );
00252
00256 KDEUI_EXPORT KAction *printPreview(const QObject *recvr, const char *slot,
00257 KActionCollection* parent, const char *name = 0 );
00258
00262 KDEUI_EXPORT KAction *mail(const QObject *recvr, const char *slot,
00263 KActionCollection* parent, const char *name = 0 );
00264
00268 KDEUI_EXPORT KAction *quit(const QObject *recvr, const char *slot,
00269 KActionCollection* parent, const char *name = 0 );
00270
00274 KDEUI_EXPORT KAction *undo(const QObject *recvr, const char *slot,
00275 KActionCollection* parent, const char *name = 0 );
00276
00280 KDEUI_EXPORT KAction *redo(const QObject *recvr, const char *slot,
00281 KActionCollection* parent, const char *name = 0 );
00282
00286 KDEUI_EXPORT KAction *cut(const QObject *recvr, const char *slot,
00287 KActionCollection* parent, const char *name = 0 );
00288
00292 KDEUI_EXPORT KAction *copy(const QObject *recvr, const char *slot,
00293 KActionCollection* parent, const char *name = 0 );
00294
00299 KDEUI_EXPORT KAction *paste(const QObject *recvr, const char *slot,
00300 KActionCollection* parent, const char *name = 0 );
00301
00308 KDEUI_EXPORT KAction *pasteText(const QObject *recvr, const char *slot,
00309 KActionCollection* parent, const char *name = 0 );
00310
00315 KDEUI_EXPORT KAction *clear(const QObject *recvr, const char *slot,
00316 KActionCollection* parent, const char *name = 0 );
00317
00321 KDEUI_EXPORT KAction *selectAll(const QObject *recvr, const char *slot,
00322 KActionCollection* parent, const char *name = 0 );
00323
00327 KDEUI_EXPORT KAction *deselect(const QObject *recvr, const char *slot,
00328 KActionCollection* parent, const char *name = 0 );
00329
00333 KDEUI_EXPORT KAction *find(const QObject *recvr, const char *slot,
00334 KActionCollection* parent, const char *name = 0 );
00335
00339 KDEUI_EXPORT KAction *findNext(const QObject *recvr, const char *slot,
00340 KActionCollection* parent, const char *name = 0 );
00341
00345 KDEUI_EXPORT KAction *findPrev(const QObject *recvr, const char *slot,
00346 KActionCollection* parent, const char *name = 0 );
00347
00351 KDEUI_EXPORT KAction *replace(const QObject *recvr, const char *slot,
00352 KActionCollection* parent, const char *name = 0 );
00353
00357 KDEUI_EXPORT KAction *actualSize(const QObject *recvr, const char *slot,
00358 KActionCollection* parent, const char *name = 0 );
00359
00363 KDEUI_EXPORT KAction *fitToPage(const QObject *recvr, const char *slot,
00364 KActionCollection* parent, const char *name = 0 );
00365
00369 KDEUI_EXPORT KAction *fitToWidth(const QObject *recvr, const char *slot,
00370 KActionCollection* parent, const char *name = 0 );
00371
00375 KDEUI_EXPORT KAction *fitToHeight(const QObject *recvr, const char *slot,
00376 KActionCollection* parent, const char *name = 0 );
00377
00381 KDEUI_EXPORT KAction *zoomIn(const QObject *recvr, const char *slot,
00382 KActionCollection* parent, const char *name = 0 );
00383
00387 KDEUI_EXPORT KAction *zoomOut(const QObject *recvr, const char *slot,
00388 KActionCollection* parent, const char *name = 0 );
00389
00393 KDEUI_EXPORT KAction *zoom(const QObject *recvr, const char *slot,
00394 KActionCollection* parent, const char *name = 0 );
00395
00399 KDEUI_EXPORT KAction *redisplay(const QObject *recvr, const char *slot,
00400 KActionCollection* parent, const char *name = 0 );
00401
00405 KDEUI_EXPORT KAction *up(const QObject *recvr, const char *slot,
00406 KActionCollection* parent, const char *name = 0 );
00407
00411 KDEUI_EXPORT KAction *back(const QObject *recvr, const char *slot,
00412 KActionCollection* parent, const char *name = 0 );
00413
00417 KDEUI_EXPORT KAction *forward(const QObject *recvr, const char *slot,
00418 KActionCollection* parent, const char *name = 0 );
00419
00423 KDEUI_EXPORT KAction *home(const QObject *recvr, const char *slot,
00424 KActionCollection* parent, const char *name = 0 );
00425
00429 KDEUI_EXPORT KAction *prior(const QObject *recvr, const char *slot,
00430 KActionCollection* parent, const char *name = 0 );
00431
00435 KDEUI_EXPORT KAction *next(const QObject *recvr, const char *slot,
00436 KActionCollection* parent, const char *name = 0 );
00437
00441 KDEUI_EXPORT KAction *goTo(const QObject *recvr, const char *slot,
00442 KActionCollection* parent, const char *name = 0 );
00443
00444
00448 KDEUI_EXPORT KAction *gotoPage(const QObject *recvr, const char *slot,
00449 KActionCollection* parent, const char *name = 0 );
00450
00454 KDEUI_EXPORT KAction *gotoLine(const QObject *recvr, const char *slot,
00455 KActionCollection* parent, const char *name = 0 );
00456
00460 KDEUI_EXPORT KAction *firstPage(const QObject *recvr, const char *slot,
00461 KActionCollection* parent, const char *name = 0 );
00462
00466 KDEUI_EXPORT KAction *lastPage(const QObject *recvr, const char *slot,
00467 KActionCollection* parent, const char *name = 0 );
00468
00472 KDEUI_EXPORT KAction *addBookmark(const QObject *recvr, const char *slot,
00473 KActionCollection* parent, const char *name = 0 );
00474
00478 KDEUI_EXPORT KAction *editBookmarks(const QObject *recvr, const char *slot,
00479 KActionCollection* parent, const char *name = 0 );
00480
00484 KDEUI_EXPORT KAction *spelling(const QObject *recvr, const char *slot,
00485 KActionCollection* parent, const char *name = 0 );
00486
00487
00491 KDEUI_EXPORT KToggleAction *showMenubar(const QObject *recvr, const char *slot,
00492 KActionCollection* parent, const char *name = 0 );
00493
00501 KDEUI_EXPORT KToggleAction *showToolbar(const QObject *recvr, const char *slot,
00502 KActionCollection* parent, const char *name = 0 ) KDE_DEPRECATED;
00509 KDEUI_EXPORT KToggleToolBarAction *showToolbar(const char* toolBarName,
00510 KActionCollection* parent, const char *name = 0 ) KDE_DEPRECATED;
00511
00515 KDEUI_EXPORT KToggleAction *showStatusbar(const QObject *recvr, const char *slot,
00516 KActionCollection* parent, const char *name = 0 );
00517
00522 KDEUI_EXPORT KToggleFullScreenAction *fullScreen(const QObject *recvr, const char *slot,
00523 KActionCollection* parent, QWidget* window, const char *name = 0 );
00524
00528 KDEUI_EXPORT KAction *saveOptions(const QObject *recvr, const char *slot,
00529 KActionCollection* parent, const char *name = 0 );
00530
00537 KDEUI_EXPORT KAction *keyBindings(const QObject *recvr, const char *slot,
00538 KActionCollection* parent, const char *name = 0 );
00539
00543 KDEUI_EXPORT KAction *preferences(const QObject *recvr, const char *slot,
00544 KActionCollection* parent, const char *name = 0 );
00545
00549 KDEUI_EXPORT KAction *configureToolbars(const QObject *recvr,
00550 const char *slot,
00551 KActionCollection* parent,
00552 const char *name = 0 );
00553
00558 KDEUI_EXPORT KAction *configureNotifications(const QObject *recvr,
00559 const char *slot,
00560 KActionCollection *parent,
00561 const char *name = 0);
00562
00566 KDEUI_EXPORT KAction *help(const QObject *recvr, const char *slot,
00567 KActionCollection* parent, const char *name = 0 );
00568
00572 KDEUI_EXPORT KAction *helpContents(const QObject *recvr, const char *slot,
00573 KActionCollection* parent, const char *name = 0 );
00574
00578 KDEUI_EXPORT KAction *whatsThis(const QObject *recvr, const char *slot,
00579 KActionCollection* parent, const char *name = 0 );
00580
00585 KDEUI_EXPORT KAction *tipOfDay(const QObject *recvr, const char *slot,
00586 KActionCollection* parent, const char *name = 0 );
00587
00591 KDEUI_EXPORT KAction *reportBug(const QObject *recvr, const char *slot,
00592 KActionCollection* parent, const char *name = 0 );
00593
00597 KDEUI_EXPORT KAction *aboutApp(const QObject *recvr, const char *slot,
00598 KActionCollection* parent, const char *name = 0 );
00599
00603 KDEUI_EXPORT KAction *aboutKDE(const QObject *recvr, const char *slot,
00604 KActionCollection* parent, const char *name = 0 );
00605
00610 KDEUI_EXPORT KAction *switchApplicationLanguage(const QObject *recvr, const char *slot,
00611 KActionCollection* parent, const char *name = 0 );
00612 }
00613
00614 #endif // KSTDACTION_H