mainwindow_p.h 4.13 KB
Newer Older
1
/* This file is part of the KDevelop project
2 3 4 5
Copyright 2002 Falk Brettschneider <falkbr@kdevelop.org>
Copyright 2003 John Firebaugh <jfirebaugh@kde.org>
Copyright 2006 Adam Treat <treat@kde.org>
Copyright 2006, 2007 Alexander Dymo <adymo@kdevelop.org>
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Library General Public License for more details.

You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB.  If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
22 23
#ifndef KDEVPLATFORM_MAINWINDOW_PRIVATE_H
#define KDEVPLATFORM_MAINWINDOW_PRIVATE_H
24 25 26

#include <QObject>
#include <QPointer>
27
#include <QWidget>
Tomaz  Canabrava's avatar
Tomaz Canabrava committed
28
#include <QMap>
29 30
#include <KXMLGUIClient>

31
#include <language/util/navigationtooltip.h>
32 33

class KActionCollection;
34
class QMenu;
35 36 37

namespace Sublime {
class View;
38
class Container;
39 40 41 42 43 44
}

namespace KParts {
class Part;
}

45 46 47 48
namespace KTextEditor {
class View;
}

49 50 51 52
namespace KTextEditorIntegration {
class MainWindow;
}

53 54 55 56
namespace KDevelop {

class IPlugin;
class MainWindow;
57
class StatusBar;
58 59 60 61

class MainWindowPrivate: public QObject {
    Q_OBJECT
public:
62
    explicit MainWindowPrivate(MainWindow *mainWindow);
63
    ~MainWindowPrivate() override;
64 65

    QPointer<QWidget> centralPlugin;
66
    QMetaObject::Connection activeDocumentReadWriteConnection;
67 68

    void setupActions();
69
    void setupGui();
70
    void setupStatusBar();
71
    void registerStatus(QObject*);
72

73
    void tabContextMenuRequested(Sublime::View *view, QMenu* menu);
74
    void tabToolTipRequested(Sublime::View* view, Sublime::Container* container, int tab);
75
    void dockBarContextMenuRequested(Qt::DockWidgetArea area, const QPoint& position);
76

77
public Q_SLOTS:
78
    void addPlugin( KDevelop::IPlugin *plugin );
79
    void removePlugin( KDevelop::IPlugin *plugin );
80
    void updateSourceFormatterGuiClient(bool hasFormatters);
81 82

    void activePartChanged(KParts::Part *part);
83
    void mergeView(Sublime::View *view);
84
    void changeActiveView(Sublime::View *view);
85
    void xmlguiclientDestroyed(QObject* obj);
86 87 88 89 90 91 92

    //actions
    void fileNew();

    void gotoNextWindow();
    void gotoPreviousWindow();

93 94 95
    void selectPrevItem();
    void selectNextItem();

96 97 98 99 100 101
    void viewAddNewToolView();

    void newWindow();
    void splitHorizontal();
    void splitVertical();
    void split(Qt::Orientation orientation);
Hamish Rodda's avatar
Hamish Rodda committed
102
    void toggleFullScreen(bool fullScreen);
103

104 105 106
    void gotoNextSplit();
    void gotoPreviousSplit();

107 108 109 110
    void newToolbarConfig();

    void settingsDialog();

111 112
    void quitAll();

113
//    void fixToolbar();
114

115 116 117
    ///Returns true if we're currently changing the active view through changeActiveView()
    bool changingActiveView() const ;

118
    void configureNotifications();
119
    void showLoadedPlugins();
120

121
    void toggleArea(bool b);
122
    void showErrorMessage(const QString& message, int timeout);
David Nolden's avatar
David Nolden committed
123
    void pluginDestroyed(QObject*);
124

125 126 127 128 129 130
    /// the following slots always activate the m_tabView before calling the normal slot above
    /// @see m_tabView
    /// @see tabContextMenuRequested
    void contextMenuFileNew();
    void contextMenuSplitHorizontal();
    void contextMenuSplitVertical();
131 132 133 134

    /// reload all open documents
    void reloadAll();

135 136
    KTextEditorIntegration::MainWindow *kateWrapper() const;

137 138 139
private:
    KActionCollection *actionCollection();

140
    MainWindow* const m_mainWindow;
141
    StatusBar* m_statusBar;
142
    QWidget* lastXMLGUIClientView;
David Nolden's avatar
David Nolden committed
143
    QPointer<QWidget> m_workingSetCornerWidget;
144

David Nolden's avatar
David Nolden committed
145
    QMap<IPlugin*, KXMLGUIClient*> m_pluginCustomClients;
146

147
    bool m_changingActiveView;
148 149
    /// the view of the tab that got it's context menu connected
    Sublime::View* m_tabView;
150
    QPair<Sublime::View*, QPointer<NavigationToolTip> > m_tabTooltip;
151
    KTextEditorIntegration::MainWindow* m_kateWrapper;
152 153 154 155 156 157
};

}

#endif