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

« back to all changes in this revision

Viewing changes to kwrite/kwriteapp.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) 2010 Dominik Haumann <dhaumann 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 version 2 as published by the Free Software Foundation.
7
 
 
8
 
This library is distributed in the hope that it will be useful,
9
 
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11
 
Library General Public License for more details.
12
 
 
13
 
You should have received a copy of the GNU Library General Public License
14
 
along with this library; see the file COPYING.LIB.  If not, write to
15
 
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16
 
Boston, MA 02110-1301, USA.
17
 
*/
18
 
 
19
 
#ifndef __KWRITE_APP_H__
20
 
#define __KWRITE_APP_H__
21
 
 
22
 
#include "kwritemain.h"
23
 
 
24
 
#include <KApplication>
25
 
#include <ktexteditor/editor.h>
26
 
#include <ktexteditor/containerinterface.h>
27
 
 
28
 
#include <QList>
29
 
 
30
 
namespace KTextEditor
31
 
{
32
 
    class Document;
33
 
}
34
 
 
35
 
class KCmdLineArgs;
36
 
 
37
 
/**
38
 
 * KWrite Application
39
 
 * This class represents the core kwrite application object
40
 
 */
41
 
class KWriteApp
42
 
  : public KApplication
43
 
  , public KTextEditor::MdiContainer
44
 
{
45
 
    Q_OBJECT
46
 
    Q_INTERFACES(KTextEditor::MdiContainer)
47
 
 
48
 
  //
49
 
  // constructors & accessor to app object
50
 
  //
51
 
  public:
52
 
    /**
53
 
     * application constructor
54
 
     * @param args parsed command line args
55
 
     */
56
 
    KWriteApp(KCmdLineArgs *args);
57
 
 
58
 
    /**
59
 
     * application destructor
60
 
     */
61
 
    ~KWriteApp();
62
 
 
63
 
    /**
64
 
     * static accessor to avoid casting ;)
65
 
     * @return app instance
66
 
     */
67
 
    static KWriteApp *self ();
68
 
 
69
 
    /**
70
 
     * further initialization
71
 
     */
72
 
    void init();
73
 
 
74
 
    /**
75
 
     * Editor instance
76
 
     */
77
 
    KTextEditor::Editor *editor () { return m_editor; }
78
 
 
79
 
  //
80
 
  // KTextEditor::MdiContainer
81
 
  //
82
 
  public:
83
 
    virtual void setActiveView( KTextEditor::View * view );
84
 
    virtual KTextEditor::View * activeView();
85
 
    virtual KTextEditor::Document * createDocument();
86
 
    virtual bool closeDocument( KTextEditor::Document * doc );
87
 
    virtual KTextEditor::View * createView( KTextEditor::Document * doc );
88
 
    virtual bool closeView( KTextEditor::View * view );
89
 
 
90
 
  private:
91
 
    /**
92
 
     * kate's command line args
93
 
     */
94
 
    KCmdLineArgs *m_args;
95
 
 
96
 
    /**
97
 
     * known main windows
98
 
     */
99
 
    QList<KWrite*> m_mainWindows;
100
 
 
101
 
    /**
102
 
     * editor instance
103
 
     */
104
 
    KTextEditor::Editor *m_editor;
105
 
};
106
 
 
107
 
#endif
108
 
// kate: space-indent on; indent-width 2; replace-tabs on;
109