PropertyPage.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (c) 2004 Werner Mayer <wmayer[at]users.sourceforge.net>     *
00003  *                                                                         *
00004  *   This file is part of the FreeCAD CAx development system.              *
00005  *                                                                         *
00006  *   This library is free software; you can redistribute it and/or         *
00007  *   modify it under the terms of the GNU Library General Public           *
00008  *   License as published by the Free Software Foundation; either          *
00009  *   version 2 of the License, or (at your option) any later version.      *
00010  *                                                                         *
00011  *   This library  is distributed in the hope that it will be useful,      *
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00014  *   GNU Library General Public License for more details.                  *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Library General Public     *
00017  *   License along with this library; see the file COPYING.LIB. If not,    *
00018  *   write to the Free Software Foundation, Inc., 59 Temple Place,         *
00019  *   Suite 330, Boston, MA  02111-1307, USA                                *
00020  *                                                                         *
00021  ***************************************************************************/
00022 
00023 
00024 #ifndef GUI_DIALOG_PROPERTYPAGE_H
00025 #define GUI_DIALOG_PROPERTYPAGE_H
00026 
00027 #include <QWidget>
00028 
00029 namespace Gui {
00030 namespace Dialog {
00031 
00035 class GuiExport PropertyPage : public QWidget
00036 {
00037     Q_OBJECT
00038 
00039 public:
00040     PropertyPage(QWidget* parent = 0);
00041     virtual ~PropertyPage();
00042 
00043     bool isModified();
00044     void setModified(bool b);
00045     void onApply();
00046     void onCancel();
00047     void onReset();
00048 
00049 protected:
00050     virtual void apply();
00051     virtual void cancel();
00052     virtual void reset();
00053 
00054 private:
00055     bool bChanged; 
00057 protected Q_SLOTS:
00058     virtual void loadSettings()=0;
00059     virtual void saveSettings()=0;
00060 };
00061 
00065 class GuiExport PreferencePage : public QWidget
00066 {
00067     Q_OBJECT
00068 
00069 public:
00070     PreferencePage(QWidget* parent = 0);
00071     virtual ~PreferencePage();
00072 
00073 public Q_SLOTS:
00074     virtual void loadSettings()=0;
00075     virtual void saveSettings()=0;
00076 
00077 protected:
00078     virtual void changeEvent(QEvent *e) = 0;
00079 };
00080 
00084 class GuiExport PreferenceUiForm : public PreferencePage
00085 {
00086     Q_OBJECT
00087 
00088 public:
00089     PreferenceUiForm(const QString& fn, QWidget* parent = 0);
00090     virtual ~PreferenceUiForm();
00091 
00092     void loadSettings();
00093     void saveSettings();
00094 
00095 protected:
00096     void changeEvent(QEvent *e);
00097 
00098 private:
00099     template <typename PW>
00100     void loadPrefWidgets();
00101     template <typename PW>
00102     void savePrefWidgets();
00103 
00104 private:
00105     QWidget* form;
00106 };
00107 
00111 class GuiExport CustomizeActionPage : public QWidget
00112 {
00113     Q_OBJECT
00114 
00115 public:
00116     CustomizeActionPage(QWidget* parent = 0);
00117     virtual ~CustomizeActionPage();
00118 
00119 protected:
00120     bool event(QEvent* e);
00121     virtual void changeEvent(QEvent *e) = 0;
00122 
00123 protected Q_SLOTS:
00124     virtual void onAddMacroAction(const QByteArray&)=0;
00125     virtual void onRemoveMacroAction(const QByteArray&)=0;
00126     virtual void onModifyMacroAction(const QByteArray&)=0;
00127 };
00128 
00129 } // namespace Dialog
00130 } // namespace Gui
00131 
00132 #endif // GUI_DIALOG_PROPERTYPAGE_H

Generated on Wed Nov 23 19:00:31 2011 for FreeCAD by  doxygen 1.6.1