~ubuntu-branches/ubuntu/gutsy/kde4libs/gutsy

« back to all changes in this revision

Viewing changes to interfaces/kdocument/document.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2007-02-21 11:00:12 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070221110012-6kw8khr9knv6lmg1
Tags: 3.80.3-0ubuntu1
New upstream unstable release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* This file is part of the KDE libraries
2
 
   Copyright (C) 2005 Joseph Wenninger <jowenn@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
 
#ifndef _KDOCUMENT_DOCUMENT_
19
 
#define _KDOCUMENT_DOCUMENT_
20
 
 
21
 
#include <kparts/part.h>
22
 
 
23
 
/**
24
 
 * Namespace for document/view architectures.
25
 
 *
26
 
 * This is a very basic abstraction for applications and libraries that need
27
 
 * documents to support several views.
28
 
 */
29
 
namespace KDocument {
30
 
        class View;
31
 
 
32
 
        /**
33
 
         * A KParts document that provides several views.
34
 
         *
35
 
         * <b>Introduction</b>\n
36
 
         *
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().
42
 
         *
43
 
         * @see KParts::ReadWritePart
44
 
         */
45
 
        class KDOCUMENT_EXPORT Document : public KParts::ReadWritePart {
46
 
                Q_OBJECT
47
 
                public:
48
 
                        /**
49
 
                         * Constructor.
50
 
                         *
51
 
                         * Create a new document with @p parent.
52
 
                         * @param parent parent object
53
 
                         */
54
 
                        Document(QObject *parent);
55
 
 
56
 
                        /**
57
 
                         * Virtual destructor.
58
 
                         */
59
 
                        virtual ~Document();
60
 
 
61
 
                        /**
62
 
                         * Create a new view attached to @p parent.
63
 
                         * @param parent parent widget
64
 
                         * @return the new view
65
 
                         */
66
 
                        virtual View *createView ( QWidget *parent ) = 0;
67
 
 
68
 
                        /**
69
 
                         * Get a list of all views.
70
 
                         * @return all document views
71
 
                         * @see createView()
72
 
                         */
73
 
                        virtual const QList<View*> &views () const = 0;
74
 
 
75
 
                        /**
76
 
                         * Get the global unique number of this document in your application.
77
 
                         * @return document number
78
 
                         */
79
 
                        int documentNumber () const;
80
 
 
81
 
                private:
82
 
                        /**
83
 
                         * Private d-pointer
84
 
                         */
85
 
                        class Private *d;
86
 
                        /**
87
 
                         * document number
88
 
                         */
89
 
                        int m_documentNumber;
90
 
        };
91
 
}
92
 
 
93
 
 
94
 
#endif
95
 
 
96
 
// kate: space-indent off; indent-width 2; tab-width 4; replace-tabs off;