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

« back to all changes in this revision

Viewing changes to kate/src/kateappadaptor.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
/* This file is part of the KDE project
 
2
   Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
 
3
 
 
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
 
 
9
   This library is distributed in the hope that it will be useful,
 
10
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
   Library General Public License for more details.
 
13
 
 
14
   You should have received a copy of the GNU Library General Public License
 
15
   along with this library; see the file COPYING.LIB.  If not, write to
 
16
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
17
   Boston, MA 02110-1301, USA.
 
18
*/
 
19
 
 
20
#ifndef _kateapp_adaptor_h_
 
21
#define _kateapp_adaptor_h_
 
22
 
 
23
#include <QtDBus>
 
24
 
 
25
class KateApp;
 
26
 
 
27
class KateAppAdaptor : public QDBusAbstractAdaptor
 
28
{
 
29
    Q_OBJECT
 
30
    Q_CLASSINFO("D-Bus Interface", "org.kde.Kate.Application")
 
31
    Q_PROPERTY(QString activeSession READ activeSession)
 
32
public:
 
33
    KateAppAdaptor(KateApp *app);
 
34
 
 
35
    /**
 
36
     * emit the exiting signal
 
37
     */
 
38
    void emitExiting();
 
39
    void emitDocumentClosed(const QString &token);
 
40
 
 
41
public Q_SLOTS:
 
42
    /**
 
43
     * open a file with given url and encoding
 
44
     * will get view created
 
45
     * @param url url of the file
 
46
     * @param encoding encoding name
 
47
     * @return success
 
48
     */
 
49
    bool openUrl(QString url, QString encoding);
 
50
 
 
51
    /**
 
52
     * open a file with given url and encoding
 
53
     * will get view created
 
54
     * @param url url of the file
 
55
     * @param encoding encoding name
 
56
     * @return token or ERROR
 
57
     */
 
58
    QString tokenOpenUrl(QString url, QString encoding);
 
59
 
 
60
    /**
 
61
     * Like the above, but adds an option to let the documentManager know
 
62
     * if the file should be deleted when closed.
 
63
     * @p isTempFile should be set to true with the --tempfile option set ONLY,
 
64
     * files opened with this set to true will be deleted when closed.
 
65
     */
 
66
    bool openUrl(QString url, QString encoding, bool isTempFile);
 
67
 
 
68
    QString tokenOpenUrl(QString url, QString encoding, bool isTempFile);
 
69
 
 
70
    /**
 
71
     * set cursor of active view in active main window
 
72
     * @param line line for cursor
 
73
     * @param column column for cursor
 
74
     * @return success
 
75
     */
 
76
    bool setCursor(int line, int column);
 
77
 
 
78
    /**
 
79
     * helper to handle stdin input
 
80
     * open a new document/view, fill it with the text given
 
81
     * @param text text to fill in the new doc/view
 
82
     * @return success
 
83
     */
 
84
    bool openInput(QString text);
 
85
 
 
86
    /**
 
87
     * activate a given session
 
88
     * @param session session name
 
89
     * @return success
 
90
     */
 
91
    bool activateSession(QString session);
 
92
 
 
93
    /**
 
94
     * activate this kate instance
 
95
     */
 
96
    void activate();
 
97
 
 
98
Q_SIGNALS:
 
99
    /**
 
100
     * Notify the world that this kate instance is exiting.
 
101
     * All apps should stop using the dbus interface of this instance after this signal got emitted.
 
102
     */
 
103
    void exiting();
 
104
    void documentClosed(const QString &token);
 
105
public:
 
106
    QString activeSession();
 
107
private:
 
108
    KateApp *m_app;
 
109
};
 
110
 
 
111
#endif
 
112