~ubuntu-branches/ubuntu/vivid/kate/vivid-updates

« back to all changes in this revision

Viewing changes to addons/textfilter/plugin_katetextfilter.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2014-12-04 16:49:41 UTC
  • mfrom: (1.6.6)
  • Revision ID: package-import@ubuntu.com-20141204164941-l3qbvsly83hhlw2v
Tags: 4:14.11.97-0ubuntu1
* New upstream release
* Update build-deps and use pkg-kde v3 for Qt 5 build
* kate-data now kate5-data for co-installability

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 /***************************************************************************
 
2
                          plugin_katetextfilter.h  -  description
 
3
                             -------------------
 
4
    begin                : FRE Feb 23 2001
 
5
    copyright            : (C) 2001 by Joseph Wenninger
 
6
    email                : jowenn@bigfoot.com
 
7
 ***************************************************************************/
 
8
 
 
9
/***************************************************************************
 
10
 *                                                                         *
 
11
 *   This program is free software; you can redistribute it and/or modify  *
 
12
 *   it under the terms of the GNU General Public License as published by  *
 
13
 *   the Free Software Foundation; either version 2 of the License, or     *
 
14
 *   (at your option) any later version.                                   *
 
15
 *                                                                         *
 
16
 ***************************************************************************/
 
17
 
 
18
#ifndef PLUGIN_KATETEXTFILTER_H
 
19
#define PLUGIN_KATETEXTFILTER_H
 
20
 
 
21
#include <kate/plugin.h>
 
22
#include <kate/application.h>
 
23
#include <kate/documentmanager.h>
 
24
#include <kate/mainwindow.h>
 
25
 
 
26
#include <ktexteditor/view.h>
 
27
#include <ktexteditor/document.h>
 
28
#include <KTextEditor/Command>
 
29
 
 
30
#include <QProcess>
 
31
#include <QVariantList>
 
32
 
 
33
class KProcess;
 
34
 
 
35
class PluginKateTextFilter : public Kate::Plugin, public KTextEditor::Command
 
36
{
 
37
  Q_OBJECT
 
38
 
 
39
  public:
 
40
    explicit PluginKateTextFilter(QObject* parent = 0, const QVariantList& = QVariantList() );
 
41
    virtual ~PluginKateTextFilter();
 
42
 
 
43
    Kate::PluginView *createView (Kate::MainWindow *mainWindow);
 
44
 
 
45
    // Kate::Command
 
46
    bool exec(KTextEditor::View *view, const QString &cmd, QString &msg);
 
47
    bool help(KTextEditor::View *view, const QString &cmd, QString &msg);
 
48
  private:
 
49
    void runFilter(KTextEditor::View *kv, const QString & filter);
 
50
 
 
51
  private:
 
52
    QString  m_strFilterOutput;
 
53
    QString  m_stderrOutput;
 
54
    QString  m_last_command;
 
55
    KProcess * m_pFilterProcess;
 
56
    QStringList completionList;
 
57
    bool copyResult;
 
58
    bool mergeOutput;
 
59
  public Q_SLOTS:
 
60
    void slotEditFilter ();
 
61
    void slotFilterReceivedStdout();
 
62
    void slotFilterReceivedStderr();
 
63
    void slotFilterProcessExited(int exitCode, QProcess::ExitStatus exitStatus);
 
64
};
 
65
 
 
66
class PluginViewKateTextFilter: public Kate::PluginView, public Kate::XMLGUIClient
 
67
{
 
68
  Q_OBJECT
 
69
 
 
70
  public:
 
71
    PluginViewKateTextFilter(PluginKateTextFilter *plugin, Kate::MainWindow *mainwindow);
 
72
    virtual ~PluginViewKateTextFilter();
 
73
 
 
74
  private:
 
75
    PluginKateTextFilter *m_plugin;
 
76
};
 
77
 
 
78
#endif // PLUGIN_KATETEXTFILTER_H
 
79
 
 
80
// kate: space-indent on; indent-width 2; replace-tabs on; mixed-indent off;