~ubuntu-branches/ubuntu/intrepid/kdesdk/intrepid-updates

« back to all changes in this revision

Viewing changes to kate/interfaces/kate/documentmanager.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2008-05-28 10:11:43 UTC
  • mto: This revision was merged to the branch mainline in revision 37.
  • Revision ID: james.westby@ubuntu.com-20080528101143-gzc3styjz1b70zxu
Tags: upstream-4.0.80
ImportĀ upstreamĀ versionĀ 4.0.80

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 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
#include "documentmanager.h"
 
20
#include "documentmanager.moc"
 
21
 
 
22
#include "plugin.h"
 
23
#include "pluginmanager.h"
 
24
 
 
25
#include "application.h"
 
26
 
 
27
#include "../app/katedocmanager.h"
 
28
 
 
29
namespace Kate
 
30
{
 
31
 
 
32
  class PrivateDocumentManager
 
33
  {
 
34
    public:
 
35
      PrivateDocumentManager ()
 
36
      {}
 
37
 
 
38
      ~PrivateDocumentManager ()
 
39
      {}
 
40
 
 
41
      KateDocManager *docMan;
 
42
  };
 
43
 
 
44
  DocumentManager::DocumentManager (void *documentManager) : QObject ((KateDocManager*) documentManager)
 
45
  {
 
46
    d = new PrivateDocumentManager ();
 
47
    d->docMan = (KateDocManager*) documentManager;
 
48
  }
 
49
 
 
50
  DocumentManager::~DocumentManager ()
 
51
  {
 
52
    delete d;
 
53
  }
 
54
 
 
55
  const QList<KTextEditor::Document*> &DocumentManager::documents () const
 
56
  {
 
57
    return d->docMan->documentList ();
 
58
  }
 
59
 
 
60
  KTextEditor::Document *DocumentManager::findUrl (const KUrl &url) const
 
61
  {
 
62
    return d->docMan->findDocument (url);
 
63
  }
 
64
 
 
65
  KTextEditor::Document *DocumentManager::openUrl(const KUrl&url, const QString &encoding)
 
66
  {
 
67
    return d->docMan->openUrl (url, encoding);
 
68
  }
 
69
 
 
70
  bool DocumentManager::closeDocument(KTextEditor::Document *document)
 
71
  {
 
72
    return d->docMan->closeDocument (document);
 
73
  }
 
74
 
 
75
  DocumentManager *documentManager ()
 
76
  {
 
77
    return application()->documentManager ();
 
78
  }
 
79
 
 
80
}
 
81
 
 
82
// kate: space-indent on; indent-width 2; replace-tabs on;
 
83