TDE core libraries
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mainwindow.h 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /* This file is part of the KDE project
  2. Copyright (C) 1999 Simon Hausmann <hausmann@kde.org>
  3. (C) 1999 David Faure <faure@kde.org>
  4. This library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public
  6. License as published by the Free Software Foundation; either
  7. version 2 of the License, or (at your option) any later version.
  8. This library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Library General Public License for more details.
  12. You should have received a copy of the GNU Library General Public License
  13. along with this library; see the file COPYING.LIB. If not, write to
  14. the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  15. Boston, MA 02110-1301, USA.
  16. */
  17. #ifndef __MAINWINDOW_H
  18. #define __MAINWINDOW_H
  19. #include <tqptrlist.h>
  20. #include <tdeaction.h>
  21. #include <tdemainwindow.h>
  22. #include <tdeparts/part.h>
  23. class TQString;
  24. namespace KParts
  25. {
  26. class MainWindowPrivate;
  27. /**
  28. * A KPart-aware main window, whose user interface is described in XML.
  29. *
  30. * Inherit your main window from this class
  31. * and don't forget to call setXMLFile() in the inherited constructor.
  32. *
  33. * It implements all internal interfaces in the case of a
  34. * TDEMainWindow as host: the builder and servant interface (for menu
  35. * merging).
  36. */
  37. class TDEPARTS_EXPORT MainWindow : public TDEMainWindow, virtual public PartBase
  38. {
  39. Q_OBJECT
  40. public:
  41. /**
  42. * Constructor, same signature as TDEMainWindow.
  43. */
  44. #ifdef qdoc
  45. MainWindow( TQWidget* parent, const char *name = 0L, WFlags f = WType_TopLevel | WDestructiveClose );
  46. #else
  47. MainWindow( TQWidget* parent, const char *name = 0L, WFlags f = (WFlags)(WType_TopLevel | WDestructiveClose) );
  48. #endif
  49. /**
  50. * Compatibility Constructor
  51. */
  52. #ifdef qdoc
  53. MainWindow( const char *name = 0L, WFlags f = WDestructiveClose );
  54. #else
  55. MainWindow( const char *name = 0L, WFlags f = (WFlags)WDestructiveClose );
  56. #endif
  57. /**
  58. * Constructor with creation flags, see TDEMainWindow.
  59. * @since 3.2
  60. */
  61. #ifdef qdoc
  62. MainWindow( int cflags, TQWidget* parent, const char *name = 0L, WFlags f = WType_TopLevel | WDestructiveClose );
  63. #else
  64. MainWindow( int cflags, TQWidget* parent, const char *name = 0L, WFlags f = (WFlags)(WType_TopLevel | WDestructiveClose) );
  65. #endif
  66. /**
  67. * Destructor.
  68. */
  69. virtual ~MainWindow();
  70. protected slots:
  71. /**
  72. * Create the GUI (by merging the host's and the active part's)
  73. * You _must_ call this in order to see any GUI being created.
  74. *
  75. * In a main window with multiple parts being shown (e.g. as in Konqueror)
  76. * you need to connect this slot to the
  77. * KPartManager::activePartChanged() signal
  78. *
  79. * @param part The active part (set to 0L if no part).
  80. */
  81. void createGUI( KParts::Part * part );
  82. /**
  83. * Called when the active part wants to change the statusbar message
  84. * Reimplement if your mainwindow has a complex statusbar
  85. * (with several items)
  86. */
  87. virtual void slotSetStatusBarText( const TQString & );
  88. /**
  89. * Rebuilds the GUI after KEditToolbar changed the toolbar layout.
  90. * @see configureToolbars()
  91. * KDE4: make this virtual. (For now we rely on the fact that it's called
  92. * as a slot, so the metaobject finds it here).
  93. */
  94. void saveNewToolbarConfig();
  95. protected:
  96. virtual void createShellGUI( bool create = true );
  97. private:
  98. MainWindowPrivate *d;
  99. };
  100. }
  101. #endif