• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

ap_UnixDialog_Options.h

Go to the documentation of this file.
00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */
00002 
00003 /* AbiWord
00004  * Copyright (C) 1998 AbiSource, Inc.
00005  * Copyright (C) 2009 Hubert Figuiere
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00020  * 02110-1301 USA.
00021  */
00022 
00023 #ifndef AP_UNIXDIALOG_OPTIONS_H
00024 #define AP_UNIXDIALOG_OPTIONS_H
00025 
00026 #ifdef HAVE_CONFIG_H
00027 #include "config.h"
00028 #endif
00029 
00030 #include "ap_Dialog_Options.h"
00031 
00032 class XAP_UnixFrame;
00033 
00034 /*****************************************************************/
00035 class AP_UnixDialog_Options : public AP_Dialog_Options,
00036                               public XAP_NotebookDialog
00037 {
00038 public:
00039     AP_UnixDialog_Options(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id);
00040     virtual ~AP_UnixDialog_Options(void);
00041 
00042     virtual void            runModal(XAP_Frame * pFrame);
00043 
00044     static XAP_Dialog *     static_constructor(XAP_DialogFactory *, XAP_Dialog_Id id);
00045     void event_ChooseTransparentColor(void);
00046 
00047     // tabbed dialog interface
00048     virtual void addPage (const XAP_NotebookDialog::Page *page);
00049 
00050  protected:
00051 
00052     GtkWidget *_lookupWidget( tControl id );
00053     virtual void _controlEnable( tControl id, bool value );
00054 
00055     // we implement these so the XP dialog can set/grab our data
00056 #define SET_GATHER(a,t) virtual t _gather##a(void);  \
00057                         virtual void _set##a(t)
00058 
00059 
00060     SET_GATHER          (NotebookPageNum,       int);
00061 
00062 //  // Tabs
00063 //      // Categories
00064 //          // Subordinate Controls
00065 
00066     // General
00067 
00068         // User Interface
00069 
00070         SET_GATHER (ViewRulerUnits,  UT_Dimension);
00071 
00072     // not implemented
00073     virtual bool _gatherViewCursorBlink(void) { return true; }
00074     virtual void _setViewCursorBlink(const bool) {}
00075 
00076         // Application Startup
00077 
00078         SET_GATHER (AutoLoadPlugins,     bool);
00079 
00080     // Documents
00081 
00082         // AutoSave
00083 
00084         SET_GATHER (AutoSaveFile,         bool);
00085             virtual void _gatherAutoSaveFilePeriod (      UT_String &stRetVal);
00086             virtual void _setAutoSaveFilePeriod    (const UT_String &stPeriod);
00087             virtual void _gatherAutoSaveFileExt    (      UT_String &stRetVal);
00088             virtual void _setAutoSaveFileExt       (const UT_String &stExt);
00089 
00090         // RTL Text Layout
00091 
00092         SET_GATHER (OtherDirectionRtl,        bool);
00093 
00094     // Spell Checking
00095 
00096         // General
00097 
00098         SET_GATHER (SpellCheckAsType, bool);
00099         SET_GATHER (SpellHideErrors,  bool);
00100 
00101         // Ignore Words
00102 
00103         SET_GATHER (SpellUppercase,   bool);
00104         SET_GATHER (SpellNumbers,     bool);
00105 
00106         // Dictionaries
00107 
00108         SET_GATHER (SpellSuggest,     bool);
00109         SET_GATHER (SpellMainOnly,    bool);
00110 
00111         // Grammar Check
00112 
00113         SET_GATHER (GrammarCheck,    bool);
00114 
00115     // Smart Quotes
00116 
00117         SET_GATHER (SmartQuotes,   bool);
00118         SET_GATHER (CustomSmartQuotes,   bool);
00119         SET_GATHER (OuterQuoteStyle,    gint);
00120         SET_GATHER (InnerQuoteStyle,    gint);
00121 
00122     // unimplemented UI-wise. We need dummy implementations to satisfy the XP framework, though
00123 
00124     SET_GATHER          (PrefsAutoSave,         bool);
00125     SET_GATHER          (ViewShowRuler,         bool);
00126     SET_GATHER          (ViewShowStatusBar,     bool);
00127     SET_GATHER          (ViewAll,           bool);
00128     SET_GATHER          (ViewHiddenText,        bool);
00129     SET_GATHER          (ViewUnprintable,       bool);
00130     SET_GATHER          (EnableSmoothScrolling,     bool);
00131     SET_GATHER          (EnableOverwrite,       bool);
00132 #undef SET_GATHER
00133 
00134  protected:
00135 
00136     // private construction functions
00137     void        _setupUnitMenu(GtkWidget *optionmenu, const XAP_StringSet *pSS);
00138     void        _constructWindowContents(GtkBuilder *builder);
00139     GtkWidget * _constructWindow(void);
00140 
00141     // pointers to widgets we need to query/set
00142     // there are a ton of them in this dialog
00143 
00144     GtkWidget * m_windowMain;
00145     GtkWidget * m_notebook;
00146     GtkWidget * m_buttonDefaults;
00147     GtkWidget * m_buttonClose;
00148 
00149 //  // Tabs
00150 //      // Categories
00151 //          // Subordinate Controls
00152 
00153     // General
00154 
00155         // User Interface
00156 
00157         GtkWidget *m_pushbuttonNewTransparentColor;
00158         GtkWidget *m_menuUnits;
00159 
00160             // used inside the color selector
00161 
00162             GtkWidget *m_buttonColSel_Defaults;
00163 
00164         // Application Startup
00165 
00166         GtkWidget *m_checkbuttonAutoLoadPlugins;
00167 
00168     // Documents
00169 
00170         // General
00171 
00172         GtkWidget *m_checkbuttonAutoSaveFile;
00173             GtkWidget *m_tableAutoSaveFile;
00174                 GtkWidget *m_textAutoSaveFilePeriod;
00175                 GtkWidget *m_textAutoSaveFileExt;
00176 
00177         // RTL Text Layout
00178 
00179         GtkWidget * m_checkbuttonOtherDirectionRtl;
00180 
00181     // Spell Checking
00182 
00183         // General
00184 
00185         GtkWidget *m_checkbuttonSpellCheckAsType;
00186         GtkWidget *m_checkbuttonSpellHideErrors;
00187 
00188         // Ignore Words
00189 
00190         GtkWidget *m_checkbuttonSpellUppercase;
00191         GtkWidget *m_checkbuttonSpellNumbers;
00192 
00193         // Dictionaries
00194 
00195         GtkWidget *m_checkbuttonSpellSuggest;
00196         GtkWidget *m_checkbuttonSpellMainOnly;
00197 
00198         // Grammar Checking
00199 
00200         GtkWidget *m_checkbuttonGrammarCheck;
00201 
00202         // Smart Quotes
00203 
00204         GtkWidget *m_checkbuttonSmartQuotes;
00205         GtkWidget *m_checkbuttonCustomSmartQuotes;
00206         GtkWidget *m_omOuterQuoteStyle;
00207         GtkWidget *m_omInnerQuoteStyle;
00208 
00209     GtkWidget *m_checkbuttonEnableOverwrite;
00210 
00211             // Dummy
00212         bool m_boolEnableSmoothScrolling;
00213         bool m_boolPrefsAutoSave;
00214         bool m_boolViewAll;
00215         bool m_boolViewHiddenText;
00216         bool m_boolViewShowRuler;
00217         bool m_boolViewShowStatusBar;
00218         bool m_boolViewUnprintable;
00219 private:
00220     // Unix call back handlers
00221     static void s_control_changed        (GtkWidget *,     gpointer);
00222     static void s_apply_clicked      (GtkWidget *,         gpointer);
00223     static void s_defaults_clicked       (GtkWidget *,         gpointer);
00224     static void s_chooseTransparentColor (GtkWidget *,         gpointer);
00225     static void s_real_color_changed(GdkRGBA & gdkcolor, AP_UnixDialog_Options * dlg);
00226     static void s_color_changed      (GtkColorChooser *, GdkRGBA*, gpointer);
00227     static void s_auto_save_toggled      (GtkToggleButton *,   gpointer);
00228     static void s_checkbutton_toggle     (GtkWidget *,     gpointer);
00229     static gint s_menu_item_activate     (GtkWidget *,     gpointer);
00230     void        _setupSmartQuotesCombos( GtkWidget *optionmenu );
00231 
00232     // callbacks can fire these events
00233     virtual void _storeWindowData(void);
00234 
00235     GSList  *m_extraPages;
00236 };
00237 
00238 #endif /* AP_UNIXDIALOG_OPTIONS_H */
00239 

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1