umbrello API Documentation

settingsdlg.h

00001 /***************************************************************************
00002  *                                                                         *
00003  *   This program is free software; you can redistribute it and/or modify  *
00004  *   it under the terms of the GNU General Public License as published by  *
00005  *   the Free Software Foundation; either version 2 of the License, or     *
00006  *   (at your option) any later version.                                   *
00007  *                                                                         *
00008  *  copyright (C) 2002-2006                                                *
00009  *  Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                   *
00010  ***************************************************************************/
00011 
00012 
00013 #ifndef SETTINGSDLG_H
00014 #define SETTINGSDLG_H
00015 //qt includes
00016 #include <qgroupbox.h>
00017 #include <qcheckbox.h>
00018 #include <qpushbutton.h>
00019 #include <qlabel.h>
00020 #include <qradiobutton.h>
00021 #include <qbuttongroup.h>
00022 #include <qdict.h>
00023 //kde includes
00024 #include <kcombobox.h>
00025 #include <kfontdialog.h>
00026 #include <kdialogbase.h>
00027 #include <kcolorbutton.h>
00028 #include <knuminput.h>
00029 //app includes
00030 
00031 #include "../optionstate.h"
00032 
00033 class CodeGenerationOptionsPage;
00034 class CodeViewerOptionsPage;
00035 class CodeGenerator;
00036 
00043 class SettingsDlg : public KDialogBase {
00044 
00045     Q_OBJECT
00046 
00047 public:
00048     SettingsDlg(QWidget * parent, Settings::OptionState *state);
00049     ~SettingsDlg();
00050 
00051     //public methods
00052     bool getChangesApplied() {
00053         return m_bChangesApplied;
00054     }
00055 
00056     QString getCodeGenerationLanguage();
00057 
00058 protected:
00062     void insertDiagram( const QString& type, int index = -1 );
00066     void insertAttribScope( const QString& type, int index = -1 );
00070     void insertOperationScope( const QString& type, int index = -1 );
00071 
00072 private:
00073     //private structs
00074     struct UIWidgets {
00075         QGroupBox * colorGB;
00076 
00077         QLabel * lineColorL;
00078         QLabel * fillColorL;
00079         QLabel * lineWidthL;
00080 
00081         QPushButton * lineDefaultB;
00082         QPushButton * fillDefaultB;
00083         QPushButton * lineWidthDefaultB;
00084 
00085         KColorButton * lineColorB;
00086         KColorButton * fillColorB;
00087         KIntSpinBox  * lineWidthB;
00088 
00089         QCheckBox * useFillColorCB;
00090     }
00091     ;//end struct UIWidgets
00092 
00093     struct GeneralWidgets {
00094         QGroupBox * miscGB;
00095         QGroupBox * autosaveGB;
00096         QGroupBox * startupGB;
00097 
00098         KIntSpinBox * timeISB;
00099         KComboBox * diagramKB;
00100 
00101         QCheckBox * undoCB;
00102         QCheckBox * tabdiagramsCB;
00103         QCheckBox * newcodegenCB;
00104         QCheckBox * angularLinesCB;
00105         QCheckBox * autosaveCB;
00106         QCheckBox * logoCB;
00107         QCheckBox * tipCB;
00108         QCheckBox * loadlastCB;
00109 
00110         // 2004-05-17 Achim Spangler: Allow definition of Suffix for autosave
00111         // ( Default: ".xmi" )
00112         QLineEdit * autosaveSuffixT;
00113         QLabel    * autosaveSuffixL;
00114         // End AutoSave Suffix
00115 
00116         QLabel * startL;
00117         QLabel *  autosaveL;
00118     }
00119     ;//end struct GeneralWidgets
00120 
00121     struct ClassWidgets {
00122         QGroupBox * visibilityGB;
00123         QGroupBox * scopeGB;
00124 
00125         QCheckBox * showVisibilityCB;
00126         QCheckBox * showAttsCB;
00127         QCheckBox * showOpsCB;
00128         QCheckBox * showStereotypeCB;
00129         QCheckBox * showAttSigCB;
00130         QCheckBox * showPackageCB;
00131 
00132         QCheckBox * showOpSigCB;
00133 
00134         QLabel * attributeLabel;
00135         QLabel * operationLabel;
00136 
00137         KComboBox* m_pAttribScopeCB;
00138         KComboBox* m_pOperationScopeCB;
00139 
00140     }
00141     ;//end struct ClassWidgets
00142 
00143     struct FontWidgets {
00144         KFontChooser * chooser;
00145     };
00146 
00147     //private methods
00148     void setupFontPage();
00149     void setupUIPage();
00150     void setupGeneralPage();
00151     void setupClassPage();
00152     void setupCodeGenPage();
00153     void setupCodeViewerPage(Settings::CodeViewerState options);
00154     void applyPage( Settings::Page page );
00155 
00156     //private attributes
00157     FontWidgets m_FontWidgets;
00158     GeneralWidgets m_GeneralWidgets;
00159     UIWidgets m_UiWidgets;
00160     ClassWidgets m_ClassWidgets;
00161     Settings::OptionState *m_pOptionState;
00162     CodeGenerationOptionsPage * m_pCodeGenPage;
00163     CodeViewerOptionsPage * m_pCodeViewerPage;
00164 
00165     KConfig * m_pCfg;
00166     bool m_bChangesApplied;
00167 
00168 private slots:
00169     void slotApply();
00170     void slotOk();
00171     void slotDefault();
00172     void slotLineBClicked();
00173     void slotFillBClicked();
00174     void slotAutosaveCBClicked();
00175 };
00176 
00177 #endif
KDE Logo
This file is part of the documentation for umbrello Version 3.1.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Jun 26 08:08:00 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003