1 /***************************************************************************
2     File                 : AspectPrivate.h
3     Project              : SciDAVis
4     --------------------------------------------------------------------
5     Copyright            : (C) 2007 by Knut Franke, Tilman Benkert
6     Email (use @ for *)  : knut.franke*gmx.de, thzs*gmx.net
7     Description          : Private data managed by AbstractAspect.
8 
9  ***************************************************************************/
10 
11 /***************************************************************************
12  *                                                                         *
13  *  This program is free software; you can redistribute it and/or modify   *
14  *  it under the terms of the GNU General Public License as published by   *
15  *  the Free Software Foundation; either version 2 of the License, or      *
16  *  (at your option) any later version.                                    *
17  *                                                                         *
18  *  This program is distributed in the hope that it will be useful,        *
19  *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
20  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
21  *  GNU General Public License for more details.                           *
22  *                                                                         *
23  *   You should have received a copy of the GNU General Public License     *
24  *   along with this program; if not, write to the Free Software           *
25  *   Foundation, Inc., 51 Franklin Street, Fifth Floor,                    *
26  *   Boston, MA  02110-1301  USA                                           *
27  *                                                                         *
28  ***************************************************************************/
29 #ifndef ASPECT_PRIVATE_H
30 #define ASPECT_PRIVATE_H
31 
32 #include "AbstractAspect.h"
33 
34 #include <QString>
35 #include <QDateTime>
36 #include <QList>
37 #include "ApplicationWindow.h"
38 #include <QHash>
39 
40 //! Private data managed by AbstractAspect.
41 class AbstractAspect::Private
42 {
43 public:
44     Private(AbstractAspect *owner, const QString &name);
45     ~Private();
46 
47     void addChild(AbstractAspect *child);
48     void insertChild(int index, AbstractAspect *child);
49     int indexOfChild(const AbstractAspect *child) const;
50     int removeChild(AbstractAspect *child);
51     int childCount() const;
52     AbstractAspect *child(int index);
53 
54     QString name() const;
55     void setName(const QString &value);
56     QString comment() const;
57     void setComment(const QString &value);
58     QString captionSpec() const;
59     void setCaptionSpec(const QString &value);
60     QDateTime creationTime() const;
61     void setCreationTime(const QDateTime &time);
62 
63     QString caption() const;
owner()64     AbstractAspect *owner() { return d_owner; }
parent()65     AbstractAspect *parent() { return d_parent; }
66 
67     QString uniqueNameFor(const QString &current_name) const;
68 
69     static QHash<QString, QVariant> g_defaults;
70 
71 private:
72     static int indexOfMatchingBrace(const QString &str, int start);
73     QList<AbstractAspect *> d_children;
74     QString d_name, d_comment, d_caption_spec;
75     QDateTime d_creation_time;
76     AbstractAspect *d_owner;
77     AbstractAspect *d_parent;
78 };
79 
80 #endif // ifndef ASPECT_PRIVATE_H
81