1
#ifndef KALZIUMDATAOBJECT_H
2
#define KALZIUMDATAOBJECT_H
3
/***************************************************************************
4
* Copyright (C) 2005, 2006 by Carsten Niehaus *
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. *
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. *
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
***************************************************************************/
30
* @brief This class contains all Element objects
32
* This singleton class collects all the information about the elements of the
33
* Periodic Table as list of Element.
37
* KalziumDataObject::instance()->ElementList;
39
* to get the whole list of Element, while a
41
* KalziumDataObject::instance()->element( num );
43
* will return you the pointer to the num'th element of the Periodic Table.
45
* @author Carsten Niehaus
47
class KalziumDataObject
51
* @return the instance of this class
53
static KalziumDataObject* instance();
56
* The list of elements
58
QList<Element*> ElementList;
61
* Set the main Search to @p srch
63
void setSearch ( Search *srch );
66
* @return the main Search
68
Search* search() const;
71
* @return the Element with the number @p number
72
* @param number the number of the Element which will be returned
74
Element* element ( int number );
77
* retunrs the unit symbol from the given KUnitConversion UnitId.
78
* @param unit KUnitConversion UnitId
79
* @return unit symbol as string.
81
QString unitAsString( const int unit ) const;
84
* @return the isotopes of the Element with the number @p number
86
QList<Isotope*> isotopes ( int number );
89
* @return the isotopes of the Element @p Element
91
QList<Isotope*> isotopes ( Element * element );
94
* @return the Spectrum of the Element with the number @p number
96
Spectrum * spectrum ( int number );
98
QPixmap pixmap ( int number );
101
* Use this to get the number of elements we have. It is cached
102
* so you are strongly suggested to use this instead of hardcode
103
* the number of elements.
104
* @return the number of elements we have
106
int numberOfElements() const { return m_numOfElements; }
110
~KalziumDataObject();
112
static void cleanup();
117
QList<QPixmap> PixmapList;
119
QHash<int, QList<Isotope*> > m_isotopes;
120
QList<Spectrum*> m_spectra;
123
* Caching the number of elements
129
friend class StaticKalziumDataObject;
131
#endif // KALZIUMDATAOBJECT_H