• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

Konsole

MainWindow.h

Go to the documentation of this file.
00001 /*
00002     Copyright 2006-2008 by Robert Knight <robertknight@gmail.com>
00003 
00004     This program is free software; you can redistribute it and/or modify
00005     it under the terms of the GNU General Public License as published by
00006     the Free Software Foundation; either version 2 of the License, or
00007     (at your option) any later version.
00008 
00009     This program is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012     GNU General Public License for more details.
00013 
00014     You should have received a copy of the GNU General Public License
00015     along with this program; if not, write to the Free Software
00016     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017     02110-1301  USA.
00018 */
00019 
00020 #ifndef KONSOLEMAINWINDOW_H
00021 #define KONSOLEMAINWINDOW_H
00022 
00023 // Qt
00024 #include <QtCore/QPointer>
00025 
00026 // KDE
00027 #include <KXmlGuiWindow>
00028 #include <KUrl>
00029 
00030 // Local
00031 #include "Profile.h"
00032 
00033 class KToggleAction;
00034 
00035 namespace Konsole
00036 {
00037 
00038 class IncrementalSearchBar;
00039 class ViewManager;
00040 class ViewProperties;
00041 class SessionController;
00042 class ProfileList;
00043 class BookmarkHandler;
00044 
00055 class MainWindow : public KXmlGuiWindow
00056 {
00057     Q_OBJECT
00058 
00059     public:
00064         MainWindow();
00065 
00070         ViewManager* viewManager() const;
00071 
00076         IncrementalSearchBar* searchBar() const;
00077 
00079         void setSessionList(ProfileList* list);
00080 
00084         BookmarkHandler* bookmarkHandler() const;
00085 
00092         void setDefaultProfile(Profile::Ptr profile);
00093 
00098         Profile::Ptr defaultProfile() const;
00099 
00100         
00101     signals:
00110         void newSessionRequest(Profile::Ptr profile,
00111                                const QString& directory,
00112                                ViewManager* view);
00113 
00124         void newWindowRequest(Profile::Ptr profile,
00125                               const QString& directory);
00126 
00130         void closeActiveSessionRequest();
00131 
00132     protected:
00133         // reimplemented from KMainWindow
00134         virtual bool queryClose();
00135         virtual void saveProperties(KConfigGroup& group);
00136         virtual void readProperties(const KConfigGroup& group);
00137         virtual void saveGlobalProperties(KConfig* config);
00138         virtual void readGlobalProperties(KConfig* config);
00139 
00140     private slots:
00141         void newTab();
00142         void newWindow();
00143         void showManageProfilesDialog();
00144         void showRemoteConnectionDialog();
00145         void showShortcutsDialog();
00146         void newFromProfile(Profile::Ptr profile);
00147         void activeViewChanged(SessionController* controller);
00148         void activeViewTitleChanged(ViewProperties*);
00149 
00150         void sessionListChanged(const QList<QAction*>& actions);
00151         void viewFullScreen(bool fullScreen);
00152         void configureNotifications();
00153 
00154         // single shot call to set the visibility of the menu bar.  Has no 
00155         // effect if the menu bar is a MacOS-style top-level menu
00156         void setMenuBarVisibleOnce(bool visible);
00157 
00158         void openUrls(const QList<KUrl>& urls);
00159 
00160     private:
00161         void correctShortcuts();
00162         void removeMenuAccelerators();
00163         void setupActions();
00164         void setupWidgets();
00165         QString activeSessionDir() const;
00166         void disconnectController(SessionController* controller);
00167 
00168         // sets the active shortcuts of actions in 'dest' to the shortcuts of actions
00169         // with the same name in 'source' (see KAction::ActiveShortcut)
00170         static void syncActiveShortcuts(KActionCollection* dest, const KActionCollection* source);
00171 
00172     private:
00173         ViewManager*  _viewManager;
00174         BookmarkHandler* _bookmarkHandler;
00175         KToggleAction* _toggleMenuBarAction;
00176 
00177         QPointer<SessionController> _pluggedController;
00178 
00179         Profile::Ptr _defaultProfile;
00180         bool _menuBarVisibilitySet;
00181 };
00182 
00183 }
00184 
00185 #endif // KONSOLEMAINWINDOW_H
00186 
00187 /*
00188   Local Variables:
00189   mode: c++
00190   c-file-style: "stroustrup"
00191   indent-tabs-mode: nil
00192   tab-width: 4
00193   End:
00194 */

Konsole

Skip menu "Konsole"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • Konsole
  • Libraries
  •   libkonq
Generated for API Reference by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal