Test change - can I push OK?
[kdeedu-porting.git] / kalzium / src / kalziumdataobject.h
blobe284ce88ce1dad69604d0760c40ad79661aa95c8
1 #ifndef KALZIUMDATAOBJECT_H
2 #define KALZIUMDATAOBJECT_H
3 /***************************************************************************
4 * Copyright (C) 2005, 2006 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 <element.h>
24 #include <QHash>
25 #include <QPixmap>
27 class Search;
29 /**
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.
35 * Use:
36 * @code
37 * KalziumDataObject::instance()->ElementList;
38 * @endcode
39 * to get the whole list of Element, while a
40 * @code
41 * KalziumDataObject::instance()->element( num );
42 * @endcode
43 * will return you the pointer to the num'th element of the Periodic Table.
45 * @author Carsten Niehaus
47 class KalziumDataObject
49 public:
50 /**
51 * @return the instance of this class
53 static KalziumDataObject* instance();
55 /**
56 * The list of elements
58 QList<Element*> ElementList;
60 /**
61 * Set the main Search to @p srch
63 void setSearch( Search *srch );
65 /**
66 * @return the main Search
68 Search* search() const;
70 /**
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 );
76 /**
77 * @return the isotopes of the Element with the number @p number
79 QList<Isotope*> isotopes( int number );
81 /**
82 * @return the isotopes of the Element @p Element
84 QList<Isotope*> isotopes( Element * element );
86 /**
87 * @return the Spectrum of the Element with the number @p number
89 Spectrum * spectrum( int number );
91 QPixmap pixmap( int number );
93 /**
94 * Use this to get the number of elements we have. It is cached
95 * so you are strongly suggested to use this instead of hardcode
96 * the number of elements.
97 * @return the number of elements we have
99 int numberOfElements() const { return m_numOfElements; }
101 private:
102 KalziumDataObject();
103 ~KalziumDataObject();
105 QList<QPixmap> PixmapList;
107 QHash<int, QList<Isotope*> > m_isotopes;
108 QList<Spectrum*> m_spectra;
111 * Caching the number of elements
113 int m_numOfElements;
115 Search *m_search;
117 #endif // KALZIUMDATAOBJECT_H