org.kde.koala
Class KAction

java.lang.Object
  extended by org.kde.qt.Qt
      extended by org.kde.qt.QObject
          extended by org.kde.koala.KAction
All Implemented Interfaces:
org.kde.qt.QtSupport
Direct Known Subclasses:
KActionMenu, KActionSeparator, KDataToolAction, KPasteTextAction, KSelectAction, KToggleAction, KToolBarPopupAction, KWidgetAction

public class KAction
extends org.kde.qt.QObject

The KAction class (and derived and super classes) provides a way to easily encapsulate a "real" user-selected action or event in your program. For instance, a user may want to paste the contents of the clipboard or scroll down a document or quit the application. These are all actions -- events that the user causes to happen. The KAction class allows the developer to deal with these actions in an easy and intuitive manner. Specifically, the KAction class encapsulated the various attributes to an event/action. For instance, an action might have an icon that goes along with it (a clipboard for a "paste" action or scissors for a "cut" action). The action might have some text to describe the action. It will certainly have a method or function that actually executes the action! All these attributes are contained within the KAction object. The advantage of dealing with Actions is that you can manipulate the Action without regard to the GUI representation of it. For instance, in the "normal" way of dealing with actions like "cut", you would manually insert a item for Cut into a menu and a button into a toolbar. If you want to disable the cut action for a moment (maybe nothing is selected), you would have to hunt down the pointer to the menu item and the toolbar button and disable both individually. Setting the menu item and toolbar item up uses very similar code - but has to be done twice! With the Action concept, you simply "plug" the Action into whatever GUI element you want. The KAction class will then take care of correctly defining the menu item (with icons, accelerators, text, etc) or toolbar button.. or whatever. From then on, if you manipulate the Action at all, the effect will propogate through all GUI representations of it. Back to the "cut" example: if you want to disable the Cut Action, you would simply do 'cutAction.setEnabled(false)' and the menuitem and button would instantly be disabled! This is the biggest advantage to the Action concept -- there is a one-to-one relationship between the "real" action and all GUI representations of it. KAction emits the activated() signal if the user activated the corresponding GUI element ( menu item, toolbar button, etc. ) If you are in the situation of wanting to map the activated() signal of multiple action objects to one slot, with a special argument bound to each action, then you might consider using QSignalMapper . A tiny example:

 QSignalMapper desktopNumberMapper = new QSignalMapper( this );
 connect( desktopNumberMapper, SIGNAL("mapped( int )"),
          this, SLOT("moveWindowToDesktop( int )") );
 for ( uint i = 0; i < numberOfDesktops; ++i ) {
     KAction desktopAction = new KAction( i18n( "Move Window to Desktop %i" ).arg( i ), ... );
     connect( desktopAction, SIGNAL("activated()"), desktopNumberMapper, SLOT("map()") );
     desktopNumberMapper.setMapping( desktopAction, i );
 }
 
  • General Usage:
  • The steps to using actions are roughly as follows
  • Decide which attributes you want to associate with a given action (icons, text, keyboard shortcut, etc)
  • Create the action using KAction (or derived or super class).
  • "Plug" the Action into whatever GUI element you want. Typically, this will be a menu or toolbar.
  • Detailed Example:
  • Here is an example of enabling a "New [document]" action
     KAction newAct = new KAction(i18n("&New"), "filenew",
                                   KStdAccel.shortcut(KStdAccel.New),
                                   this, SLOT("fileNew()"),
                                   actionCollection(), "new");
     
    This line creates our action. It says that wherever this action is displayed, it will use "&New" as the text, the standard icon, and the standard shortcut. It further says that whenever this action is invoked, it will use the fileNew() slot to execute it.
     QPopupMenu file = new QPopupMenu;
     newAct.plug(file);
     
    That just inserted the action into the File menu. The point is, it's not important in which menu it is: all manipulation of the item is done through the newAct object.
     newAct.plug(toolBar());
     
    And this inserted the Action into the main toolbar as a button. That's it! If you want to disable that action sometime later, you can do so with
     newAct.setEnabled(false)
     
    and both the menuitem in File and the toolbar button will instantly be disabled. Do not delete a KAction object without unplugging it from all its containers. The simplest way to do that is to use the unplugAll() as in the following example:
     newAct.unplugAll();
     delete newAct;
     
    Normally you will not need to do this as KActionCollection manages everything for you. Note: if you are using a "standard" action like "new", "paste", "quit", or any other action described in the KDE UI Standards, please use the methods in the KStdAction class rather than defining your own.
  • Usage Within the XML Framework:
  • If you are using KAction within the context of the XML menu and toolbar building framework, then there are a few tiny changes. The first is that you must insert your new action into an action collection. The action collection (a KActionCollection) is, logically enough, a central collection of all of the actions defined in your application. The XML UI framework code in KXMLGUI classes needs access to this collection in order to build up the GUI (it's how the builder code knows which actions are valid and which aren't). Also, if you use the XML builder framework, then you do not ever have to plug your actions into containers manually. The framework does that for you. See KActionSignals for signals emitted by KAction

    See Also:
    KStdAction

    Field Summary
    static int AccelActivation
               
    static int EmulatedActivation
               
    static int PopupMenuActivation
               
    static int ToolBarActivation
               
    static int UnknownActivation
               
     
    Fields inherited from class org.kde.qt.Qt
    AlignAuto, AlignBottom, AlignCenter, AlignHCenter, AlignHorizontal_Mask, AlignJustify, AlignLeft, AlignRight, AlignTop, AlignVCenter, AlignVertical_Mask, AlphaDither_Mask, ALT, AltButton, AnchorHref, AnchorName, AndNotROP, AndROP, ArrowCursor, Ascending, ASCII_ACCEL, AutoColor, AutoDither, AutoText, AvoidDither, BDiagPattern, BeginsWith, BevelJoin, BitmapCursor, BlankCursor, Bottom, BottomLeft, BottomRight, BreakAnywhere, BusyCursor, CaseSensitive, ClearROP, ColorMode_Mask, ColorOnly, Contains, ControlButton, CopyROP, CrossCursor, CrossPattern, CTRL, CustomPattern, DashDotDotLine, DashDotLine, DashLine, Dense1Pattern, Dense2Pattern, Dense3Pattern, Dense4Pattern, Dense5Pattern, Dense6Pattern, Dense7Pattern, Descending, DiagCrossPattern, DiffuseAlphaDither, DiffuseDither, Dither_Mask, DitherMode_Mask, DockBottom, DockLeft, DockMinimized, DockRight, DockTop, DockTornOff, DockUnmanaged, DontClip, DontPrint, DotLine, DownArrow, EndsWith, EraseROP, ExactMatch, ExpandTabs, FDiagPattern, FixedColor, FixedPixmap, FlatCap, ForbiddenCursor, HiEnglishUnit, HiMetricUnit, Horizontal, HorPattern, IbeamCursor, Identical, IncludeTrailingSpaces, ISODate, Key_0, Key_1, Key_2, Key_3, Key_4, Key_5, Key_6, Key_7, Key_8, Key_9, Key_A, Key_aacute, Key_Aacute, Key_acircumflex, Key_Acircumflex, Key_acute, Key_adiaeresis, Key_Adiaeresis, Key_ae, Key_AE, Key_agrave, Key_Agrave, Key_Alt, Key_Ampersand, Key_Any, Key_Apostrophe, Key_aring, Key_Aring, Key_AsciiCircum, Key_AsciiTilde, Key_Asterisk, Key_At, Key_atilde, Key_Atilde, Key_B, Key_Back, Key_Backslash, Key_Backspace, Key_BackSpace, Key_Backtab, Key_BackTab, Key_Bar, Key_BassBoost, Key_BassDown, Key_BassUp, Key_BraceLeft, Key_BraceRight, Key_BracketLeft, Key_BracketRight, Key_brokenbar, Key_C, Key_CapsLock, Key_ccedilla, Key_Ccedilla, Key_cedilla, Key_cent, Key_Clear, Key_Colon, Key_Comma, Key_Control, Key_copyright, Key_currency, Key_D, Key_degree, Key_Delete, Key_diaeresis, Key_Direction_L, Key_Direction_R, Key_division, Key_Dollar, Key_Down, Key_E, Key_eacute, Key_Eacute, Key_ecircumflex, Key_Ecircumflex, Key_ediaeresis, Key_Ediaeresis, Key_egrave, Key_Egrave, Key_End, Key_Enter, Key_Equal, Key_Escape, Key_eth, Key_ETH, Key_Exclam, Key_exclamdown, Key_F, Key_F1, Key_F10, Key_F11, Key_F12, Key_F13, Key_F14, Key_F15, Key_F16, Key_F17, Key_F18, Key_F19, Key_F2, Key_F20, Key_F21, Key_F22, Key_F23, Key_F24, Key_F25, Key_F26, Key_F27, Key_F28, Key_F29, Key_F3, Key_F30, Key_F31, Key_F32, Key_F33, Key_F34, Key_F35, Key_F4, Key_F5, Key_F6, Key_F7, Key_F8, Key_F9, Key_Favorites, Key_Forward, Key_G, Key_Greater, Key_guillemotleft, Key_guillemotright, Key_H, Key_Help, Key_Home, Key_HomePage, Key_Hyper_L, Key_Hyper_R, Key_hyphen, Key_I, Key_iacute, Key_Iacute, Key_icircumflex, Key_Icircumflex, Key_idiaeresis, Key_Idiaeresis, Key_igrave, Key_Igrave, Key_Insert, Key_J, Key_K, Key_L, Key_Launch0, Key_Launch1, Key_Launch2, Key_Launch3, Key_Launch4, Key_Launch5, Key_Launch6, Key_Launch7, Key_Launch8, Key_Launch9, Key_LaunchA, Key_LaunchB, Key_LaunchC, Key_LaunchD, Key_LaunchE, Key_LaunchF, Key_LaunchMail, Key_LaunchMedia, Key_Left, Key_Less, Key_M, Key_macron, Key_masculine, Key_MediaLast, Key_MediaNext, Key_MediaPlay, Key_MediaPrev, Key_MediaRecord, Key_MediaStop, Key_Menu, Key_Meta, Key_Minus, Key_mu, Key_multiply, Key_N, Key_Next, Key_nobreakspace, Key_notsign, Key_ntilde, Key_Ntilde, Key_NumberSign, Key_NumLock, Key_O, Key_oacute, Key_Oacute, Key_ocircumflex, Key_Ocircumflex, Key_odiaeresis, Key_Odiaeresis, Key_ograve, Key_Ograve, Key_onehalf, Key_onequarter, Key_onesuperior, Key_Ooblique, Key_OpenUrl, Key_ordfeminine, Key_oslash, Key_otilde, Key_Otilde, Key_P, Key_PageDown, Key_PageUp, Key_paragraph, Key_ParenLeft, Key_ParenRight, Key_Pause, Key_Percent, Key_Period, Key_periodcentered, Key_Plus, Key_plusminus, Key_Print, Key_Prior, Key_Q, Key_Question, Key_questiondown, Key_QuoteDbl, Key_QuoteLeft, Key_R, Key_Refresh, Key_registered, Key_Return, Key_Right, Key_S, Key_ScrollLock, Key_Search, Key_section, Key_Semicolon, Key_Shift, Key_Slash, Key_Space, Key_ssharp, Key_Standby, Key_sterling, Key_Stop, Key_Super_L, Key_Super_R, Key_SysReq, Key_T, Key_Tab, Key_thorn, Key_THORN, Key_threequarters, Key_threesuperior, Key_TrebleDown, Key_TrebleUp, Key_twosuperior, Key_U, Key_uacute, Key_Uacute, Key_ucircumflex, Key_Ucircumflex, Key_udiaeresis, Key_Udiaeresis, Key_ugrave, Key_Ugrave, Key_Underscore, Key_unknown, Key_Up, Key_V, Key_VolumeDown, Key_VolumeMute, Key_VolumeUp, Key_W, Key_X, Key_Y, Key_yacute, Key_Yacute, Key_ydiaeresis, Key_yen, Key_Z, KeyButtonMask, Keypad, LastCursor, LastROP, Left, LeftArrow, LeftButton, LocalDate, LocalTime, LoEnglishUnit, LogText, LoMetricUnit, MacStyle, META, MetaButton, MidButton, Minimized, MiterJoin, MODIFIER_MASK, MonoOnly, MotifStyle, MouseButtonMask, MPenCapStyle, MPenJoinStyle, MPenStyle, MV_10_DOT_0, MV_10_DOT_1, MV_10_DOT_2, MV_10_DOT_3, MV_10_DOT_4, MV_9, MV_CHEETAH, MV_JAGUAR, MV_PANTHER, MV_PUMA, MV_TIGER, MV_Unknown, NandROP, NoAccel, NoAlpha, NoBackground, NoBrush, NoButton, NoMatch, NoPen, NopROP, NorROP, NotAndROP, NotCopyROP, NotEraseROP, NotOrROP, NotROP, NotXorROP, OpaqueMode, OrderedAlphaDither, OrderedDither, OrNotROP, OrROP, Overline, PaletteBackground, PaletteBase, PaletteBrightText, PaletteButton, PaletteButtonText, PaletteDark, PaletteForeground, PaletteHighlight, PaletteHighlightedText, PaletteLight, PaletteLink, PaletteLinkVisited, PaletteMid, PaletteMidlight, PaletteShadow, PaletteText, PartialMatch, PixelUnit, PlainText, PMStyle, PointingHandCursor, PreferDither, RichText, Right, RightArrow, RightButton, RoundCap, RoundJoin, SetROP, SHIFT, ShiftButton, ShowPrefix, SingleLine, SizeAllCursor, SizeBDiagCursor, SizeFDiagCursor, SizeHorCursor, SizeVerCursor, SolidLine, SolidPattern, SplitHCursor, SplitVCursor, SquareCap, StrikeOut, TextDate, ThresholdAlphaDither, ThresholdDither, Top, TopLeft, TopRight, TornOff, TransparentMode, TwipsUnit, UI_AnimateCombo, UI_AnimateMenu, UI_AnimateToolBox, UI_AnimateTooltip, UI_FadeMenu, UI_FadeTooltip, UI_General, Underline, UNICODE_ACCEL, Unmanaged, UpArrow, UpArrowCursor, UTC, VerPattern, Vertical, WaitCursor, WDestructiveClose, WGroupLeader, WhatsThisCursor, Win3Style, WindowActive, WindowFullScreen, WindowMaximized, WindowMinimized, WindowNoState, WindowsStyle, WMacDrawer, WMacNoSheet, WMouseNoMask, WNoAutoErase, WNoMousePropagation, WNorthWestGravity, WordBreak, WPaintClever, WPaintDesktop, WPaintUnclipped, WRepaintNoErase, WResizeNoErase, WShowModal, WState_AutoMask, WState_BlockUpdates, WState_CompressKeys, WState_ConfigPending, WState_Created, WState_CreatedHidden, WState_Disabled, WState_DND, WState_Exposed, WState_ForceDisabled, WState_ForceHide, WState_FullScreen, WState_HasMouse, WState_InPaintEvent, WState_Maximized, WState_Minimized, WState_MouseTracking, WState_OwnCursor, WState_OwnSizePolicy, WState_Polished, WState_Reparented, WState_Reserved0, WState_Resized, WState_Visible, WStaticContents, WStyle_ContextHelp, WStyle_Customize, WStyle_Dialog, WStyle_DialogBorder, WStyle_Mask, WStyle_Maximize, WStyle_Minimize, WStyle_MinMax, WStyle_NoBorder, WStyle_NoBorderEx, WStyle_NormalBorder, WStyle_Reserved, WStyle_Splash, WStyle_StaysOnTop, WStyle_SysMenu, WStyle_Title, WStyle_Tool, WSubWindow, WType_Desktop, WType_Dialog, WType_Mask, WType_Modal, WType_Popup, WType_TopLevel, WV_2000, WV_2003, WV_32s, WV_95, WV_98, WV_CE, WV_CE_based, WV_CENET, WV_DOS_based, WV_Me, WV_NT, WV_NT_based, WV_XP, WWinOwnDC, WX11BypassWM, X11ParentRelative, XorROP
     
    Constructor Summary
    protected KAction(java.lang.Class dummy)
               
      KAction(KGuiItem item, KShortcut cut, org.kde.qt.QObject receiver, java.lang.String slot, KActionCollection parent, java.lang.String name)
              The same as the above constructor, but with a KGuiItem providing the text and icon.
      KAction(java.lang.String text, KShortcut cut, org.kde.qt.QObject receiver, java.lang.String slot, KActionCollection parent, java.lang.String name)
              Constructs an action with text, potential keyboard shortcut, and a SLOT to call when this action is invoked by the user.
      KAction(java.lang.String text, org.kde.qt.QIconSet pix, KShortcut cut, org.kde.qt.QObject receiver, java.lang.String slot, KActionCollection parent, java.lang.String name)
              Constructs an action with text, icon, potential keyboard shortcut, and a SLOT to call when this action is invoked by the user.
      KAction(java.lang.String text, java.lang.String pix, KShortcut cut, org.kde.qt.QObject receiver, java.lang.String slot, KActionCollection parent, java.lang.String name)
              Constructs an action with text, icon, potential keyboard shortcut, and a SLOT to call when this action is invoked by the user.
     
    Method Summary
     void activate()
              Emulate user's interaction programmatically, by activating the action.
    protected  void addContainer(org.kde.qt.QWidget parent, int id)
               
    protected  void addContainer(org.kde.qt.QWidget parent, org.kde.qt.QWidget representative)
               
     java.lang.String className()
               
     org.kde.qt.QWidget container(int index)
               
     int containerCount()
               
     void dispose()
              Delete the wrapped C++ instance ahead of finalize()
    protected  void finalize()
              Deletes the wrapped C++ instance
    protected  int findContainer(int id)
               
    protected  int findContainer(org.kde.qt.QWidget widget)
               
    static int getToolButtonID()
              Generate a toolbar button id.
     java.lang.String group()
               
    protected  KGuiItem guiItem()
              Return the underlying KGuiItem
     boolean hasIcon()
               
     boolean hasIconSet()
               
     java.lang.String icon()
               
     org.kde.qt.QIconSet iconSet()
              Remove in KDE4
     org.kde.qt.QIconSet iconSet(int group)
               
     org.kde.qt.QIconSet iconSet(int group, int size)
              Get the QIconSet from which the icons used to display this action will be chosen.
     boolean isDisposed()
              Has the wrapped C++ instance been deleted?
     boolean isEnabled()
              Returns true if this action is enabled.
     boolean isPlugged()
              returns whether the action is plugged into any container widget or not.
     boolean isPlugged(org.kde.qt.QWidget container)
              returns whether the action is plugged into the given container
     boolean isPlugged(org.kde.qt.QWidget container, int id)
              returns whether the action is plugged into the given container with the given, container specific, id (often menu or toolbar id ) .
     boolean isPlugged(org.kde.qt.QWidget container, org.kde.qt.QWidget _representative)
              returns whether the action is plugged into the given container with the given, container specific, representative container widget item.
     boolean isShortcutConfigurable()
              Returns true if this action's shortcut is configurable.
     int itemId(int index)
               
     int kaccelCount()
               
     org.kde.qt.QMetaObject metaObject()
               
     KActionCollection parentCollection()
               
     java.lang.String plainText()
               
     int plug(org.kde.qt.QWidget widget)
               
     int plug(org.kde.qt.QWidget widget, int index)
              "Plug" or insert this action into a given widget.
    protected  void plugMainWindowAccel(org.kde.qt.QWidget w)
               
    protected  org.kde.qt.QPopupMenu popupMenu(int index)
               
    protected  void removeContainer(int index)
               
     org.kde.qt.QWidget representative(int index)
               
     void setDisabled(boolean disable)
              Calls setEnabled( !disable ).
     void setEnabled(boolean enable)
              Enables or disables this action.
     void setGroup(java.lang.String arg1)
               
     void setIcon(java.lang.String icon)
               
     void setIconSet(org.kde.qt.QIconSet iconSet)
              Sets the QIconSet from which the icons used to display this action will be chosen.
     boolean setShortcut(KShortcut arg1)
              Sets the keyboard shortcut associated with this action.
     void setShortcutConfigurable(boolean arg1)
              Indicate whether the user may configure the action's shortcut.
     void setShortcutText(java.lang.String arg1)
               
     void setText(java.lang.String text)
              Sets the text associated with this action.
     void setToolTip(java.lang.String arg1)
              Sets the tooltip text for the action.
     void setWhatsThis(java.lang.String text)
              Sets the What's this text for the action.
     KShortcut shortcut()
              Get the keyboard shortcut associated with this action.
     KShortcut shortcutDefault()
              Get the default shortcut for this action.
     java.lang.String shortcutText()
               
    protected  void slotActivated()
               
    protected  void slotButtonClicked(int arg1, int state)
               
    protected  void slotDestroyed()
               
    protected  void slotKeycodeChanged()
               
    protected  void slotPopupActivated()
               
     java.lang.String statusText()
               
     java.lang.String text()
              Get the text associated with this action.
    protected  KToolBar toolBar(int index)
               
     java.lang.String toolTip()
              Get the tooltip text for the action.
     void unplug(org.kde.qt.QWidget w)
              "Unplug" or remove this action from a given widget.
     void unplugAll()
               
    protected  void updateEnabled(int i)
               
    protected  void updateGroup(int id)
               
    protected  void updateIcon(int i)
               
    protected  void updateIconSet(int i)
               
    protected  void updateShortcut(int i)
               
    protected  void updateShortcut(org.kde.qt.QPopupMenu menu, int id)
               
    protected  void updateText(int i)
               
    protected  void updateToolTip(int id)
               
    protected  void updateWhatsThis(int i)
               
     java.lang.String whatsThis()
              Get the What's this text for the action.
    protected  java.lang.String whatsThisWithIcon()
               
     
    Methods inherited from class org.kde.qt.QObject
    activate_filters, activate_signal_bool, activate_signal, activate_signal, activate_signal, activate_signal, blockSignals, checkConnectArgs, child, child, child, childEvent, children, connect, connect, connectInternal, connectNotify, customEvent, deleteLater, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnectInternal, disconnectNotify, dumpObjectInfo, dumpObjectTree, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, event, eventFilter, highPriority, i18n, inherits, insertChild, installEventFilter, isA, isWidgetType, killTimer, killTimers, name, name, normalizeSignalSlot, objectTrees, parent, property, queryList, queryList, queryList, queryList, queryList, registerUserData, removeChild, removeEventFilter, sender, setName, setProperty, signalsBlocked, startTimer, timerEvent, tr, tr
     
    Methods inherited from class org.kde.qt.Qt
    arrowCursor, bin, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, black, blankCursor, blue, color0, color1, copyBlt, copyBlt, copyBlt, copyBlt, copyBlt, crossCursor, cyan, darkBlue, darkCyan, darkGray, darkGreen, darkMagenta, darkRed, darkYellow, dec, dynamicCast, endl, flush, forbiddenCursor, fromUtf8, gray, green, hex, ibeamCursor, lightGray, magenta, oct, op_div, op_div, op_div, op_div, op_equals, op_equals, op_equals, op_equals, op_minus, op_minus, op_minus, op_mult, op_mult, op_mult, op_mult, op_mult, op_mult, op_mult, op_mult, op_mult, op_not_equals, op_not_equals, op_not_equals, op_not_equals, op_plus, op_plus, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, pointingHandCursor, qAlpha, qApp, qAppName, qBlue, qCompress, qCompress, qDebug, qDebug, qDrawArrow, qDrawItem, qDrawItem, qDrawItem, qDrawPlainRect, qDrawPlainRect, qDrawPlainRect, qDrawPlainRect, qDrawPlainRect, qDrawPlainRect, qDrawShadeLine, qDrawShadeLine, qDrawShadeLine, qDrawShadeLine, qDrawShadeLine, qDrawShadeLine, qDrawShadeLine, qDrawShadeLine, qDrawShadePanel, qDrawShadePanel, qDrawShadePanel, qDrawShadePanel, qDrawShadePanel, qDrawShadePanel, qDrawShadePanel, qDrawShadePanel, qDrawShadeRect, qDrawShadeRect, qDrawShadeRect, qDrawShadeRect, qDrawShadeRect, qDrawShadeRect, qDrawShadeRect, qDrawShadeRect, qDrawShadeRect, qDrawShadeRect, qDrawWinButton, qDrawWinButton, qDrawWinButton, qDrawWinButton, qDrawWinButton, qDrawWinButton, qDrawWinPanel, qDrawWinPanel, qDrawWinPanel, qDrawWinPanel, qDrawWinPanel, qDrawWinPanel, qFatal, qFatal, qGLVersion, qGray, qGray, qGreen, qInitNetworkProtocols, qInstallPath, qInstallPathBins, qInstallPathData, qInstallPathDocs, qInstallPathHeaders, qInstallPathLibs, qInstallPathPlugins, qInstallPathSysconf, qInstallPathTranslations, qItemRect, qItemRect, qObsolete, qObsolete, qObsolete, qRed, qRgb, qRgba, qRound, qSharedBuild, qSuppressObsoleteWarnings, qSuppressObsoleteWarnings, qSysInfo, qSystemWarning, qSystemWarning, qUncompress, qUncompress, qVersion, qWarning, qWarning, red, reset, SIGNAL, sizeAllCursor, sizeBDiagCursor, sizeFDiagCursor, sizeHorCursor, sizeVerCursor, SLOT, splitHCursor, splitVCursor, upArrowCursor, waitCursor, whatsThisCursor, white, ws, yellow
     
    Methods inherited from class java.lang.Object
    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    UnknownActivation

    public static final int UnknownActivation
    See Also:
    Constant Field Values

    EmulatedActivation

    public static final int EmulatedActivation
    See Also:
    Constant Field Values

    AccelActivation

    public static final int AccelActivation
    See Also:
    Constant Field Values

    PopupMenuActivation

    public static final int PopupMenuActivation
    See Also:
    Constant Field Values

    ToolBarActivation

    public static final int ToolBarActivation
    See Also:
    Constant Field Values
    Constructor Detail

    KAction

    protected KAction(java.lang.Class dummy)

    KAction

    public KAction(java.lang.String text,
                   KShortcut cut,
                   org.kde.qt.QObject receiver,
                   java.lang.String slot,
                   KActionCollection parent,
                   java.lang.String name)
    Constructs an action with text, potential keyboard shortcut, and a SLOT to call when this action is invoked by the user. If you do not want or have a keyboard shortcut, set the cut param to 0. This is the most common KAction used when you do not have a corresponding icon (note that it won't appear in the current version of the "Edit ToolBar" dialog, because an action needs an icon to be plugged in a toolbar...).

    Parameters:
    text - The text that will be displayed.
    cut - The corresponding keyboard shortcut.
    receiver - The SLOT's parent.
    slot - The SLOT to invoke to execute this action.
    parent - This action's parent.
    name - An internal name for this action.

    KAction

    public KAction(java.lang.String text,
                   org.kde.qt.QIconSet pix,
                   KShortcut cut,
                   org.kde.qt.QObject receiver,
                   java.lang.String slot,
                   KActionCollection parent,
                   java.lang.String name)
    Constructs an action with text, icon, potential keyboard shortcut, and a SLOT to call when this action is invoked by the user. If you do not want or have a keyboard shortcut, set the cut param to 0. This is the other common KAction used. Use it when you do have a corresponding icon.

    Parameters:
    text - The text that will be displayed.
    pix - The icon to display.
    cut - The corresponding keyboard shortcut.
    receiver - The SLOT's parent.
    slot - The SLOT to invoke to execute this action.
    parent - This action's parent.
    name - An internal name for this action.

    KAction

    public KAction(java.lang.String text,
                   java.lang.String pix,
                   KShortcut cut,
                   org.kde.qt.QObject receiver,
                   java.lang.String slot,
                   KActionCollection parent,
                   java.lang.String name)
    Constructs an action with text, icon, potential keyboard shortcut, and a SLOT to call when this action is invoked by the user. The icon is loaded on demand later based on where it is plugged in. If you do not want or have a keyboard shortcut, set the cut param to 0. This is the other common KAction used. Use it when you do have a corresponding icon.

    Parameters:
    text - The text that will be displayed.
    pix - The icon to display.
    cut - The corresponding keyboard shortcut (shortcut).
    receiver - The SLOT's parent.
    slot - The SLOT to invoke to execute this action.
    parent - This action's parent.
    name - An internal name for this action.

    KAction

    public KAction(KGuiItem item,
                   KShortcut cut,
                   org.kde.qt.QObject receiver,
                   java.lang.String slot,
                   KActionCollection parent,
                   java.lang.String name)
    The same as the above constructor, but with a KGuiItem providing the text and icon.

    Parameters:
    item - The KGuiItem with the label and (optional) icon.
    cut - The corresponding keyboard shortcut (shortcut).
    receiver - The SLOT's parent.
    slot - The SLOT to invoke to execute this action.
    parent - This action's parent.
    name - An internal name for this action.
    Method Detail

    metaObject

    public org.kde.qt.QMetaObject metaObject()
    Overrides:
    metaObject in class org.kde.qt.QObject

    className

    public java.lang.String className()
    Overrides:
    className in class org.kde.qt.QObject

    plug

    public int plug(org.kde.qt.QWidget widget,
                    int index)
    "Plug" or insert this action into a given widget. This will typically be a menu or a toolbar. From this point on, you will never need to directly manipulate the item in the menu or toolbar. You do all enabling/disabling/manipulation directly with your KAction object.

    Parameters:
    widget - The GUI element to display this action
    index - The position into which the action is plugged. If this is negative, the action is inserted at the end.

    plug

    public int plug(org.kde.qt.QWidget widget)

    unplug

    public void unplug(org.kde.qt.QWidget w)
    "Unplug" or remove this action from a given widget. This will typically be a menu or a toolbar. This is rarely used in "normal" application. Typically, it would be used if your application has several views or modes, each with a completely different menu structure. If you simply want to disable an action for a given period, use setEnabled() instead.

    Parameters:
    w - Remove the action from this GUI element.

    isPlugged

    public boolean isPlugged()
    returns whether the action is plugged into any container widget or not.


    isPlugged

    public boolean isPlugged(org.kde.qt.QWidget container)
    returns whether the action is plugged into the given container


    isPlugged

    public boolean isPlugged(org.kde.qt.QWidget container,
                             int id)
    returns whether the action is plugged into the given container with the given, container specific, id (often menu or toolbar id ) .


    isPlugged

    public boolean isPlugged(org.kde.qt.QWidget container,
                             org.kde.qt.QWidget _representative)
    returns whether the action is plugged into the given container with the given, container specific, representative container widget item.


    container

    public org.kde.qt.QWidget container(int index)

    itemId

    public int itemId(int index)

    representative

    public org.kde.qt.QWidget representative(int index)

    containerCount

    public int containerCount()

    kaccelCount

    public int kaccelCount()

    hasIcon

    public boolean hasIcon()

    hasIconSet

    public boolean hasIconSet()

    plainText

    public java.lang.String plainText()

    text

    public java.lang.String text()
    Get the text associated with this action.


    shortcut

    public KShortcut shortcut()
    Get the keyboard shortcut associated with this action.


    shortcutDefault

    public KShortcut shortcutDefault()
    Get the default shortcut for this action.


    shortcutText

    public java.lang.String shortcutText()

    setShortcutText

    public void setShortcutText(java.lang.String arg1)

    isEnabled

    public boolean isEnabled()
    Returns true if this action is enabled.


    isShortcutConfigurable

    public boolean isShortcutConfigurable()
    Returns true if this action's shortcut is configurable.


    group

    public java.lang.String group()

    whatsThis

    public java.lang.String whatsThis()
    Get the What's this text for the action.


    toolTip

    public java.lang.String toolTip()
    Get the tooltip text for the action.


    iconSet

    public org.kde.qt.QIconSet iconSet(int group,
                                       int size)
    Get the QIconSet from which the icons used to display this action will be chosen. In KDE4 set group default to KIcon.Small while removing the other iconSet() function.


    iconSet

    public org.kde.qt.QIconSet iconSet(int group)

    iconSet

    public org.kde.qt.QIconSet iconSet()
    Remove in KDE4


    icon

    public java.lang.String icon()

    parentCollection

    public KActionCollection parentCollection()

    unplugAll

    public void unplugAll()

    statusText

    public java.lang.String statusText()

    setText

    public void setText(java.lang.String text)
    Sets the text associated with this action. The text is used for menu and toolbar labels etc.


    setShortcut

    public boolean setShortcut(KShortcut arg1)
    Sets the keyboard shortcut associated with this action.


    setGroup

    public void setGroup(java.lang.String arg1)

    setWhatsThis

    public void setWhatsThis(java.lang.String text)
    Sets the What's this text for the action. This text will be displayed when a widget that has been created by plugging this action into a container is clicked on in What's this mode. The What's this text can include QML markup as well as raw text.


    setToolTip

    public void setToolTip(java.lang.String arg1)
    Sets the tooltip text for the action. This will be used as a tooltip for a toolbar button, as a statusbar help-text for a menu item, and it also appears in the toolbar editor, to describe the action. For the tooltip to show up on the statusbar you will need to connect a couple of the actionclass signals to the toolbar. The easiest way of doing this is in your main window class, when you create a statusbar. See the KActionCollection class for more details.

    See Also:
    KActionCollection

    setIconSet

    public void setIconSet(org.kde.qt.QIconSet iconSet)
    Sets the QIconSet from which the icons used to display this action will be chosen.


    setIcon

    public void setIcon(java.lang.String icon)

    setEnabled

    public void setEnabled(boolean enable)
    Enables or disables this action. All uses of this action (eg. in menus or toolbars) will be updated to reflect the state of the action.


    setDisabled

    public void setDisabled(boolean disable)
    Calls setEnabled( !disable ).


    setShortcutConfigurable

    public void setShortcutConfigurable(boolean arg1)
    Indicate whether the user may configure the action's shortcut.


    activate

    public void activate()
    Emulate user's interaction programmatically, by activating the action. The implementation simply emits activated().


    getToolButtonID

    public static int getToolButtonID()
    Generate a toolbar button id. Made public for reimplementations.


    toolBar

    protected KToolBar toolBar(int index)

    popupMenu

    protected org.kde.qt.QPopupMenu popupMenu(int index)

    removeContainer

    protected void removeContainer(int index)

    findContainer

    protected int findContainer(org.kde.qt.QWidget widget)

    findContainer

    protected int findContainer(int id)

    plugMainWindowAccel

    protected void plugMainWindowAccel(org.kde.qt.QWidget w)

    addContainer

    protected void addContainer(org.kde.qt.QWidget parent,
                                int id)

    addContainer

    protected void addContainer(org.kde.qt.QWidget parent,
                                org.kde.qt.QWidget representative)

    updateShortcut

    protected void updateShortcut(int i)

    updateShortcut

    protected void updateShortcut(org.kde.qt.QPopupMenu menu,
                                  int id)

    updateGroup

    protected void updateGroup(int id)

    updateText

    protected void updateText(int i)

    updateEnabled

    protected void updateEnabled(int i)

    updateIconSet

    protected void updateIconSet(int i)

    updateIcon

    protected void updateIcon(int i)

    updateToolTip

    protected void updateToolTip(int id)

    updateWhatsThis

    protected void updateWhatsThis(int i)

    whatsThisWithIcon

    protected java.lang.String whatsThisWithIcon()

    guiItem

    protected KGuiItem guiItem()
    Return the underlying KGuiItem


    slotDestroyed

    protected void slotDestroyed()

    slotKeycodeChanged

    protected void slotKeycodeChanged()

    slotActivated

    protected void slotActivated()

    slotPopupActivated

    protected void slotPopupActivated()

    slotButtonClicked

    protected void slotButtonClicked(int arg1,
                                     int state)

    finalize

    protected void finalize()
                     throws java.lang.InternalError
    Deletes the wrapped C++ instance

    Overrides:
    finalize in class org.kde.qt.QObject
    Throws:
    java.lang.InternalError

    dispose

    public void dispose()
    Delete the wrapped C++ instance ahead of finalize()

    Overrides:
    dispose in class org.kde.qt.QObject

    isDisposed

    public boolean isDisposed()
    Has the wrapped C++ instance been deleted?

    Overrides:
    isDisposed in class org.kde.qt.QObject