This might be the "right way" to fix the issue - mark our exported classes as
[kdeedu-porting.git] / kalzium / src / nuclideboard.h
blobb1b27dfadddae94a4e874145d00fedc22fc5f1b0
1 #ifndef NUCLIDEBOARD_H
2 #define NUCLIDEBOARD_H
3 /***************************************************************************
4 * Copyright (C) 2007, 2008 by Carsten Niehaus *
5 * cniehaus@kde.org *
6 * *
7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * This program is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with this program; if not, write to the *
19 * Free Software Foundation, Inc., *
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
21 ***************************************************************************/
23 #include <QGraphicsScene>
24 #include <QGraphicsSceneMouseEvent>
25 #include <QGraphicsRectItem>
27 class IsotopeItem;
28 class Isotope;
30 #include "ui_isotopedialog.h"
32 #include <kdialog.h>
34 class Isotope;
35 class InformationItem;
37 class QGraphicsSceneMouseEvent;
38 class QGraphicsTextItem;
40 /**
41 * This class is the drawing widget for the whole table
43 * @author Pino Toscano
44 * @author Carsten Niehaus
46 class IsotopeTableDialog : public KDialog
48 Q_OBJECT
50 public:
51 explicit IsotopeTableDialog( QWidget* parent = 0 );
53 private:
54 Ui::isotopeWidget ui;
56 private slots:
57 void updateDockWidget( IsotopeItem * );
60 /**
61 * The class represtens the items which is drawn on the QGraphicsScene. Each such item represents on
62 * Isotope.
63 * @author Carsten Niehaus
65 class IsotopeItem : public QGraphicsRectItem
67 public:
68 /**
69 * there are several types of decay for an isotope.
71 enum IsotopeType { alpha, ec, multiple, bplus, bminus, stable };
73 enum { Type = UserType + 1 };
75 /**
76 * @param isotope The Isotope represented
78 IsotopeItem(Isotope * isotope, qreal x, qreal y, qreal width, qreal height, QGraphicsItem *parent = 0);
80 /**
81 * @return the Isotope the item represents
83 Isotope* isotope() const{
84 return m_isotope;
87 /**
88 * @return the Type of the item
90 int type() const{
91 return Type;
95 private:
96 IsotopeType m_type;
97 Isotope* m_isotope;
99 /**
100 * @return the IsotopeType of the Isotope
102 IsotopeType getType( Isotope * );
104 protected:
105 void mousePressEvent(QGraphicsSceneMouseEvent *event);
108 class InformationItem : public QGraphicsRectItem
110 public:
111 enum { Type = UserType + 2 };
114 * @param isotope The Isotope represented
116 InformationItem( qreal x, qreal y, qreal width, qreal height, QGraphicsItem *parent = 0);
119 * @return the Type of the item
121 int type() const{
122 return Type;
125 void setIsotope( IsotopeItem * item );
127 private:
128 QGraphicsTextItem *m_textitem;
132 class IsotopeScene : public QGraphicsScene
134 Q_OBJECT
136 public:
137 IsotopeScene( QObject * parent = 0);
139 void updateContextHelp( IsotopeItem * item );
141 private:
142 void drawIsotopes();
144 //the size of each item
145 int m_itemSize;
147 ///this group stores all IsotopeItems
148 QGraphicsItemGroup *m_isotopeGroup;
150 signals:
151 void itemSelected(IsotopeItem *item);
155 #endif // NUCLIDEBOARD_H