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

ap_Win32Dialog_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  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program 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 General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00019  * 02110-1301 USA.
00020  */
00021 
00022 #ifndef AP_WIN32DIALOG_OPTIONS_H
00023 #define AP_WIN32DIALOG_OPTIONS_H
00024 
00025 #include "ut_vector.h"
00026 #include "ap_Dialog_Options.h"
00027 #include "xap_Win32PropertySheet.h"
00028 #include "xap_Frame.h"
00029 #include "xap_Win32DialogBase.h"
00030 
00031 
00032 class UT_String;
00033 class AP_Win32Dialog_Options;
00034 
00035 enum PSH_PAGES {PG_GENERAL, PG_DOCUMENT, PG_SPELL, PG_SMARTQUOTES};
00036 
00037 /*
00038     Sheet
00039 */
00040 class ABI_EXPORT AP_Win32Dialog_Options_Sheet: public XAP_Win32PropertySheet
00041 {
00042 
00043 public:
00044         AP_Win32Dialog_Options_Sheet();
00045         void _onInitDialog(HWND hwnd);
00046 
00047         void setParent(AP_Win32Dialog_Options*  pData){m_pParent=pData;};
00048         AP_Win32Dialog_Options* getParent(){return m_pParent;};
00049         BOOL _onCommand(HWND hWnd, WPARAM wParam, LPARAM lParam);
00050         static INT_PTR CALLBACK s_sheetInit(HWND hwnd,  UINT uMsg,  LPARAM lParam);
00051 
00052 private:
00053 
00054         AP_Win32Dialog_Options* m_pParent;
00055 
00056 };
00057 
00058 
00059 /*
00060     Spelling page
00061 */
00062 class ABI_EXPORT AP_Win32Dialog_Options_Spelling: public XAP_Win32PropertyPage
00063 {
00064 
00065 public:
00066                                 AP_Win32Dialog_Options_Spelling();
00067                                 ~AP_Win32Dialog_Options_Spelling();
00068 
00069     void                        setContainer(AP_Win32Dialog_Options*    pParent){m_pParent=pParent;};
00070     AP_Win32Dialog_Options*     getContainer(){return m_pParent;};
00071     void                        transferData();
00072     static INT_PTR CALLBACK     s_pageWndProc(HWND hWnd, UINT msg, WPARAM wParam,   LPARAM lParam);
00073 
00074 private:
00075 
00076     void                        _onInitDialog();
00077     void                        _onKillActive(){};
00078 
00079     AP_Win32Dialog_Options*     m_pParent;
00080 
00081 };
00082 
00083 
00084 /*
00085     General page
00086 */
00087 class ABI_EXPORT AP_Win32Dialog_Options_General: public XAP_Win32PropertyPage
00088 {
00089 
00090 public:
00091                                 AP_Win32Dialog_Options_General();
00092                                 ~AP_Win32Dialog_Options_General();
00093 
00094     void                        setContainer(AP_Win32Dialog_Options*    pParent){m_pParent=pParent;};
00095     AP_Win32Dialog_Options*     getContainer(){return m_pParent;};
00096     void                        transferData();
00097     static INT_PTR CALLBACK     s_pageWndProc(HWND hWnd, UINT msg, WPARAM wParam,   LPARAM lParam);
00098 
00099 private:
00100 
00101     void                        _onInitDialog();
00102     void                        _onKillActive(){};
00103     BOOL                    _onCommand(HWND hWnd, WPARAM wParam, LPARAM lParam);
00104 
00105     AP_Win32Dialog_Options*     m_pParent;
00106     int                         m_nCentered;
00107     UT_Vector*                  m_pVecUILangs;
00108 
00109 };
00110 
00111 /*
00112     Document page
00113 */
00114 class ABI_EXPORT AP_Win32Dialog_Options_Document: public XAP_Win32PropertyPage
00115 {
00116 
00117 public:
00118                                 AP_Win32Dialog_Options_Document();
00119                                 ~AP_Win32Dialog_Options_Document();
00120 
00121     void                        setContainer(AP_Win32Dialog_Options*    pParent){m_pParent=pParent;};
00122     AP_Win32Dialog_Options*     getContainer(){return m_pParent;};
00123     void                        transferData();
00124     static INT_PTR CALLBACK     s_pageWndProc(HWND hWnd, UINT msg, WPARAM wParam,   LPARAM lParam);
00125     bool                        isAutoSaveInRange();
00126 
00127 private:
00128 
00129     void                        _onInitDialog();
00130     void                        _onKillActive(){};
00131     BOOL                    _onCommand(HWND hWnd, WPARAM wParam, LPARAM lParam);
00132 
00133     AP_Win32Dialog_Options*     m_pParent;
00134 
00135 };
00136 
00137 /*
00138     Smart Quotes page
00139 */
00140 class ABI_EXPORT AP_Win32Dialog_Options_SmartQuotes: public XAP_Win32PropertyPage
00141 {
00142 
00143 public:
00144                                 AP_Win32Dialog_Options_SmartQuotes();
00145                                 ~AP_Win32Dialog_Options_SmartQuotes();
00146 
00147     void                        setContainer(AP_Win32Dialog_Options* pParent){m_pParent=pParent;};
00148     AP_Win32Dialog_Options*     getContainer(){return m_pParent;};
00149 
00150 private:
00151 
00152     void                        _onInitDialog();
00153     void                        _onKillActive(){};
00154     BOOL                    _onCommand(HWND hWnd, WPARAM wParam, LPARAM lParam);
00155 
00156     AP_Win32Dialog_Options*     m_pParent;
00157 
00158 };
00159 
00160 
00161 /*****************************************************************/
00162 class ABI_EXPORT AP_Win32Dialog_Options: public AP_Dialog_Options, public XAP_Win32DialogBase
00163 {
00164 public:
00165     AP_Win32Dialog_Options(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id);
00166     virtual ~AP_Win32Dialog_Options(void);
00167 
00168     virtual void            runModal(XAP_Frame * pFrame);
00169 
00170     static XAP_Dialog *     static_constructor(XAP_DialogFactory *, XAP_Dialog_Id id);
00171 
00172     HWND                    getPage(PSH_PAGES page);
00173     XAP_DialogFactory *     getDialogFactory() {return  m_pDialogFactory;};
00174     XAP_Frame *             getFrame() {return  m_pFrame;};
00175     void                    checkLanguageChange();
00176     HFONT                   getBoldFontHandle () {return m_hFont;}
00177 
00178  protected:
00179 
00180     AP_Win32Dialog_Options_General      m_general;
00181     AP_Win32Dialog_Options_Document     m_document;
00182     AP_Win32Dialog_Options_Spelling     m_spelling;
00183     AP_Win32Dialog_Options_SmartQuotes  m_smartquotes;
00184     UT_String                           m_curLang;
00185     BOOL                                m_langchanged;
00186     HFONT                               m_hFont;
00187 
00188     virtual void _controlEnable( tControl id, bool value );
00189     virtual void _initEnableControlsPlatformSpecific();
00190 
00191     // we implement these so the XP dialog can set/grab our data
00192 #define SET_GATHER(a,t) virtual t _gather##a(void);  \
00193                         virtual void    _set##a(const t)
00194 
00195     SET_GATHER          (SpellCheckAsType,  bool );
00196     SET_GATHER          (SpellHideErrors,   bool );
00197     SET_GATHER          (SpellSuggest,      bool );
00198     SET_GATHER          (SpellMainOnly,     bool );
00199     SET_GATHER          (SpellUppercase,    bool );
00200     SET_GATHER          (SpellNumbers,      bool );
00201     SET_GATHER          (GrammarCheck,      bool);
00202     SET_GATHER          (ViewRulerUnits,    UT_Dimension);
00203     SET_GATHER          (AutoLoadPlugins, bool);
00204     SET_GATHER          (OtherDirectionRtl, bool );
00205     SET_GATHER          (AutoSaveFile, bool);
00206     SET_GATHER          (SmartQuotes,           bool);
00207     SET_GATHER          (CustomSmartQuotes,     bool);
00208     SET_GATHER          (EnableOverwrite,       bool);
00209 
00210     virtual bool _gatherViewShowToolbar(UT_uint32 /*t*/) { UT_ASSERT(UT_SHOULD_NOT_HAPPEN); return true;}
00211     virtual void _setViewShowToolbar(UT_uint32 /*row*/, bool /*b*/) {}
00212 
00213 
00214     // unimplemented UI-wise. We need dummy implementations to satisfy the XP framework, though
00215 
00216     SET_GATHER          (ViewCursorBlink,       bool);
00217     SET_GATHER          (PrefsAutoSave,         bool);
00218     SET_GATHER          (ViewShowRuler,         bool);
00219     SET_GATHER          (ViewShowStatusBar,     bool);
00220     SET_GATHER          (ViewAll,               bool);
00221     SET_GATHER          (ViewHiddenText,        bool);
00222     SET_GATHER          (ViewUnprintable,       bool);
00223     SET_GATHER          (EnableSmoothScrolling, bool);
00224 
00225     virtual void _gatherAutoSaveFilePeriod(UT_String &stRetVal);
00226     virtual void _setAutoSaveFilePeriod(const UT_String &stPeriod);
00227     virtual void _gatherAutoSaveFileExt(UT_String &stRetVal);
00228     virtual void _setAutoSaveFileExt(const UT_String &stExt);
00229     virtual void _gatherUILanguage(UT_String &stRetVal);
00230     virtual void _setUILanguage(const UT_String &stExt);
00231     virtual gint _gatherOuterQuoteStyle();
00232     virtual gint _gatherInnerQuoteStyle();
00233     virtual void _setOuterQuoteStyle(const gint index);
00234     virtual void _setInnerQuoteStyle(const gint index);
00235 
00236     SET_GATHER          (NotebookPageNum,   int );
00237     SET_GATHER          (LanguageWithKeyboard, bool);
00238 
00239     // Dummy
00240     bool            m_boolEnableSmoothScrolling;
00241     bool            m_boolPrefsAutoSave;
00242     bool            m_boolViewAll;
00243     bool            m_boolViewHiddenText;
00244     bool            m_boolViewShowRuler;
00245     bool            m_boolViewShowStatusBar;
00246     bool            m_boolViewUnprintable;
00247     bool            m_boolViewCursorBlink;
00248 
00249 #undef SET_GATHER
00250 
00251  protected:
00252     BOOL                        _onNotify(HWND hWnd, LPARAM lParam);
00253     BOOL                        _onCommandTab(HWND hWnd, WPARAM wParam, LPARAM lParam);
00254 
00255     HWND                        m_hwndTab;      // tab control in parent dialog
00256 
00257     int                             m_nrSubDlgs;        // number of tabs on tab control
00258     UT_Vector               m_vecSubDlgHWnd;    // hwnd to each sub-dialog
00259 
00260 private:
00261     XAP_DialogFactory *         m_pDialogFactory;
00262 };
00263 
00264 #endif /* AP_WIN32DIALOG_OPTIONS_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1