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 KOCKPITMAP_H 00020 #define KOCKPITMAP_H 00021 00022 #include <QObject> 00023 #include <QString> 00024 #include <QList> 00025 #include "kockpitunit.h" 00026 #include "attributemap.h" 00027 00028 // who calls the function (plugin or application) 00030 00033 typedef enum { 00034 APP, 00035 PLUGIN 00036 } caller; 00037 00039 00043 class KockpitMap: public QObject { 00044 00045 Q_OBJECT 00046 // XMLMapReader should habe direct access to the attribute values. 00047 friend class XMLMapReader; 00048 00049 public: 00051 00055 KockpitMap(KockpitUser *kuser, QObject *parent=0); 00056 00058 00062 KockpitMap(KockpitGroup *kgrp, QObject *parent=0); 00063 00065 00069 KockpitMap(const KockpitMap &kmap); 00070 00072 virtual ~KockpitMap(){ } 00073 00075 00079 QListIterator<AttributeMap> getIterator() const; 00080 00082 00085 KockpitUnit* getKunit(); 00086 00088 00094 virtual KockpitUser* getKockpitUser(caller cal = APP) const; 00095 00097 00103 virtual KockpitGroup* getKockpitGroup(caller cal = APP) const; 00104 00106 00110 virtual bool hasAttributeMaps() const; 00111 00112 00114 00119 friend std::ostream& operator <<(std::ostream& output, const KockpitMap& kmap); 00120 00121 protected: 00123 QList<AttributeMap> attrsMap; 00124 00125 private: 00127 KockpitUnit *kunit; 00128 }; 00129 00130 Q_DECLARE_METATYPE(KockpitMap*); 00131 00132 #endif // KOCKPITMAP_H