00001 /*************************************************************************** 00002 * Copyright (C) 2006 by Graeme Foster * 00003 * email foster.graeme@gmail.com * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00019 ***************************************************************************/ 00020 00021 #ifndef __NAME_ROOT_DLG_H 00022 #define __NAME_ROOT_DLG_H 00023 00024 #include <QtGui> 00025 00026 #include "sql.h" 00027 00028 #include "Root_dlg.h" 00029 #include "Name_wdgt.h" 00030 00031 #include "RootItem.h" 00032 00033 class NameRootDlg : virtual public RootDlg 00034 { 00035 Q_OBJECT 00036 00037 public: // methods 00038 NameRootDlg(int textWidth, QString textLabel, QMainWindow *parent = 0); 00039 // Encapsulation methods 00040 inline QString getName () {return n_wdgt->getName();} 00041 inline void setName (QString name) {n_wdgt->setName(name);} 00042 inline void setLabel (QString label) {n_wdgt->setLabel(label);} 00043 inline void setNameLength(int len){n_wdgt->setNameLength(len);} 00044 inline void disableControls(){ n_wdgt->disableControls();} 00045 inline void disableName(){n_wdgt->disableName();} 00046 00047 protected: // Properties 00048 NameWidget * n_wdgt; 00049 bool enableBtn(QString oldName 00050 ,int parentID 00051 ,RootItem * rootItem 00052 ,sql * dbConn 00053 ,bool (*pUniqueName)(QString, int, sql*) 00054 ); 00055 00056 private: // Methods 00057 00058 private: 00059 00060 }; 00061 00062 #endif