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 00020 #ifndef SAMBA_H 00021 #define SAMBA_H 00022 00023 #include <QWidget> 00024 #include <QStringList> 00025 #include <QVariant> 00026 #include "kockpitifaces.h" 00027 #include "ui_postgres.h" 00028 #include "dbmodule.h" 00029 #include "xmlmapreader.h" 00030 #include "kockpithelpers.h" 00031 #include "xmlconfigreader.h" 00032 00034 00037 class Postgres: public QWidget, public KockpitIface, public Ui::Postgres{ 00038 00039 Q_OBJECT 00040 Q_INTERFACES(KockpitIface) 00041 00042 public: 00043 00044 Postgres(QWidget *parent = 0); 00045 virtual ~Postgres(); 00046 QString getName(); 00047 QWidget* getUserWidget(); 00048 QWidget* getGroupWidget(); 00049 00050 void showAttributes(KockpitUser *kuser); 00051 void assignAttributes(KockpitUser *kuser); 00052 void showAttributes(KockpitGroup *kgrp); 00053 void assignAttributes(KockpitGroup *kgrp); 00054 void init(const QList<KockpitUnitMap*> *kumap, const QList<KockpitUnitMap*> *kgmap, KockpitValidator *val); 00055 void update(const QList<KockpitUnitMap *> *kumap, const QList<KockpitUnitMap *> *kgmap); 00056 00057 void writeAdditional(QList<KockpitGroup*> &kgrpl, wraddmod mod); 00058 void writeAdditional(QList<KockpitUser*> &kusr, wraddmod mod); 00059 00060 virtual void deleteEntry(KockpitGroup *kgrp); 00061 virtual void deleteEntry(KockpitUser *kuser); 00062 00063 private: 00064 00065 void build(const QList<KockpitUnitMap*> *kumap, const QList<KockpitUnitMap*> *kgmap); 00066 00067 void resetLists(); 00068 00069 QList<KockpitUnitMap*> kumap; 00070 QList<KockpitUnitMap*> kgmap; 00071 00072 KockpitUser *selectedUser; 00073 KockpitGroup *selectedGroup; 00074 00075 KockpitBaseObj group; 00076 KockpitBaseObj user; 00077 KockpitAuthObj auth; 00078 00079 DBModule dbmod; 00080 }; 00081 00082 #endif // SAMBA_H