org.kde.koala
Class KMainWindow

java.lang.Object
  extended by org.kde.qt.Qt
      extended by org.kde.qt.QObject
          extended by org.kde.qt.QWidget
              extended by org.kde.qt.QMainWindow
                  extended by org.kde.koala.KMainWindow
All Implemented Interfaces:
KXMLGUIBuilderInterface, KXMLGUIClientInterface, org.kde.qt.QPaintDeviceInterface, org.kde.qt.QtSupport
Direct Known Subclasses:
KDockMainWindow, MainWindow

public class KMainWindow
extends org.kde.qt.QMainWindow
implements KXMLGUIBuilderInterface, KXMLGUIClientInterface

Top level widget that provides toolbars, a status line and a frame. It should be used as a top level (parent-less) widget. It manages the geometry for all its children, including your main widget. Normally, you will inherit from KMainWindow, then construct (or use some existing) widget as your main view. You can set only one main view. You can add as many toolbars as you like. There can be only one menubar and only one statusbar. The toolbars, menubar, and statusbar can be created by the KMainWindow and - unlike the old KMainWindow - may, but do not have to, be deleted by you. KMainWindow will handle that internally. Height and width can be operated independently from each other. Simply define the minimum/maximum height/width of your main widget and KMainWindow will take this into account. For fixed size windows set your main widget to a fixed size. Fixed aspect ratios (heightForWidth()) and fixed width widgets are not supported. KMainWindow will set icon, mini icon and caption, which it gets from KApplication. It provides full session management, and will save its position, geometry and positions of toolbars and menubar on logout. If you want to save additional data, reimplement saveProperties() and (to read them again on next login) readProperties(). To save special data about your data, reimplement saveGlobalProperties(). To warn user that application or windows have unsaved data on close or logout, reimplement queryClose() and/or queryExit(). There are also kRestoreMainWindows convenience functions which can restore all your windows on next login. Note that a KMainWindow per-default is created with the WDestructiveClose flag, i.e. it is automatically destroyed when the window is closed. If you do not want this behavior, specify 0 as widget flag in the constructor.

Author:
Reginald Stadlbauer (reggie@kde.org) Stephan Kulow (coolo@kde.org), Matthias Ettrich (ettrich@kde.org), Chris Schlaeger (cs@kde.org), Sven Radej (radej@kde.org). Maintained by Sven Radej (radej@kde.org)
See Also:
KApplication

Field Summary
static int Create
           
static int Keys
           
static int NoDCOPObject
          Flags that can be passed in an argument to the constructor to change the behavior.
static int Save
           
static int StatusBar
           
static int ToolBar
           
 
Fields inherited from class org.kde.qt.QMainWindow
AllDockWindows, NoToolBars, OnlyToolBars
 
Fields inherited from class org.kde.qt.QWidget
AncestorOrigin, ClickFocus, NoFocus, ParentOrigin, StrongFocus, TabFocus, WheelFocus, WidgetOrigin, WindowOrigin
 
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
  KMainWindow()
           
protected KMainWindow(java.lang.Class dummy)
           
  KMainWindow(int cflags)
           
  KMainWindow(int cflags, org.kde.qt.QWidget parent)
           
  KMainWindow(int cflags, org.kde.qt.QWidget parent, java.lang.String name)
           
  KMainWindow(int cflags, org.kde.qt.QWidget parent, java.lang.String name, int f)
          Overloaded constructor which allows passing some KMainWindow.CreationFlags.
  KMainWindow(org.kde.qt.QWidget parent)
           
  KMainWindow(org.kde.qt.QWidget parent, java.lang.String name)
           
  KMainWindow(org.kde.qt.QWidget parent, java.lang.String name, int f)
          Construct a main window.
 
Method Summary
 KAccel accel()
           
 KAction action(org.kde.qt.QDomElement element)
          Retrieves an action for a given QDomElement.
 KAction action(java.lang.String name)
          Retrieves an action of the client by name.
 KActionCollection actionCollection()
          Retrieves the entire action collection for the GUI client.
 void addStateActionDisabled(java.lang.String state, java.lang.String action)
           
 void addStateActionEnabled(java.lang.String state, java.lang.String action)
           
 void appHelpActivated()
          Open the help page for the application.
 void applyMainWindowSettings(KConfig config)
           
 void applyMainWindowSettings(KConfig config, java.lang.String groupName)
           
 void applyMainWindowSettings(KConfig config, java.lang.String groupName, boolean force)
          Read settings for statusbar, menubar and toolbar from their respective groups in the config file and apply them.
 java.lang.String autoSaveGroup()
           
 boolean autoSaveSettings()
           
 void beginXMLPlug(org.kde.qt.QWidget arg1)
           
 KXMLGUIClientInterface builderClient()
           
 KInstanceInterface builderInstance()
           
static boolean canBeRestored(int number)
          Session Management Try to restore the toplevel widget as defined by the number (1..X).
protected  void childEvent(org.kde.qt.QChildEvent e)
           
 java.lang.String className()
           
static java.lang.String classNameOfToplevel(int number)
          Returns the className() of the number of the toplevel window which should be restored.
 KXMLGUIBuilderInterface clientBuilder()
          Retrieves the client's GUI builder or null if no client specific builder has been assigned via setClientBuilder()
protected  void closeEvent(org.kde.qt.QCloseEvent arg1)
          Reimplemented to call the queryClose() and queryExit() handlers.
 int configureToolbars()
          Show a standard configure toolbar dialog.
protected  void conserveMemory()
          This function will attempt to give up some memory after the GUI is built.
 java.util.ArrayList containerTags()
           
 org.kde.qt.QWidget createContainer(org.kde.qt.QWidget parent, int index, org.kde.qt.QDomElement element, int[] id)
          Creates a container (menubar/menu/toolbar/statusbar/separator/...) from an element in the XML file
 int createCustomElement(org.kde.qt.QWidget parent, int index, org.kde.qt.QDomElement element)
           
 void createGUI()
           
 void createGUI(java.lang.String xmlfile)
           
 void createGUI(java.lang.String xmlfile, boolean _conserveMemory)
          Create a GUI given a local XML file.
 void createStandardStatusBarAction()
          Sets whether KMainWindow should provide a menu that allows showing/hiding of the statusbar ( using KToggleStatusBarAction ).
 KPopupMenu customHelpMenu()
           
 KPopupMenu customHelpMenu(boolean showWhatsThis)
          Returns the help menu.
 java.util.ArrayList customTags()
           
 void dispose()
          Delete the wrapped C++ instance ahead of finalize()
 org.kde.qt.QDomDocument domDocument()
           
 void endXMLPlug()
           
 KXMLGUIFactory factory()
          Retrieves a pointer to the KXMLGUIFactory this client is associated with (will return null if the client's GUI has not been built by a KXMLGUIFactory.
protected  void finalize()
          Deletes the wrapped C++ instance
 void finalizeGUI(boolean force)
           
 void finalizeGUI(KXMLGUIClientInterface client)
           
static java.lang.String findMostRecentXMLFile(java.lang.String[] files, java.lang.StringBuffer doc)
           
 KXMLGUIFactory guiFactory()
           
 boolean hasMenuBar()
          Returns true, if there is a menubar
 KPopupMenu helpMenu()
           
 KPopupMenu helpMenu(java.lang.String aboutAppText)
           
 KPopupMenu helpMenu(java.lang.String aboutAppText, boolean showWhatsThis)
          Retrieve the standard help menu.
 void hide()
          Reimplementation of QMainWindow.hide()
 void ignoreInitialGeometry()
          Used from Konqueror when reusing the main window.
 boolean initialGeometrySet()
           
 void insertChildClient(KXMLGUIClientInterface child)
          Use this method to make a client a child client of another client.
 KInstanceInterface instance()
           
 boolean isDisposed()
          Has the wrapped C++ instance been deleted?
 boolean isHelpMenuEnabled()
          Return true when the help menu is enabled
 boolean isStandardToolBarMenuEnabled()
           
 KMenuBar kmenuBar()
          Returns a pointer to the menu bar.
 KStatusBar kstatusBar()
          Returns a pointer to the status bar.
 java.lang.String localXMLFile()
           
 java.util.ArrayList memberList()
          List of members of KMainWindow class.
 org.kde.qt.QMetaObject metaObject()
           
protected  void paintEvent(org.kde.qt.QPaintEvent e)
          List of members of KMainWindow class.
 KXMLGUIClientInterface parentClient()
          KXMLGUIClients can form a simple child/parent object tree.
protected  void parseGeometry(boolean parsewidth)
           
 void prepareXMLUnplug(org.kde.qt.QWidget arg1)
           
protected  boolean queryClose()
          Called before the window is closed, either by the user or indirectly by the session manager.
protected  boolean queryExit()
          Called before the very last window is closed, either by the user or indirectly by the session manager.
protected  void readGlobalProperties(KConfig sessionConfig)
          The counterpart of saveGlobalProperties().
protected  void readProperties(KConfig arg1)
          Read your instance-specific properties.
protected  boolean readPropertiesInternal(KConfig arg1, int arg2)
           
 void reloadXML()
          Forces this client to re-read its XML resource file.
 void removeChildClient(KXMLGUIClientInterface child)
          Removes the given child from the client's children list.
 void removeContainer(org.kde.qt.QWidget container, org.kde.qt.QWidget parent, org.kde.qt.QDomElement element, int id)
          Removes the given (and previously via createContainer ) created container.
 void removeCustomElement(org.kde.qt.QWidget parent, int id)
           
 void resetAutoSaveSettings()
          Disable the auto-save-settings feature.
protected  void resizeEvent(org.kde.qt.QResizeEvent e)
           
 boolean restore(int number)
           
 boolean restore(int number, boolean show)
          Restore the session specified by number. Returns false if this fails, otherwise returns true and shows the window.
static void RESTORE(java.lang.String typeName)
           
protected  void restoreWindowSize(KConfig config)
          For inherited classes Note that the group must be set before calling, and that a -geometry on the command line has priority.
protected  void saveAutoSaveSettings()
          This slot should only be called in case you reimplement closeEvent() and if you are using the "auto-save" feature.
protected  void saveGlobalProperties(KConfig sessionConfig)
          Save your application-wide properties.
 void saveMainWindowSettings(KConfig config)
           
 void saveMainWindowSettings(KConfig config, java.lang.String groupName)
          Save settings for statusbar, menubar and toolbar to their respective groups in the config file config.
protected  void saveNewToolbarConfig()
          Rebuilds the GUI after KEditToolbar changed the toolbar layout.
protected  void saveProperties(KConfig arg1)
          Save your instance-specific properties.
protected  void savePropertiesInternal(KConfig arg1, int arg2)
           
protected  void saveWindowSize(KConfig config)
          For inherited classes Note that the group must be set before calling
 void setAutoSaveSettings()
           
 void setAutoSaveSettings(java.lang.String groupName)
           
 void setAutoSaveSettings(java.lang.String groupName, boolean saveWindowSize)
          Call this to enable "auto-save" of toolbar/menubar/statusbar settings (and optionally window size).
 void setBuilderClient(KXMLGUIClientInterface client)
           
 void setBuilderInstance(KInstanceInterface instance)
           
 void setCaption(java.lang.String caption)
          Makes a KDE compliant caption.
 void setCaption(java.lang.String caption, boolean modified)
          Makes a KDE compliant caption.
 void setClientBuilder(KXMLGUIBuilderInterface builder)
          A client can have an own KXMLGUIBuilder.
protected  void setDOMDocument(org.kde.qt.QDomDocument document)
           
protected  void setDOMDocument(org.kde.qt.QDomDocument document, boolean merge)
          Sets the Document for the part, describing the layout of the GUI.
 void setFactory(KXMLGUIFactory factory)
          This method is called by the KXMLGUIFactory as soon as the client is added to the KXMLGUIFactory's GUI.
 void setFrameBorderWidth(int arg1)
           
 void setHelpMenuEnabled()
           
 void setHelpMenuEnabled(boolean showHelpMenu)
          Enables the build of a standard help menu when calling createGUI().
 void setIcon(org.kde.qt.QPixmap arg1)
           
protected  void setInstance(KInstanceInterface instance)
          Sets the instance ( KInstance) for this part.
protected  void setLocalXMLFile(java.lang.String file)
           
 void setPlainCaption(java.lang.String caption)
          Make a plain caption without any modifications.
 void setSettingsDirty()
          Tell the main window that it should save its settings when being closed.
 void setStandardToolBarMenuEnabled(boolean enable)
          Sets whether KMainWindow should provide a menu that allows showing/hiding the available toolbars ( using KToggleToolBarAction ) .
protected  boolean settingsDirty()
          For inherited classes
protected  java.lang.String settingsGroup()
          For inherited classes
 void setupGUI()
           
 void setupGUI(int options)
           
 void setupGUI(int options, java.lang.String xmlfile)
          Configures the current windows and its actions in the typical KDE fashion.
 void setupGUI(org.kde.qt.QSize defaultSize)
           
 void setupGUI(org.kde.qt.QSize defaultSize, int options)
           
 void setupGUI(org.kde.qt.QSize defaultSize, int options, java.lang.String xmlfile)
          Configures the current windows and its actions in the typical KDE fashion.
 void setupToolbarMenuActions()
           
protected  void setXML(java.lang.String document)
           
protected  void setXML(java.lang.String document, boolean merge)
          Sets the XML for the part.
protected  void setXMLFile(java.lang.String file)
           
protected  void setXMLFile(java.lang.String file, boolean merge)
           
protected  void setXMLFile(java.lang.String file, boolean merge, boolean setXMLDoc)
          Sets the name of the rc file containing the XML for the part.
 void setXMLGUIBuildDocument(org.kde.qt.QDomDocument doc)
           
 void show()
          Reimplementation of QMainWindow.show()
protected  void showAboutApplication()
          This slot does nothing.
 void slotStateChanged(java.lang.String newstate)
          Apply a state change Enable and disable actions as defined in the XML rc file
 void slotStateChanged(java.lang.String newstate, int arg2)
          Apply a state change Enable and disable actions as defined in the XML rc file, can "reverse" the state (disable the actions which should be enabled, and vice-versa) if specified.
protected  void stateChanged(java.lang.String newstate)
           
protected  void stateChanged(java.lang.String newstate, int reverse)
          Actions can collectively be assigned a "State".
 KToolBar toolBar()
           
 KToolBar toolBar(java.lang.String name)
          Returns a pointer to the toolbar with the specified name.
 KAction toolBarMenuAction()
          Returns a pointer to the mainwindows action responsible for the toolbars menu
 void unplugActionList(java.lang.String name)
          The complement of plugActionList() ...
 org.kde.qt.QWidget widget()
           
 java.lang.String xmlFile()
          This will return the name of the XML file as set by setXMLFile().
 org.kde.qt.QDomDocument xmlguiBuildDocument()
           
 
Methods inherited from class org.kde.qt.QMainWindow
addDockWindow, addDockWindow, addDockWindow, addDockWindow, addDockWindow, addDockWindow, addToolBar, addToolBar, addToolBar, addToolBar, addToolBar, addToolBar, appropriate, bottomDock, centralWidget, createDockWindowMenu, createDockWindowMenu, customize, dockingArea, dockWindowsMovable, event, eventFilter, getLocation, hasDockWindow, isCustomizable, isDockEnabled, isDockEnabled, isDockEnabled, isDockEnabled, isDockMenuEnabled, leftDock, lineUpDockWindows, lineUpDockWindows, lineUpToolBars, lineUpToolBars, menuAboutToShow, menuBar, minimumSizeHint, moveDockWindow, moveDockWindow, moveDockWindow, moveDockWindow, moveToolBar, moveToolBar, moveToolBar, moveToolBar, opaqueMoving, removeDockWindow, removeToolBar, rightDock, rightJustification, setAppropriate, setCentralWidget, setDockEnabled, setDockEnabled, setDockMenuEnabled, setDockWindowsMovable, setOpaqueMoving, setRightJustification, setToolBarsMovable, setUpLayout, setUsesBigPixmaps, setUsesTextLabel, showDockMenu, sizeHint, statusBar, styleChange, toolBarsMovable, toolTipGroup, topDock, tr, tr, usesBigPixmaps, usesTextLabel, whatsThis
 
Methods inherited from class org.kde.qt.QWidget
acceptDrops, adjustSize, autoMask, backgroundBrush, backgroundColor, backgroundMode, backgroundOffset, backgroundOrigin, backgroundPixmap, baseSize, caption, childAt, childAt, childAt, childAt, childrenRect, childrenRegion, clearFocus, clearMask, clearWFlags, clearWState, clipRegion, close, close, colorGroup, constPolish, contextMenuEvent, create, create, create, create, cursor, customWhatsThis, destroy, destroy, destroy, devType, dragEnterEvent, dragLeaveEvent, dragMoveEvent, drawText, drawText, dropEvent, enabledChange, enterEvent, erase, erase, erase, erase, eraseColor, erasePixmap, find, focusData, focusInEvent, focusNextPrevChild, focusOutEvent, focusPolicy, focusProxy, focusWidget, font, fontChange, fontInf, fontInfo, fontMet, fontMet, fontMet, fontMetrics, foregroundColor, frameGeometry, frameSize, geometry, getWFlags, getWState, grabKeyboard, grabMouse, grabMouse, hasFocus, hasMouse, hasMouseTracking, height, heightForWidth, hideEvent, icon, iconify, iconText, imComposeEvent, imEndEvent, imStartEvent, isActiveWindow, isDesktop, isDialog, isEnabled, isEnabledTo, isEnabledToTLW, isExtDev, isFocusEnabled, isFullScreen, isHidden, isInputMethodEnabled, isMaximized, isMinimized, isModal, isPopup, isShown, isTopLevel, isUpdatesEnabled, isVisible, isVisibleTo, isVisibleToTLW, keyboardGrabber, keyPressEvent, keyReleaseEvent, layout, leaveEvent, lower, mapFrom, mapFromGlobal, mapFromParent, mapTo, mapToGlobal, mapToParent, maximumHeight, maximumSize, maximumWidth, metric, microFocusHint, minimumHeight, minimumSize, minimumWidth, mouseDoubleClickEvent, mouseGrabber, mouseMoveEvent, mousePressEvent, mouseReleaseEvent, move, move, moveEvent, ownCursor, ownFont, ownPalette, paintDevice, paintingActive, palette, paletteBackgroundColor, paletteBackgroundPixmap, paletteChange, paletteForegroundColor, parentWidget, parentWidget, polish, pos, raise, recreate, recreate, rect, releaseKeyboard, releaseMouse, repaint, repaint, repaint, repaint, repaint, repaint, repaint, repaint, reparent, reparent, reparent, reparent, resetInputContext, resize, resize, resolution, scroll, scroll, setAcceptDrops, setActiveWindow, setAutoMask, setBackgroundColor, setBackgroundMode, setBackgroundMode, setBackgroundOrigin, setBackgroundPixmap, setBaseSize, setBaseSize, setCursor, setDisabled, setEnabled, setEraseColor, setErasePixmap, setFixedHeight, setFixedSize, setFixedSize, setFixedWidth, setFocus, setFocusPolicy, setFocusProxy, setFont, setFont, setGeometry, setGeometry, setHidden, setIconText, setInputMethodEnabled, setKeyCompression, setMask, setMask, setMaximumHeight, setMaximumSize, setMaximumSize, setMaximumWidth, setMicroFocusHint, setMicroFocusHint, setMicroFocusHint, setMinimumHeight, setMinimumSize, setMinimumSize, setMinimumWidth, setMouseTracking, setName, setPalette, setPalette, setPaletteBackgroundColor, setPaletteBackgroundPixmap, setPaletteForegroundColor, setResolution, setShown, setSizeIncrement, setSizeIncrement, setSizePolicy, setSizePolicy, setSizePolicy, setStyle, setStyle, setTabOrder, setUpdatesEnabled, setWFlags, setWindowOpacity, setWindowState, setWState, showEvent, showFullScreen, showMaximized, showMinimized, showNormal, size, sizeIncrement, sizePolicy, stackUnder, style, tabletEvent, testWFlags, testWState, topLevelWidget, unsetCursor, unsetFont, unsetPalette, update, update, update, updateGeometry, updateMask, visibleRect, wheelEvent, width, windowActivationChange, windowOpacity, windowState, winId, x, y
 
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, 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, highPriority, i18n, inherits, insertChild, installEventFilter, isA, isWidgetType, killTimer, killTimers, name, name, normalizeSignalSlot, objectTrees, parent, property, queryList, queryList, queryList, queryList, queryList, registerUserData, removeChild, removeEventFilter, sender, setProperty, signalsBlocked, startTimer, timerEvent
 
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

NoDCOPObject

public static final int NoDCOPObject
Flags that can be passed in an argument to the constructor to change the behavior. NoDCOPObject tells KMainWindow not to create a KMainWindowInterface. This can be useful in particular for inherited classes, which might want to create more specific dcop interfaces. It's a good idea to use KMainWindowInterface as the base class for such interfaces though (to provide the standard mainwindow functionality via DCOP).

See Also:
Constant Field Values

ToolBar

public static final int ToolBar
See Also:
setupGUI(int, java.lang.String), Constant Field Values

Keys

public static final int Keys
See Also:
Constant Field Values

StatusBar

public static final int StatusBar
See Also:
Constant Field Values

Save

public static final int Save
See Also:
Constant Field Values

Create

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

KMainWindow

protected KMainWindow(java.lang.Class dummy)

KMainWindow

public KMainWindow(org.kde.qt.QWidget parent,
                   java.lang.String name,
                   int f)
Construct a main window.

Parameters:
parent - The widget parent. This is usually 0 but it may also be the window group leader. In that case, the KMainWindow becomes sort of a secondary window.
name - The object name. For session management and window management to work properly, all main windows in the application should have a different name. When passing 0 (the default), KMainWindow will create a unique name, but it's recommended to explicitly pass a window name that will also describe the type of the window. If there can be several windows of the same type, append '#' (hash) to the name, and KMainWindow will append numbers to make the names unique. For example, for a mail client which has one main window showing the mails and folders, and which can also have one or more windows for composing mails, the name for the folders window should be e.g. "mainwindow" and for the composer windows "composer#".
f - Specify the widget flags. The default is WType_TopLevel and WDestructiveClose. TopLevel indicates that a main window is a toplevel window, regardless of whether it has a parent or not. DestructiveClose indicates that a main window is automatically destroyed when its window is closed. Pass 0 if you do not want this behavior. KMainWindows must be created on the heap with 'new', like:
                 KMainWindow kmw = new KMainWindow (...);
                 
See Also:
#http://doc#trolltech#com/3#2/qt#html#WidgetFlags-enum

KMainWindow

public KMainWindow(org.kde.qt.QWidget parent,
                   java.lang.String name)

KMainWindow

public KMainWindow(org.kde.qt.QWidget parent)

KMainWindow

public KMainWindow()

KMainWindow

public KMainWindow(int cflags,
                   org.kde.qt.QWidget parent,
                   java.lang.String name,
                   int f)
Overloaded constructor which allows passing some KMainWindow.CreationFlags.


KMainWindow

public KMainWindow(int cflags,
                   org.kde.qt.QWidget parent,
                   java.lang.String name)

KMainWindow

public KMainWindow(int cflags,
                   org.kde.qt.QWidget parent)

KMainWindow

public KMainWindow(int cflags)
Method Detail

metaObject

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

className

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

helpMenu

public KPopupMenu helpMenu(java.lang.String aboutAppText,
                           boolean showWhatsThis)
Retrieve the standard help menu. It contains entires for the help system (activated by F1), an optional "What's This?" entry (activated by Shift F1), an application specific dialog box, and an "About KDE" dialog box. Example (adding a standard help menu to your application):
                 KPopupMenu help = helpMenu(  );
                 menuBar().insertItem( i18n("&Help"), help );
                 

Parameters:
aboutAppText - The string that is used in the application specific dialog box. If you leave this string empty the information in the global KAboutData of the application will be used to make a standard dialog box.
showWhatsThis - Set this to false if you do not want to include the "What's This" menu entry.
Returns:
A standard help menu.

helpMenu

public KPopupMenu helpMenu(java.lang.String aboutAppText)

helpMenu

public KPopupMenu helpMenu()

customHelpMenu

public KPopupMenu customHelpMenu(boolean showWhatsThis)
Returns the help menu. Creates a standard help menu if none exists yet. It contains entries for the help system (activated by F1), an optional "What's This?" entry (activated by Shift F1), an application specific dialog box, and an "About KDE" dialog box. You must create the application specific dialog box yourself. When the "About application" menu entry is activated, a signal will trigger the showAboutApplication slot. See showAboutApplication for more information. Example (adding a help menu to your application):
                 menuBar().insertItem( i18n("&Help"), customHelpMenu() );
                 

Parameters:
showWhatsThis - Set this to false if you do not want to include the "What's This" menu entry.
Returns:
A standard help menu.

customHelpMenu

public KPopupMenu customHelpMenu()

show

public void show()
Reimplementation of QMainWindow.show()

Overrides:
show in class org.kde.qt.QMainWindow

hide

public void hide()
Reimplementation of QMainWindow.hide()

Overrides:
hide in class org.kde.qt.QMainWindow

restore

public boolean restore(int number,
                       boolean show)
Restore the session specified by number. Returns false if this fails, otherwise returns true and shows the window. You should call canBeRestored() first. If show is true (default), this widget will be shown automatically.


restore

public boolean restore(int number)

guiFactory

public KXMLGUIFactory guiFactory()

createGUI

public void createGUI(java.lang.String xmlfile,
                      boolean _conserveMemory)
Create a GUI given a local XML file. If xmlfile is NULL, then it will try to construct a local XML filename like appnameui.rc where 'appname' is your app's name. If that file does not exist, then the XML UI code will only use the global (standard) XML file for the layout purposes. Note that when passing true for the conserveMemory argument subsequent calls to guiFactory().addClient/removeClient may not work as expected. Also retrieving references to containers like popup menus or toolbars using the container method will not work.

Parameters:
xmlfile - The local xmlfile (relative or absolute)
_conserveMemory - Specify whether createGUI() should call KXMLGUIClient.conserveMemory() to free all memory allocated by the QDomDocument and by the KXMLGUIFactory.

createGUI

public void createGUI(java.lang.String xmlfile)

createGUI

public void createGUI()

setHelpMenuEnabled

public void setHelpMenuEnabled(boolean showHelpMenu)
Enables the build of a standard help menu when calling createGUI(). The default behavior is to build one, you must call this function to disable it


setHelpMenuEnabled

public void setHelpMenuEnabled()

isHelpMenuEnabled

public boolean isHelpMenuEnabled()
Return true when the help menu is enabled


hasMenuBar

public boolean hasMenuBar()
Returns true, if there is a menubar


kmenuBar

public KMenuBar kmenuBar()
Returns a pointer to the menu bar. If there is no menu bar yet one will be created.


kstatusBar

public KStatusBar kstatusBar()
Returns a pointer to the status bar. If there is no status bar yet, one will be created. Note that tooltips for kactions in actionCollection() are not automatically connected to this statusBar. See the KActionCollection documentation for more details.

See Also:
KActionCollection

toolBar

public KToolBar toolBar(java.lang.String name)
Returns a pointer to the toolbar with the specified name. This refers to toolbars created dynamically from the XML UI framework. If the toolbar does not exist one will be created.

Parameters:
name - The internal name of the toolbar. If no name is specified "mainToolBar" is assumed.
Returns:
A pointer to the toolbar

toolBar

public KToolBar toolBar()

accel

public KAccel accel()
Returns:
A KAccel instance bound to this mainwindow. Used automatically by KAction to make keybindings work in all cases.

setFrameBorderWidth

public void setFrameBorderWidth(int arg1)

setAutoSaveSettings

public void setAutoSaveSettings(java.lang.String groupName,
                                boolean saveWindowSize)
Call this to enable "auto-save" of toolbar/menubar/statusbar settings (and optionally window size). If the bars were moved around/shown/hidden when the window is closed, saveMainWindowSettings( KGlobal.config(), groupName ) will be called.

Parameters:
groupName - a name that identifies this "type of window". You can have several types of window in the same application.
saveWindowSize - set it to true to include the window size when saving. Typically, you will call setAutoSaveSettings() in your KMainWindow-inherited class constructor, and it will take care of restoring and saving automatically. Make sure you call this _after all_ your bars have been created. To make sure that KMainWindow propertly obtains the default size of the window you should do the following: - Remove hard coded resize() calls in the constructor or main, they should be removed in favor of letting the automatic resizing determine the default window size. Hard coded window sizes will be wrong for users that have big fonts, use different styles, long/small translations, large toolbars, and other factors. - Put the setAutoSaveSettings ( or setupGUI() ) call after all widgets have been created and placed inside the main window (i.e. for 99% of apps setCentralWidget()) - Widgets that inherit from QWidget (like game boards) should overload "QSize sizeHint() const;" to specify a default size rather than letting QWidget.adjust use the default size of 0x0.

setAutoSaveSettings

public void setAutoSaveSettings(java.lang.String groupName)

setAutoSaveSettings

public void setAutoSaveSettings()

resetAutoSaveSettings

public void resetAutoSaveSettings()
Disable the auto-save-settings feature. You don't normally need to call this, ever.


autoSaveSettings

public boolean autoSaveSettings()
Returns:
the current autosave setting, i.e. true if setAutoSaveSettings() was called, false by default or if resetAutoSaveSettings() was called.

autoSaveGroup

public java.lang.String autoSaveGroup()
Returns:
the group used for setting-autosaving. Only meaningful if setAutoSaveSettings() was called. This can be useful for forcing a save or an apply, e.g. before and after using KEditToolbar.

applyMainWindowSettings

public void applyMainWindowSettings(KConfig config,
                                    java.lang.String groupName,
                                    boolean force)
Read settings for statusbar, menubar and toolbar from their respective groups in the config file and apply them.

Parameters:
config - Config file to read the settings from.
groupName - Group name to use. If not specified, the last used group name is used.
force - if set, even default settings are re-applied

applyMainWindowSettings

public void applyMainWindowSettings(KConfig config,
                                    java.lang.String groupName)

applyMainWindowSettings

public void applyMainWindowSettings(KConfig config)

saveMainWindowSettings

public void saveMainWindowSettings(KConfig config,
                                   java.lang.String groupName)
Save settings for statusbar, menubar and toolbar to their respective groups in the config file config.

Parameters:
config - Config file to save the settings to.
groupName - Group name to use. If not specified, the last used group name is used

saveMainWindowSettings

public void saveMainWindowSettings(KConfig config)

setStandardToolBarMenuEnabled

public void setStandardToolBarMenuEnabled(boolean enable)
Sets whether KMainWindow should provide a menu that allows showing/hiding the available toolbars ( using KToggleToolBarAction ) . In case there is only one toolbar configured a simple 'Show \' menu item is shown. The menu / menu item is implemented using xmlgui. It will be inserted in your menu structure in the 'Settings' menu. If your application uses a non-standard xmlgui resource file then you can specify the exact position of the menu / menu item by adding a <Merge name="StandardToolBarMenuHandler" /> line to the settings menu section of your resource file ( usually appname.rc ). Note that you should enable this feature before calling createGUI() ( or similar ) . You enable/disable it anytime if you pass false to the conserveMemory argument of createGUI.


isStandardToolBarMenuEnabled

public boolean isStandardToolBarMenuEnabled()

createStandardStatusBarAction

public void createStandardStatusBarAction()
Sets whether KMainWindow should provide a menu that allows showing/hiding of the statusbar ( using KToggleStatusBarAction ). The menu / menu item is implemented using xmlgui. It will be inserted in your menu structure in the 'Settings' menu. Note that you should enable this feature before calling createGUI() ( or similar ). If an application maintains the action on its own (i.e. never calls this function) a connection needs to be made to let KMainWindow know when that status (hidden/shown) of the statusbar has changed. For example: connect(action, SIGNAL("activated()"), kmainwindow, SLOT("setSettingsDirty()")); Otherwise the status (hidden/show) of the statusbar might not be saved by KMainWindow.


setupGUI

public void setupGUI(int options,
                     java.lang.String xmlfile)
Configures the current windows and its actions in the typical KDE fashion. The options are all enabled by default but can be turned off if desired through the params or if the prereqs don't exists. Typically this function replaces createGUI().

See Also:
StandardWindowOptions

setupGUI

public void setupGUI(int options)

setupGUI

public void setupGUI()

setupGUI

public void setupGUI(org.kde.qt.QSize defaultSize,
                     int options,
                     java.lang.String xmlfile)
Configures the current windows and its actions in the typical KDE fashion. The options are all enabled by default but can be turned off if desired through the params or if the prereqs don't exists. defaultSize The default size of the window Typically this function replaces createGUI().

See Also:
StandardWindowOptions

setupGUI

public void setupGUI(org.kde.qt.QSize defaultSize,
                     int options)

setupGUI

public void setupGUI(org.kde.qt.QSize defaultSize)

toolBarMenuAction

public KAction toolBarMenuAction()
Returns a pointer to the mainwindows action responsible for the toolbars menu


setupToolbarMenuActions

public void setupToolbarMenuActions()

finalizeGUI

public void finalizeGUI(KXMLGUIClientInterface client)
Specified by:
finalizeGUI in interface KXMLGUIBuilderInterface

finalizeGUI

public void finalizeGUI(boolean force)

initialGeometrySet

public boolean initialGeometrySet()
Returns:
true if a -geometry argument was given on the command line, and this is the first window created (the one on which this option applies)

ignoreInitialGeometry

public void ignoreInitialGeometry()
Used from Konqueror when reusing the main window.


setIcon

public void setIcon(org.kde.qt.QPixmap arg1)
Overrides:
setIcon in class org.kde.qt.QWidget

configureToolbars

public int configureToolbars()
Show a standard configure toolbar dialog. This slot can be connected dirrectly to the action to configure shortcuts. This is very simple to do that by adding a single line
                 KStdAction.configureToolbars( guiFactory(), SLOT("configureToolbars()"),
                                                actionCollection() );
                 


setCaption

public void setCaption(java.lang.String caption)
Makes a KDE compliant caption.

Overrides:
setCaption in class org.kde.qt.QWidget
Parameters:
caption - Your caption. Do not include the application name in this string. It will be added automatically according to the KDE standard.

setCaption

public void setCaption(java.lang.String caption,
                       boolean modified)
Makes a KDE compliant caption.

Parameters:
caption - Your caption. Do not include the application name in this string. It will be added automatically according to the KDE standard.
modified - Specify whether the document is modified. This displays an additional sign in the title bar, usually "**".

setPlainCaption

public void setPlainCaption(java.lang.String caption)
Make a plain caption without any modifications.

Parameters:
caption - Your caption. This is the string that will be displayed in the window title.

appHelpActivated

public void appHelpActivated()
Open the help page for the application. The application name is used as a key to determine what to display and the system will attempt to open \/index.html. This method is intended for use by a help button in the toolbar or components outside the regular help menu. Use helpMenu() when you want to provide access to the help system from the help menu. Example (adding a help button to the first toolbar):
                 KIconLoader &loader = KGlobal.iconLoader();
                 QPixmap pixmap = loader.loadIcon( "help" );
                 toolBar(0).insertButton( pixmap, 0, SIGNAL("clicked()"),
                   this, SLOT("appHelpActivated()"), true, i18n("Help") );
                 


slotStateChanged

public void slotStateChanged(java.lang.String newstate)
Apply a state change Enable and disable actions as defined in the XML rc file


slotStateChanged

public void slotStateChanged(java.lang.String newstate,
                             int arg2)
Apply a state change Enable and disable actions as defined in the XML rc file, can "reverse" the state (disable the actions which should be enabled, and vice-versa) if specified.


setSettingsDirty

public void setSettingsDirty()
Tell the main window that it should save its settings when being closed. This is part of the auto-save-settings feature. For everything related to toolbars this happens automatically, but you have to call setSettingsDirty() in the slot that toggles the visibility of the statusbar.


canBeRestored

public static boolean canBeRestored(int number)
Session Management Try to restore the toplevel widget as defined by the number (1..X). If the session did not contain so high a number, the configuration is not changed and false returned. That means clients could simply do the following:
                 if (kapp.isRestored()){
                   int n = 1;
                   while (KMainWindow.canBeRestored(n)){
                     (new childMW).restore(n);
                     n++;
                   }
                 } else {
                   // create default application as usual
                 }
                 
Note that QWidget.show() is called implicitly in restore. With this you can easily restore all toplevel windows of your application. If your application uses different kinds of toplevel windows, then you can use KMainWindow.classNameOfToplevel(n) to determine the exact type before calling the childMW constructor in the example from above. If your client has only one kind of toplevel widgets (which should be pretty usual) then you should use the RESTORE-macro for backwards compatibility with 3.1 and 3.0 branches:
                 if (kapp.isRestored())
                   RESTORE(childMW)
                 else {
                   // create default application as usual
                 }
                 
The macro expands to the term above but is easier to use and less code to write. For new code or if you have more than one kind of toplevel widget (each derived from KMainWindow, of course), you can use the templated kRestoreMainWindows global functions:
                 if (kapp.isRestored())
                   kRestoreMainWindows< childMW1, childMW2, childMW3 >();
                 else {
                   // create default application as usual
                 }
                 
Currently, these functions are provided for up to three template arguments. If you need more, tell us. To help you in deciding whether or not you can use kRestoreMainWindows, a define KDE_RESTORE_MAIN_WINDOWS_NUM_TEMPLATE_ARGS is provided.

See Also:
restore(int, boolean), classNameOfToplevel(int)

classNameOfToplevel

public static java.lang.String classNameOfToplevel(int number)
Returns the className() of the number of the toplevel window which should be restored. This is only useful if your application uses different kinds of toplevel windows.


paintEvent

protected void paintEvent(org.kde.qt.QPaintEvent e)
List of members of KMainWindow class.

Overrides:
paintEvent in class org.kde.qt.QMainWindow

childEvent

protected void childEvent(org.kde.qt.QChildEvent e)
Overrides:
childEvent in class org.kde.qt.QMainWindow

resizeEvent

protected void resizeEvent(org.kde.qt.QResizeEvent e)
Overrides:
resizeEvent in class org.kde.qt.QWidget

closeEvent

protected void closeEvent(org.kde.qt.QCloseEvent arg1)
Reimplemented to call the queryClose() and queryExit() handlers. We recommend that you reimplement the handlers rather than closeEvent(). If you do it anyway, ensure to call the base implementation to keep queryExit() running.

Overrides:
closeEvent in class org.kde.qt.QWidget

queryExit

protected boolean queryExit()
Called before the very last window is closed, either by the user or indirectly by the session manager. It is not recommended to do any user interaction in this function other than indicating severe errors. Better ask the user on queryClose() (see below). A typical usage of queryExit() is to write configuration data back. Note that the application may continue to run after queryExit() (the user may have canceled a shutdown), so you should not do any cleanups here. The purpose of queryExit() is purely to prepare the application (with possible user interaction) so it can safely be closed later (without user interaction). If you need to do serious things on exit (like shutting a dial-up connection down), connect to the signal KApplication.shutDown(). Default implementation returns true. Returning false will cancel the exiting. In the latter case, the last window will remain visible. If KApplication.sessionSaving() is true, refusing the exit will also cancel KDE logout.

See Also:
queryClose(), KApplication.sessionSaving()

queryClose

protected boolean queryClose()
Called before the window is closed, either by the user or indirectly by the session manager. The purpose of this function is to prepare the window in a way that it is safe to close it, i.e. without the user losing some data. Default implementation returns true. Returning false will cancel the closing, and, if KApplication.sessionSaving() is true, it will also cancel KDE logout. Reimplement this function to prevent the user from losing data. Example:
                       switch ( KMessageBox.warningYesNoCancel( this,
                                i18n("Save changes to document foo?")) ) {
                       case KMessageBox.Yes :
                         // save document here. If saving fails, return false;
                         return true;
                       case KMessageBox.No :
                         return true;
                       default: // cancel
                         return false;
                       
Note that you should probably not actually close the document from within this method, as it may be called by the session manager before the session is saved. If the document is closed before the session save occurs, its location might not be properly saved. In addition, the session shutdown may be canceled, in which case the document should remain open.

See Also:
queryExit(), KApplication.sessionSaving()

saveProperties

protected void saveProperties(KConfig arg1)
Save your instance-specific properties. The function is invoked when the session manager requests your application to save its state. You must not change the group of the kconfig object, since KMainWindow uses one group for each window. Please reimplement these function in childclasses. Note: No user interaction is allowed in this function!


readProperties

protected void readProperties(KConfig arg1)
Read your instance-specific properties.


saveGlobalProperties

protected void saveGlobalProperties(KConfig sessionConfig)
Save your application-wide properties. The function is invoked when the session manager requests your application to save its state. This function is similar to saveProperties() but is only called for the very first main window, regardless how many main window are open. Override it if you need to save other data about your documents on session end. sessionConfig is a config to which that data should be saved. Normally, you don't need this function. But if you want to save data about your documents that are not in opened windows you might need it. Default implementation does nothing.


readGlobalProperties

protected void readGlobalProperties(KConfig sessionConfig)
The counterpart of saveGlobalProperties(). Read the application-specific properties in again.


savePropertiesInternal

protected void savePropertiesInternal(KConfig arg1,
                                      int arg2)

readPropertiesInternal

protected boolean readPropertiesInternal(KConfig arg1,
                                         int arg2)

settingsDirty

protected boolean settingsDirty()
For inherited classes


settingsGroup

protected java.lang.String settingsGroup()
For inherited classes


saveWindowSize

protected void saveWindowSize(KConfig config)
For inherited classes Note that the group must be set before calling


restoreWindowSize

protected void restoreWindowSize(KConfig config)
For inherited classes Note that the group must be set before calling, and that a -geometry on the command line has priority.


parseGeometry

protected void parseGeometry(boolean parsewidth)

saveNewToolbarConfig

protected void saveNewToolbarConfig()
Rebuilds the GUI after KEditToolbar changed the toolbar layout.

See Also:
configureToolbars()

showAboutApplication

protected void showAboutApplication()
This slot does nothing. It must be reimplemented if you want to use a custom About Application dialog box. This slot is connected to the About Application entry in the menu returned by customHelpMenu. Example:
                         void MyMainLevel.setupInterface()
                 {
                   ..
                   menuBar().insertItem( i18n("&Help"), customHelpMenu() );
                   ..
                 }
                         void MyMainLevel.showAboutApplication()
                 {
                   
                 }
                 


saveAutoSaveSettings

protected void saveAutoSaveSettings()
This slot should only be called in case you reimplement closeEvent() and if you are using the "auto-save" feature. In all other cases, setSettingsDirty() should be called instead to benefit from the delayed saving. Example:
                         void MyMainWindow.closeEvent( QCloseEvent e )
                 {
                   // Save settings if auto-save is enabled, and settings have changed
                   if ( settingsDirty() && autoSaveSettings() )
                     saveAutoSaveSettings();
                   ..
                 }
                 

See Also:
setAutoSaveSettings(java.lang.String, boolean), setSettingsDirty()

finalize

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

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

dispose

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

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

isDisposed

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

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

builderClient

public KXMLGUIClientInterface builderClient()
Specified by:
builderClient in interface KXMLGUIBuilderInterface

setBuilderClient

public void setBuilderClient(KXMLGUIClientInterface client)
Specified by:
setBuilderClient in interface KXMLGUIBuilderInterface

builderInstance

public KInstanceInterface builderInstance()
Specified by:
builderInstance in interface KXMLGUIBuilderInterface

setBuilderInstance

public void setBuilderInstance(KInstanceInterface instance)
Specified by:
setBuilderInstance in interface KXMLGUIBuilderInterface

widget

public org.kde.qt.QWidget widget()
Specified by:
widget in interface KXMLGUIBuilderInterface

containerTags

public java.util.ArrayList containerTags()
Specified by:
containerTags in interface KXMLGUIBuilderInterface

createContainer

public org.kde.qt.QWidget createContainer(org.kde.qt.QWidget parent,
                                          int index,
                                          org.kde.qt.QDomElement element,
                                          int[] id)
Creates a container (menubar/menu/toolbar/statusbar/separator/...) from an element in the XML file

Specified by:
createContainer in interface KXMLGUIBuilderInterface
Parameters:
parent - The parent for the container
index - The index where the container should be inserted into the parent container/widget
element - The element from the DOM tree describing the container (use it to access container specified attributes or child elements)
id - The id to be used for this container

removeContainer

public void removeContainer(org.kde.qt.QWidget container,
                            org.kde.qt.QWidget parent,
                            org.kde.qt.QDomElement element,
                            int id)
Removes the given (and previously via createContainer ) created container.

Specified by:
removeContainer in interface KXMLGUIBuilderInterface

customTags

public java.util.ArrayList customTags()
Specified by:
customTags in interface KXMLGUIBuilderInterface

createCustomElement

public int createCustomElement(org.kde.qt.QWidget parent,
                               int index,
                               org.kde.qt.QDomElement element)
Specified by:
createCustomElement in interface KXMLGUIBuilderInterface

removeCustomElement

public void removeCustomElement(org.kde.qt.QWidget parent,
                                int id)
Specified by:
removeCustomElement in interface KXMLGUIBuilderInterface

action

public KAction action(java.lang.String name)
Retrieves an action of the client by name. If not found, it looks in its child clients. This method is provided for convenience, as it uses actionCollection() to get the action object.

Specified by:
action in interface KXMLGUIClientInterface

action

public KAction action(org.kde.qt.QDomElement element)
Retrieves an action for a given QDomElement. The default implementation uses the "name" attribute to query the action object via the other action() method.

Specified by:
action in interface KXMLGUIClientInterface

actionCollection

public KActionCollection actionCollection()
Retrieves the entire action collection for the GUI client. If you subclass KXMLGUIClient you should call KActionCollection.setWidget( QWidget ) with this object, or you will encounter subtle bugs with KAction keyboard shortcuts. This is not necessary if your KXMLGUIClient is a KMainWindow.

Specified by:
actionCollection in interface KXMLGUIClientInterface
See Also:
KActionCollection#setWidget(, org.kde.qt.QWidget*

instance

public KInstanceInterface instance()
Specified by:
instance in interface KXMLGUIClientInterface
Returns:
The instance ( KInstance ) for this GUI client.

domDocument

public org.kde.qt.QDomDocument domDocument()
Specified by:
domDocument in interface KXMLGUIClientInterface
Returns:
The parsed XML in a QDomDocument, set by setXMLFile() or setXML(). This document describes the layout of the GUI.

xmlFile

public java.lang.String xmlFile()
This will return the name of the XML file as set by setXMLFile(). If setXML() is used directly, then this will return NULL. The filename that this returns is obvious for components as each component has exactly one XML file. In non-components, however, there are usually two: the global file and the local file. This function doesn't really care about that, though. It will always return the last XML file set. This, in almost all cases, will be the local XML file.

Specified by:
xmlFile in interface KXMLGUIClientInterface
Returns:
The name of the XML file or null

localXMLFile

public java.lang.String localXMLFile()
Specified by:
localXMLFile in interface KXMLGUIClientInterface

setXMLGUIBuildDocument

public void setXMLGUIBuildDocument(org.kde.qt.QDomDocument doc)
Specified by:
setXMLGUIBuildDocument in interface KXMLGUIClientInterface

xmlguiBuildDocument

public org.kde.qt.QDomDocument xmlguiBuildDocument()
Specified by:
xmlguiBuildDocument in interface KXMLGUIClientInterface

setFactory

public void setFactory(KXMLGUIFactory factory)
This method is called by the KXMLGUIFactory as soon as the client is added to the KXMLGUIFactory's GUI.

Specified by:
setFactory in interface KXMLGUIClientInterface

factory

public KXMLGUIFactory factory()
Retrieves a pointer to the KXMLGUIFactory this client is associated with (will return null if the client's GUI has not been built by a KXMLGUIFactory.

Specified by:
factory in interface KXMLGUIClientInterface

parentClient

public KXMLGUIClientInterface parentClient()
KXMLGUIClients can form a simple child/parent object tree. This method returns a pointer to the parent client or null if it has no parent client assigned.

Specified by:
parentClient in interface KXMLGUIClientInterface

insertChildClient

public void insertChildClient(KXMLGUIClientInterface child)
Use this method to make a client a child client of another client. Usually you don't need to call this method, as it is called automatically when using the second constructor, which takes a parent argument.

Specified by:
insertChildClient in interface KXMLGUIClientInterface

removeChildClient

public void removeChildClient(KXMLGUIClientInterface child)
Removes the given child from the client's children list.

Specified by:
removeChildClient in interface KXMLGUIClientInterface

setClientBuilder

public void setClientBuilder(KXMLGUIBuilderInterface builder)
A client can have an own KXMLGUIBuilder. Use this method to assign your builder instance to the client (so that the KXMLGUIFactory can use it when building the client's GUI) Client specific guibuilders are useful if you want to create custom container widgets for your GUI.

Specified by:
setClientBuilder in interface KXMLGUIClientInterface

clientBuilder

public KXMLGUIBuilderInterface clientBuilder()
Retrieves the client's GUI builder or null if no client specific builder has been assigned via setClientBuilder()

Specified by:
clientBuilder in interface KXMLGUIClientInterface

reloadXML

public void reloadXML()
Forces this client to re-read its XML resource file. This is intended to be used when you know that the resource file has changed and you will soon be rebuilding the GUI. It has no useful effect with non-KParts GUIs, so don't bother using it unless your app is component based.

Specified by:
reloadXML in interface KXMLGUIClientInterface

unplugActionList

public void unplugActionList(java.lang.String name)
The complement of plugActionList() ...

Specified by:
unplugActionList in interface KXMLGUIClientInterface

addStateActionEnabled

public void addStateActionEnabled(java.lang.String state,
                                  java.lang.String action)
Specified by:
addStateActionEnabled in interface KXMLGUIClientInterface

addStateActionDisabled

public void addStateActionDisabled(java.lang.String state,
                                   java.lang.String action)
Specified by:
addStateActionDisabled in interface KXMLGUIClientInterface

beginXMLPlug

public void beginXMLPlug(org.kde.qt.QWidget arg1)
Specified by:
beginXMLPlug in interface KXMLGUIClientInterface

endXMLPlug

public void endXMLPlug()
Specified by:
endXMLPlug in interface KXMLGUIClientInterface

prepareXMLUnplug

public void prepareXMLUnplug(org.kde.qt.QWidget arg1)
Specified by:
prepareXMLUnplug in interface KXMLGUIClientInterface

findMostRecentXMLFile

public static java.lang.String findMostRecentXMLFile(java.lang.String[] files,
                                                     java.lang.StringBuffer doc)

setInstance

protected void setInstance(KInstanceInterface instance)
Sets the instance ( KInstance) for this part. Call this first in the inherited class constructor. (At least before setXMLFile().)


setXMLFile

protected void setXMLFile(java.lang.String file,
                          boolean merge,
                          boolean setXMLDoc)
Sets the name of the rc file containing the XML for the part. Call this in the Part-inherited class constructor.

Parameters:
file - Either an absolute path for the file, or simply the filename, which will then be assumed to be installed in the "data" resource, under a directory named like the instance.
merge - Whether to merge with the global document.
setXMLDoc - Specify whether to call setXML. Default is true. and the DOM document at once.

setXMLFile

protected void setXMLFile(java.lang.String file,
                          boolean merge)

setXMLFile

protected void setXMLFile(java.lang.String file)

setLocalXMLFile

protected void setLocalXMLFile(java.lang.String file)

setXML

protected void setXML(java.lang.String document,
                      boolean merge)
Sets the XML for the part. Call this in the Part-inherited class constructor if you don't call setXMLFile().


setXML

protected void setXML(java.lang.String document)

setDOMDocument

protected void setDOMDocument(org.kde.qt.QDomDocument document,
                              boolean merge)
Sets the Document for the part, describing the layout of the GUI. Call this in the Part-inherited class constructor if you don't call setXMLFile or setXML .


setDOMDocument

protected void setDOMDocument(org.kde.qt.QDomDocument document)

conserveMemory

protected void conserveMemory()
This function will attempt to give up some memory after the GUI is built. It should never be used in apps where the GUI may be rebuilt at some later time (components, for instance).


stateChanged

protected void stateChanged(java.lang.String newstate,
                            int reverse)
Actions can collectively be assigned a "State". To accomplish this the respective actions are tagged as \ or \ in a \ \ group of the XMLfile. During program execution the programmer can call stateChanged() to set actions to a defined state.

Parameters:
newstate - Name of a State in the XMLfile.
reverse - If the flag reverse is set to StateReverse, the State is reversed. (actions to be enabled will be disabled and action to be disabled will be enabled) Default is reverse=false.

stateChanged

protected void stateChanged(java.lang.String newstate)

memberList

public java.util.ArrayList memberList()
List of members of KMainWindow class.


RESTORE

public static void RESTORE(java.lang.String typeName)