# preferences.h

    00001 // -*- C++ -*-
    00002
    00003 /*
    00004  * GChemPaint library
    00005  * preferences.h
    00006  *
    00007  * Copyright (C) 2006-2007 Jean Bréfort <jean.brefort@normalesup.org>
    00008  *
    00009  * This program is free software; you can redistribute it and/or
    00010  * modify it under the terms of the GNU General Public License as
    00011  * published by the Free Software Foundation; either version 2 of the
    00012  * License, or (at your option) any later version.
    00013  *
    00014  * This program is distributed in the hope that it will be useful,
    00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00017  * GNU General Public License for more details.
    00018  *
    00019  * You should have received a copy of the GNU General Public License
    00020  * along with this program; if not, write to the Free Software
    00021  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
    00022  * USA
    00023  */
    00024
    00025 #ifndef GCP_PREFERENCES_H
    00026 #define GCP_PREFERENCES_H
    00027
    00028 #include "fontsel.h"
    00029 #include <gcu/dialog.h>
    00030 #include <gcu/object.h>
    00031 #include <gcu/macros.h>
    00032
    00034 namespace gcp {
    00035
    00036 class Application;
    00037 class Theme;
    00038
    00043 class PrefsDlg: public gcu::Dialog, gcu::Object
    00044 {
    00045 friend class PrefsDlgPrivate;
    00046 public:
    00052         PrefsDlg (Application *pApp);
    00056         virtual ~PrefsDlg ();
    00057
    00058 private:
    00059         void OnSelectTheme (GtkTreeSelection *selection);
    00060         void OnBondLength (double length);
    00061         void OnBondAngle (double angle);
    00062         void OnBondWidth (double width);
    00063         void OnBondDist (double dist);
    00064         void OnStereoBondWidth (double width);
    00065         void OnHashWidth (double width);
    00066         void OnHashDist (double dist);
    00067         void OnFont (GcpFontSel *fs);
    00068         void OnTextFont (GcpFontSel *fs);
    00069         void OnArrowLength (double length);
    00070         void OnArrowWidth (double width);
    00071         void OnArrowDist (double dist);
    00072         void OnArrowPadding (double padding);
    00073         void OnArrowHeadA (double headA);
    00074         void OnArrowHeadB (double headB);
    00075         void OnArrowHeadC (double headC);
    00076         void OnScale (double scale);
    00077         void OnPadding (double padding);
    00078         void OnObjectPadding (double padding);
    00079         void OnStoichPadding (double padding);
    00080         void OnSignPadding (double padding);
    00081         void OnChargeSize (double size);
    00082         void OnThemeNameChanged (char const *name);
    00083         bool CheckError ();
    00084         void SetDefaultTheme (char const *name);
    00085
    00086 private:
    00087         Theme *m_CurTheme;
    00088         GtkTreeStore *themes;
    00089         GtkTreeSelection *m_ThemesSelection;
    00090         GtkTreeView *m_ThemesView;
    00091         GtkNotebook *m_Book;
    00092         GtkSpinButton *m_BondLengthBtn, *m_BondWidthBtn, *m_BondAngleBtn, *m_BondDistBtn;
    00093         GtkSpinButton *m_StereoBondWidthBtn, *m_HashDistBtn, *m_HashWidthBtn;
    00094         GtkSpinButton *m_ArrowLengthBtn, *m_ArrowWidthBtn, *m_ArrowDistBtn, *m_ArrowPaddingBtn;
    00095         GtkSpinButton *m_ArrowHeadABtn, *m_ArrowHeadBBtn, *m_ArrowHeadCBtn;
    00096         GtkSpinButton *m_ScaleBtn, *m_PaddingBtn, *m_ObjectPaddingBtn, *m_StoichPaddingBtn, *m_SignPaddingBtn;
    00097         GtkSpinButton *m_ChargeSizeBtn;
    00098         GtkEntry *m_NameEntry;
    00099         GcpFontSel *m_TextFontSel, *m_FontSel;
    00100         gulong m_NameActivate, m_NameFocusOut, m_TextFontChanged, m_FontChanged;
    00101         GtkTreePath *m_Path;
    00102         GtkComboBox *m_DefaultThemeBox;
    00103 };
    00104
    00105 }       //      namespace gcp
    00106
    00107 #endif  //      GCP_PREFERENCES_H