1
/***************************************************************************
2
* Copyright (C) 2005-2006 by Pino Toscano, toscano.pino@tiscali.it *
3
* Copyright (C) 2003-2006 by Carsten Niehaus, cniehaus@kde.org *
4
* Copyright (C) 2007-2009 by Marcus D. Hanwell *
5
* Copyright (C) 2010-2011 by Etienne Rebetez, etienne.rebetez@oberwallis.ch *
8
* This program is free software; you can redistribute it and/or modify *
9
* it under the terms of the GNU General Public License as published by *
10
* the Free Software Foundation; either version 2 of the License, or *
11
* (at your option) any later version. *
13
* This program is distributed in the hope that it will be useful, *
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16
* GNU General Public License for more details. *
18
* You should have received a copy of the GNU General Public License *
19
* along with this program; if not, write to the *
20
* Free Software Foundation, Inc., *
21
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
22
***************************************************************************/
24
#ifndef PERIODSYSTEMBASE_H
25
#define PERIODSYSTEMBASE_H
27
#include <QGraphicsView>
29
#include "kalziumdataobject.h"
31
#include "kalziumnumerationtype.h"
33
#include "elementitem.h"
34
#include "numerationitem.h"
35
#include "periodictablescene.h"
36
#include "periodictablestates.h"
40
* @class PeriodicTableView
41
* In this class the periodic table of elements is created.
42
* It provides slots to change the tables and accessing the element propertys
43
* @short Base class and creation for the pse System
44
* @author Carsten Niehaus
45
* @author Marcus D. Hanwell
46
* @author Etienne Rebetez
50
class PeriodicTableView : public QGraphicsView
54
PeriodicTableView(QWidget *parent = 0);
58
* Returns the qgraphicsscene
60
PeriodicTableScene *pseScene() const;
63
* Returns the current id of the pse-table.
64
* The id is the same as the menü and the pse list from the pseTables class.
69
* Genarates and saves the pse as svg in the given filename.
70
* @param filename filename of the destination.
72
void generateSvg(const QString& filename);
77
* Is emited when the pse table is changed.
79
void tableChanged(int tableTyp);
81
* Is emited when the numeration of the pse table is changed.
83
void numerationChange(int num);
87
* Change the pse table to the given id.
88
* @param newtable id of the pse table.
90
void slotChangeTable(int newtable);
92
* fits the pse in the qGraphicsView.
96
* One Element can be selected with this function.
97
* The selection is only a graphical feedback for the user.
98
* @param element number of the element.
100
void slotSelectOneElement(int element);
102
* Selects an Element.
103
* @param element number of the element.
105
void slotSelectAdditionalElement(int element);
107
* Unselects all elements
109
void slotUnSelectElements();
112
QList<ElementItem *> createElementItems() const;
113
QList<NumerationItem *> createNumerationItems() const;
115
void setBiggerSceneRect();
117
int m_currentTableInex;
119
PeriodicTableScene *m_tableScene;
121
PeriodicTableStates *m_tableStates;
125
* Generic event handler, currently defaults to calling parent class
126
* (included for future compatibility)
128
bool event(QEvent *e);
131
* is caled every time the view is resized.
133
void resizeEvent ( QResizeEvent * event );
135
#endif // PERIODSYSTEMBASE_H