• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

okteta

  • sources
  • kde-4.12
  • kdesdk
  • okteta
  • libs
  • kasten
  • core
  • system
documentmanager.h
Go to the documentation of this file.
1 /*
2  This file is part of the Kasten Framework, made within the KDE community.
3 
4  Copyright 2006-2007,2009,2011 Friedrich W. H. Kossebau <kossebau@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) version 3, or any
10  later version accepted by the membership of KDE e.V. (or its
11  successor approved by the membership of KDE e.V.), which shall
12  act as a proxy defined in Section 6 of version 3 of the license.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public
20  License along with this library. If not, see <http://www.gnu.org/licenses/>.
21 */
22 
23 #ifndef DOCUMENTMANAGER_H
24 #define DOCUMENTMANAGER_H
25 
26 // lib
27 #include "kastencore_export.h"
28 // Qt
29 #include <QtCore/QList>
30 #include <QtCore/QObject>
31 
32 class QStringList;
33 
34 
35 namespace Kasten2
36 {
37 class AbstractDocument;
38 
39 class DocumentCreateManager; //TODO: temporary
40 class DocumentSyncManager; //TODO: temporary
41 class ModelCodecManager; //TODO: temporary
42 
43 
44 class KASTENCORE_EXPORT DocumentManager : public QObject
45 {
46  Q_OBJECT
47 
48  friend class DocumentSyncManager;
49 
50  public:
51  DocumentManager();
52  virtual ~DocumentManager();
53 
54  public:
55  void addDocument( AbstractDocument* document );
56 
57  void closeDocument( AbstractDocument* document );
58  void closeDocuments( const QList<AbstractDocument*>& documents );
59  void closeAll();
60 // TODO: think about if a more general close( documentList, theseOrOthers ) is better, same with canCloseAllOther()
61  void closeAllOther( AbstractDocument* document );
62 
63  // TODO: what to do for documents not added?
64  bool canClose( AbstractDocument* document );
65  bool canClose( const QList<AbstractDocument*>& documents );
66  bool canCloseAll();
67  bool canCloseAllOther( AbstractDocument* document );
68 
69  void requestFocus( AbstractDocument* document );
70 
71  public:
72  QList<AbstractDocument*> documents() const;
73  bool isEmpty() const;
74 
75  public:
76  DocumentCreateManager* createManager();
77  DocumentSyncManager* syncManager();
78  ModelCodecManager* codecManager();
79 
80  Q_SIGNALS:
81  // documents got added
82  void added( const QList<Kasten2::AbstractDocument*>& documents );
84  void closing( const QList<Kasten2::AbstractDocument*>& documents );
85 
86 // void closing( KCloseEvent* event );
87 // TODO: other than QObject event gets modified by observers, take care of unsetting a close cancel
88 // problem with a signal is that all(!) observers get notified, even if event is already cancelled
89 // better a visitor pattern?
90 
91  // TODO: or should the document be able to emit this?
92  void focusRequested( Kasten2::AbstractDocument* document );
93 
94 // protected:
95 // virtual AbstractDocument* createDocument();
96 
97  private:
98  QList<AbstractDocument*> mList;
99 
100  // TODO: remove into own singleton
101  DocumentCreateManager* mCreateManager;
102  DocumentSyncManager* mSyncManager;
103  ModelCodecManager* mCodecManager;
104 };
105 
106 
107 inline DocumentCreateManager* DocumentManager::createManager() { return mCreateManager; }
108 inline DocumentSyncManager* DocumentManager::syncManager() { return mSyncManager; }
109 inline ModelCodecManager* DocumentManager::codecManager() { return mCodecManager; }
110 
111 }
112 
113 #endif
QObject
kastencore_export.h
Kasten2::DocumentManager::codecManager
ModelCodecManager * codecManager()
Definition: documentmanager.h:109
Kasten2::DocumentCreateManager
Definition: documentcreatemanager.h:41
Kasten2::AbstractDocument
Definition: abstractdocument.h:43
KASTENCORE_EXPORT
#define KASTENCORE_EXPORT
Definition: kastencore_export.h:36
Kasten2::DocumentManager::syncManager
DocumentSyncManager * syncManager()
Definition: documentmanager.h:108
Kasten2::DocumentManager::createManager
DocumentCreateManager * createManager()
Definition: documentmanager.h:107
Kasten2::DocumentSyncManager
Definition: documentsyncmanager.h:45
Kasten2::DocumentManager
Definition: documentmanager.h:44
Kasten2::ModelCodecManager
Definition: modelcodecmanager.h:48
QList
Definition: bookmarkable.h:29
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:04:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

okteta

Skip menu "okteta"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal