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 KOCKPITUNITMAP_H 00019 #define KOCKPITUNITMAP_H 00020 00021 #include <stdarg.h> 00022 #include <QObject> 00023 #include <QVariant> 00024 00025 #include "kockpitmap.h" 00026 #include "kockpitunitmap.h" 00027 #include "kockpituser.h" 00028 #include "kockpitgroup.h" 00029 #include "xmlmapreader.h" 00030 00032 00036 class KockpitUnitMap: public QObject { 00037 00038 Q_OBJECT 00039 00040 public: 00042 KockpitUnitMap(){ } 00043 00045 00051 KockpitUnitMap(KockpitUser* kuser,const QStringList &mapfiles,QObject *parent=0); 00052 00054 00060 KockpitUnitMap(KockpitGroup* kgrp,const QStringList &mapfiles,QObject *parent=0); 00061 00063 00067 KockpitUnitMap(const KockpitUnitMap& kmap); 00068 00070 00075 virtual ~KockpitUnitMap(); 00076 00078 00081 void deleteKunit(); 00082 00084 00087 virtual KockpitUnit* getKunit() const; 00088 00090 00096 virtual KockpitUser* getKockpitUser(caller cal = APP) const; 00097 00099 00105 virtual KockpitGroup* getKockpitGroup(caller cal = APP) const; 00106 00108 00113 const KockpitMap* getMap() const; 00114 00116 00120 void operator=(const KockpitUnitMap& kmap); 00121 00123 00128 friend std::ostream& operator <<(std::ostream& output, const KockpitUnitMap& kumap); 00129 00130 private: 00132 KockpitUnit *kunit; 00134 KockpitMap *map; 00136 XMLMapReader *reader; 00137 00139 00144 bool readFiles(); 00145 00147 QStringList mapfiles; 00148 }; 00149 00150 Q_DECLARE_METATYPE(KockpitUnitMap*); 00151 00152 #endif // KOCKPITUNITMAP_H