1
/* This file is part of the KDE libraries
2
Copyright (C) 2005 Joseph Wenninger <jowenn@kde.org>
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.
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.
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.
18
#ifndef _KDOCUMENT_DOCUMENT_
19
#define _KDOCUMENT_DOCUMENT_
21
#include <kparts/part.h>
24
* Namespace for document/view architectures.
26
* This is a very basic abstraction for applications and libraries that need
27
* documents to support several views.
33
* A KParts document that provides several views.
35
* <b>Introduction</b>\n
37
* A document can have any number of views or no view, all representing
38
* the same data. A view represents the document's content - usually
39
* graphically. Every document has a unique number accessible with
40
* documentNumber(). Create a new view with createView() and get a list
41
* of all views with views().
43
* @see KParts::ReadWritePart
45
class KDOCUMENT_EXPORT Document : public KParts::ReadWritePart {
51
* Create a new document with @p parent.
52
* @param parent parent object
54
Document(QObject *parent);
62
* Create a new view attached to @p parent.
63
* @param parent parent widget
64
* @return the new view
66
virtual View *createView ( QWidget *parent ) = 0;
69
* Get a list of all views.
70
* @return all document views
73
virtual const QList<View*> &views () const = 0;
76
* Get the global unique number of this document in your application.
77
* @return document number
79
int documentNumber () const;
96
// kate: space-indent off; indent-width 2; tab-width 4; replace-tabs off;