#include <QColor>
#include <QList>
+#include <QVariant>
#include <kdemacros.h>
return m_origin;
}
+ /**
+ * The orbit of for example Lithium (Li) is "He 2s1"
+ * @return the orbital structure of the element
+ */
QString orbits() const{
return m_orbits;
}
doubleList m_ionenergies;
};
+/**
+ * @author Carsten Niehaus <cniehaus@kde.org
+ */
+class ChemicalDataObject
+{
+ public:
+ /**
+ * The BlueObelisk-project defines in their xml-file the dataset
+ * with the names of the enum plus 'bo:'. So for symbol
+ * it is 'bo:symbol'. To avoid confusion I will choose the very
+ * same naming
+ */
+ enum BlueObelisk
+ {
+ atomicNumber = 0 /**< The atomic number of the element */,
+ symbol/**< the symbol of the element */,
+ name/**< The IUPAC-name of the element */,
+ mass/**< # IUPAC Official Masses */,
+ exactMass/**< exact masses of the most common isotopes for each element */,
+ ionization/**< First inizationenergy */,
+ electronAffinity/**< the electronaffinity of the element */,
+ electronegativityPauling/**< the electronegativity in the definition of Pauling*/,
+ radiusCovalent/**< the covalent radius */,
+ radiusVDW/**< the van der Waals radius */
+ };
+
+ /**
+ * public constructor
+ */
+ ChemicalDataObject();
+
+ /**
+ * public constructor
+ * @param v the data of the object
+ * @param type the type of the data
+ */
+ ChemicalDataObject(QVariant v,
+ BlueObelisk type);
+
+ /**
+ * set the data of this object to @p v
+ */
+ void setData( QVariant *v ){
+ m_value = v;
+ }
+
+ /**
+ * public destructor
+ */
+ ~ChemicalDataObject();
+
+ /**
+ * Every ChemicalDataObject contains one data. For example a
+ * integer value which represents the boilingpoint. This method
+ * returns the value as a QString
+ *
+ * For bool, the returned string will be "false" or "true"
+ * For a QString, the QString will be returned
+ * For a int or double, the value will be returned as a QString
+ *
+ * @return the value as a QString.
+ */
+ QString valueAsString();
+
+ /**
+ * Every ChemicalDataObject contains one data. For example a
+ * integer value which represents the boilingpoint. This method
+ * returns the value as a QVariant
+ *
+ * @return the value as a QVariant.
+ */
+ QVariant value() const{
+ return m_value;
+ }
+
+ /**
+ * @return the type of dataset of this object
+ */
+ BlueObelisk type() const{
+ return m_type;
+ }
+
+ /**
+ * @param type the type of this object
+ */
+ void setType( BlueObelisk type ){
+ m_type = type;
+ }
+
+ /**
+ * @overload
+ */
+ void setType( int type ){
+ m_type = ( BlueObelisk ) type;
+ }
+
+ private:
+ QVariant m_value;
+ BlueObelisk m_type;
+};
#endif
* *
***************************************************************************/
-#include <QString>
#include <QList>
-#include <QStringList>
-#include <qdom.h>
#include <qxml.h>
class Element;
-//X /**
-//X * This class gives access to the elements which are listed in a CML-file
-//X * @author Carsten Niehaus <cniehaus@kde.org>
-//X */
-//X class ElementParser
-//X {
-//X public:
-//X /**
-//X * @return the Element with the symbol symbol
-//X * @param dataDocument the document to parse
-//X * @param symbol the symbol of the Element which is looked for
-//X */
-//X static Element* loadElement( const QString& symbol, const QDomDocument& dataDocument );
-//X
-//X /**
-//X * @return the element represented in the QDomeElement @p element
-//X * @param element the XML-representation of the Element
-//X */
-//X static Element* loadElement( const QDomElement& element );
-//X
-//X /**
-//X * @return all chemical elements in the xml-file
-//X * @param dataDocument the document to parse
-//X */
-//X static QList<Element*> loadAllElements(const QDomDocument& dataDocument);
-//X
-//X private:
-//X /**
-//X * @return a QStringList with the symbols of all known elements
-//X * @param dataDocument the document to parse
-//X */
-//X static QStringList loadElementSymbols(const QDomDocument& dataDocument);
-//X
-//X };
-
-
class ElementSaxParser : public QXmlDefaultHandler
{
public:
bool inElement_;
bool inName_,
inMass_,
- inSymbol_,
- inAtomicNumber_;
+ inAtomicNumber_,
+ inSymbol_;
};
#endif // ELEMENTPARSER_H