katefilebrowserplugin.h 2.7 KB
Newer Older
1 2 3 4
/* This file is part of the KDE project
   Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
   Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
   Copyright (C) 2001 Anders Lund <anders.lund@lund.tdcadsl.dk>
5
   Copyright (C) 2007 Mirko Stocker <me@misto.ch>
6
   Copyright (C) 2009 Dominik Haumann <dhaumann kde org>
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License version 2 as published by the Free Software Foundation.

   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.
*/

23 24
#ifndef KATE_FILEBROWSER_PLUGIN_H
#define KATE_FILEBROWSER_PLUGIN_H
25 26

#include <ktexteditor/document.h>
Christoph Cullmann's avatar
Christoph Cullmann committed
27 28 29 30
#include <ktexteditor/plugin.h>
#include <ktexteditor/mainwindow.h>
#include <ktexteditor/configpage.h>
#include <KTextEditor/SessionConfigInterface>
31

32
class KateFileBrowser;
33
class KateFileBrowserPluginView;
34

35
class KateFileBrowserPlugin: public KTextEditor::Plugin
36 37
{
    Q_OBJECT
38

39
  public:
40 41
    explicit KateFileBrowserPlugin( QObject* parent = 0, const QList<QVariant>& = QList<QVariant>() );
    virtual ~KateFileBrowserPlugin()
42
    {}
43

Laurent Montel's avatar
Laurent Montel committed
44
    QObject *createView (KTextEditor::MainWindow *mainWindow) Q_DECL_OVERRIDE;
45

Laurent Montel's avatar
Laurent Montel committed
46 47
    int configPages() const Q_DECL_OVERRIDE;
    KTextEditor::ConfigPage *configPage (int number = 0, QWidget *parent = 0) Q_DECL_OVERRIDE;
48 49 50
    
  public Q_SLOTS:
    void viewDestroyed(QObject* view);
51 52

  private:
53
    QList<KateFileBrowserPluginView *> m_views;
54 55
};

Christoph Cullmann's avatar
Christoph Cullmann committed
56
class KateFileBrowserPluginView : public QObject, public KTextEditor::SessionConfigInterface
57 58
{
    Q_OBJECT
Christoph Cullmann's avatar
Christoph Cullmann committed
59
    Q_INTERFACES(KTextEditor::SessionConfigInterface)
60 61 62 63 64

  public:
    /**
      * Constructor.
      */
Christoph Cullmann's avatar
Christoph Cullmann committed
65
    KateFileBrowserPluginView (KTextEditor::Plugin *plugin, KTextEditor::MainWindow *mainWindow);
66 67 68 69

    /**
     * Virtual destructor.
     */
70
    ~KateFileBrowserPluginView ();
71

Laurent Montel's avatar
Laurent Montel committed
72 73
    void readSessionConfig (const KConfigGroup& config) Q_DECL_OVERRIDE;
    void writeSessionConfig (KConfigGroup& config) Q_DECL_OVERRIDE;
Anders Lund's avatar
Anders Lund committed
74

75
  private:
Laurent Montel's avatar
Laurent Montel committed
76
    bool eventFilter(QObject*, QEvent*) Q_DECL_OVERRIDE;
77 78

    QWidget *m_toolView;
79
    KateFileBrowser *m_fileBrowser;
Christoph Cullmann's avatar
Christoph Cullmann committed
80
    KTextEditor::MainWindow *m_mainWindow;
81
    friend class KateFileBrowserPlugin;
82 83
};

84
#endif //KATE_FILEBROWSER_PLUGIN_H
85 86

// kate: space-indent on; indent-width 2; replace-tabs on;