00001 /* 00002 * $Id$ 00003 * Kockpit - an Qt application for user/group management on unix based systems. 00004 * 00005 * Copyright (C) 2010 Julian Thome 00006 * 00007 * This program is free software; you can redistribute it and/or modify it under the terms of 00008 * the GNU General Public License as published by the Free Software Foundation; 00009 * either version 3 of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 00012 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00013 * See the GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License along with this program; 00016 * if not, see <http://www.gnu.org/licenses/>. 00017 */ 00018 00019 #ifndef KOCKPITADDRESS_H 00020 #define KOCKPITADDRESS_H 00021 00022 #include <QObject> 00023 #include <QVariant> 00024 #include <QString> 00025 #include <QStringList> 00026 #include <iostream> 00027 #include <string> 00028 00030 00033 class KockpitAddress: public QObject { 00034 00035 // XMLMapReader should habe direct access to the attribute values. 00036 friend class XMLMapReader; 00037 00038 Q_OBJECT 00039 // Make the following attributes accessible in the QtScript engine 00040 Q_PROPERTY(QString postalAddress READ getPostalAddress WRITE setPostalAddress) 00041 Q_PROPERTY(QString postalCode READ getPostalCode WRITE setPostalCode) 00042 Q_PROPERTY(QString officeBox READ getOfficeBox WRITE setOfficeBox) 00043 Q_PROPERTY(QString street READ getStreet WRITE setStreet) 00044 Q_PROPERTY(QString city READ getCity WRITE setCity) 00045 Q_PROPERTY(QString country READ getCountry WRITE setCountry) 00046 Q_PROPERTY(QString officeName READ getOfficeName WRITE setOfficeName) 00047 00048 public: 00050 KockpitAddress(){ } 00051 00053 00062 KockpitAddress(const QString &postalCode, const QString &officeBox, 00063 const QString &street, const QString &city, const QString &country, 00064 const QString &postalAddress, const QString &officeName); 00065 00067 00071 KockpitAddress(const KockpitAddress& address); 00072 00074 virtual ~KockpitAddress(){ } 00075 00077 00081 QString toQString() const; 00082 00084 00089 friend std::ostream& operator <<(std::ostream& output, const KockpitAddress& kaddr); 00090 00092 00096 void operator=(const KockpitAddress& address); 00097 00098 public slots: 00100 QString getPostalCode() const; 00102 QString getOfficeBox() const; 00104 QString getStreet() const; 00106 QString getCity() const; 00108 QString getCountry() const; 00110 QString getPostalAddress() const; 00112 QString getOfficeName() const; 00113 00115 void setPostalCode(const QString &postalCode); 00117 void setOfficeBox(const QString &officeBox); 00119 void setStreet(const QString &street); 00121 void setCity(const QString &city); 00123 void setCountry(const QString &country); 00125 void setPostalAddress(const QString &postalAdress); 00127 void setOfficeName(const QString &officeName); 00128 00129 protected: 00131 QString postalCode; 00133 QString officeBox; 00135 QString street; 00137 QString city; 00139 QString country; 00141 QString postalAddress; 00143 QString officeName; 00144 }; 00145 00146 Q_DECLARE_METATYPE(KockpitAddress*); 00147 00148 #endif // KOCKPITADDRESS_H