• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kate
 

kate

  • kate
  • app
katedocmanageriface.cpp
1 /* This file is part of the KDE project
2  Copyright (C) 2003 Ian Reinhart Geiser <geiseri@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 "katedocmanageriface.h"
20 
21 #include "katedocmanager.h"
22 
23 #include <kdebug.h>
24 
25 KateDocManagerDCOPIface::KateDocManagerDCOPIface (KateDocManager *dm) : DCOPObject ("KateDocumentManager"), m_dm (dm)
26 {
27 
28 }
29 
30 // bit more error save than the forcing c cast ;()
31 DCOPRef KateDocManagerDCOPIface::document (uint n)
32 {
33  Kate::Document *doc = m_dm->document(n);
34 
35  if (!doc)
36  return DCOPRef ();
37 
38  DCOPObject *obj = static_cast<DCOPObject*>(doc->tqt_cast("DCOPObject"));
39 
40  if (!obj)
41  return DCOPRef ();
42 
43  return DCOPRef (obj);
44 }
45 
46 DCOPRef KateDocManagerDCOPIface::activeDocument ()
47 {
48  Kate::Document *doc = m_dm->activeDocument();
49 
50  if (!doc)
51  return DCOPRef ();
52 
53  DCOPObject *obj = static_cast<DCOPObject*>(doc->tqt_cast("DCOPObject"));
54 
55  if (!obj)
56  return DCOPRef ();
57 
58  return DCOPRef (obj);
59 }
60 
61 uint KateDocManagerDCOPIface::activeDocumentNumber ()
62 {
63  Kate::Document *doc = m_dm->activeDocument();
64 
65  if (doc)
66  return doc->documentNumber ();
67 
68  return 0;
69 }
70 
71 DCOPRef KateDocManagerDCOPIface::documentWithID (uint id)
72 {
73  Kate::Document *doc = m_dm->documentWithID (id);
74 
75  if (!doc)
76  return DCOPRef ();
77 
78  DCOPObject *obj = static_cast<DCOPObject*>(doc->tqt_cast("DCOPObject"));
79 
80  if (!obj)
81  return DCOPRef ();
82 
83  return DCOPRef (obj);
84 }
85 
86 DCOPRef KateDocManagerDCOPIface::openURL (KURL url, TQString encoding)
87 {
88  Kate::Document *doc = m_dm->openURL (url, encoding);
89 
90  if (!doc)
91  return DCOPRef ();
92 
93  DCOPObject *obj = static_cast<DCOPObject*>(doc->tqt_cast("DCOPObject"));
94 
95  if (!obj)
96  return DCOPRef ();
97 
98  return DCOPRef (obj);
99 }
100 
101 bool KateDocManagerDCOPIface::closeDocument(uint n)
102 {
103  return m_dm->closeDocument(n);
104 }
105 
106 bool KateDocManagerDCOPIface::closeDocumentWithID(uint id)
107 {
108  return m_dm->closeDocumentWithID (id);
109 }
110 
111 bool KateDocManagerDCOPIface::closeAllDocuments()
112 {
113  return m_dm->closeAllDocuments();
114 }
115 
116 bool KateDocManagerDCOPIface::isOpen(KURL url)
117 {
118  return m_dm->isOpen (url);
119 }
120 
121 uint KateDocManagerDCOPIface::documents ()
122 {
123  return m_dm->documents();
124 }
125 
126 int KateDocManagerDCOPIface::findDocument (KURL url)
127 {
128  return m_dm->findDocument (url);
129 }
130 
131 

kate

Skip menu "kate"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

kate

Skip menu "kate"
  • kate
  • libkonq
  • twin
  •   lib
Generated for kate by doxygen 1.8.13
This website is maintained by Timothy Pearson.