SciDAVis  1.D4
AspectPrivate.h
Go to the documentation of this file.
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 <QSettings>
38 #include <QHash>
39 
42 {
43  public:
44  Private(AbstractAspect * owner, const QString &name);
45  ~Private();
46 
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;
64  AbstractAspect * owner() { return d_owner; }
65  AbstractAspect * parent() { return d_parent; }
66 
67  QString uniqueNameFor(const QString &current_name) const;
68 
69  static QSettings * g_settings;
70  static QHash<QString, QVariant> g_defaults;
71 
72  private:
73  static int indexOfMatchingBrace(const QString &str, int start);
74  QList< AbstractAspect* > d_children;
76  QDateTime d_creation_time;
79 };
80 
81 #endif // ifndef ASPECT_PRIVATE_H