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

kate

  • kate
  • app
katedocmanager.h
1/* This file is part of the KDE project
2 Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
3 Copyright (C) 2002 Joseph Wenninger <jowenn@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License version 2 as published by the Free Software Foundation.
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 __KATE_DOCMANAGER_H__
21#define __KATE_DOCMANAGER_H__
22
23#include "katemain.h"
24#include "../interfaces/documentmanager.h"
25
26#include <kate/document.h>
27
28#include <tqdatetime.h>
29#include <tqguardedptr.h>
30#include <tqptrlist.h>
31#include <tqobject.h>
32#include <tqptrdict.h>
33#include <tqintdict.h>
34#include <tqmap.h>
35#include <tqpair.h>
36
37namespace KParts { class Factory; }
38
39class TDEConfig;
40class DCOPObject;
41
42class KateDocumentInfo
43{
44 public:
45 KateDocumentInfo ()
46 : modifiedOnDisc (false),
47 modifiedOnDiscReason (0)
48 {
49 }
50
51 bool modifiedOnDisc;
52 unsigned char modifiedOnDiscReason;
53};
54
55typedef TQPair<KURL,TQDateTime> TPair;
56
57class KateDocManager : public TQObject
58{
59 TQ_OBJECT
60
61 public:
62 KateDocManager (TQObject *parent);
63 ~KateDocManager ();
64
65 static KateDocManager *self ();
66
67 Kate::DocumentManager *documentManager () { return m_documentManager; };
68
69 Kate::Document *createDoc ();
70 void deleteDoc (Kate::Document *doc);
71
72 Kate::Document *document (uint n);
73
74 Kate::Document *activeDocument ();
75 void setActiveDocument (Kate::Document *doc);
76
77 Kate::Document *firstDocument ();
78 Kate::Document *nextDocument ();
79
80 // search document with right documentNumber()
81 Kate::Document *documentWithID (uint id);
82
83 const KateDocumentInfo *documentInfo (Kate::Document *doc);
84
85 int findDocument (Kate::Document *doc);
87 int findDocument (KURL url);
88 // Anders: The above is not currently stable ?
89 Kate::Document *findDocumentByUrl( KURL url );
90
91 bool isOpen(KURL url);
92
93 uint documents ();
94
95 TQPtrList<Kate::Document> &documentList () { return m_docList; };
96
97 Kate::Document *openURL(const KURL&,const TQString &encoding=TQString::null,uint *id =0,bool isTempFile=false);
98
99 bool closeDocument(class Kate::Document *,bool closeURL=true);
100 bool closeDocument(uint);
101 bool closeDocumentWithID(uint);
102 bool closeAllDocuments(bool closeURL=true);
103
104 TQPtrList<Kate::Document> modifiedDocumentList();
105 bool queryCloseDocuments(KateMainWindow *w);
106
107 void saveDocumentList (class TDEConfig *config);
108 void restoreDocumentList (class TDEConfig *config);
109
110 DCOPObject *dcopObject () { return m_dcop; };
111
112 inline bool getSaveMetaInfos() { return m_saveMetaInfos; };
113 inline void setSaveMetaInfos(bool b) { m_saveMetaInfos = b; };
114
115 inline int getDaysMetaInfos() { return m_daysMetaInfos; };
116 inline void setDaysMetaInfos(int i) { m_daysMetaInfos = i; };
117
118 public slots:
123 void saveAll();
124
125 signals:
126 void documentCreated (Kate::Document *doc);
127 void documentDeleted (uint documentNumber);
128 void documentChanged ();
129 void initialDocumentReplaced ();
130
131 private slots:
132 void slotModifiedOnDisc (Kate::Document *doc, bool b, unsigned char reason);
133 void slotModChanged(Kate::Document *doc);
134
135 private:
136 bool loadMetaInfos(Kate::Document *doc, const KURL &url);
137 void saveMetaInfos(Kate::Document *doc);
138 bool computeUrlMD5(const KURL &url, TQCString &result);
139
140 Kate::DocumentManager *m_documentManager;
141 TQPtrList<Kate::Document> m_docList;
142 TQIntDict<Kate::Document> m_docDict;
143 TQPtrDict<KateDocumentInfo> m_docInfos;
144 TQMap<uint,TPair> m_tempFiles;
145 TQGuardedPtr<Kate::Document> m_currentDoc;
146 TDEConfig *m_metaInfos;
147 bool m_saveMetaInfos;
148 int m_daysMetaInfos;
149
150 DCOPObject *m_dcop;
151
152 KParts::Factory *m_factory;
153
154};
155
156#endif
Kate::DocumentManager
This interface provides access to the Kate Document Manager.
Definition: documentmanager.h:30
Kate::documentManager
DocumentManager * documentManager()
Returns the document manager object.
Definition: documentmanager.cpp:114

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.9.4
This website is maintained by Timothy Pearson.