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 #ifndef KOCKPITUNIT_H 00019 #define KOCKPITUNIT_H 00020 00021 #include <QObject> 00022 #include <iostream> 00023 #include <QString> 00024 #include <QStringList> 00025 #include <QVariant> 00026 00028 00031 typedef enum { 00032 KOCKPIT_USER, 00033 KOCKPIT_GROUP 00034 } objtype; 00035 00037 00040 typedef enum { 00041 BACKEND_LOADED, 00042 APPL_CREATED, 00043 APPL_CHANGED 00044 } objmode; 00045 00047 00050 struct KockpitBaseObj { 00051 QString loc; 00052 QStringList mapfiles; 00053 objtype type; 00054 }; 00055 00057 00060 struct KockpitAuthObj { 00061 QString id; 00062 QString pass; 00063 QString host; 00064 QString conid; 00065 QString dbname; 00066 QString dbtype; 00067 int port; 00068 }; 00069 00071 00075 class KockpitUnit { 00076 00077 public: 00079 virtual ~KockpitUnit() { } 00080 00082 00086 virtual QString toQString() const = 0; 00087 00089 00092 virtual QString getDistName() const = 0; 00093 00095 00098 virtual objtype getObjType() const = 0; 00099 00101 00104 virtual objmode getObjMode() const = 0; 00105 00107 00110 virtual void setObjMode(objmode unitmode) = 0; 00111 00113 00118 friend std::ostream& operator <<(std::ostream& output, const KockpitUnit& kunit); 00119 00120 protected: 00122 objtype type; 00124 objmode unitmode; 00125 00126 }; 00127 00128 Q_DECLARE_METATYPE(KockpitUnit*); 00129 00130 #endif // KOCKPITUNIT_H