00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef AP_DIALOG_OPTIONS_H
00025 #define AP_DIALOG_OPTIONS_H
00026
00027 #ifdef HAVE_CONFIG_H
00028 #include "config.h"
00029 #endif
00030
00031 #include <string>
00032 #include <vector>
00033 #include <utility>
00034
00035 #include "xap_Frame.h"
00036 #include "xap_Dialog.h"
00037 #include "xav_View.h"
00038 #include "ut_units.h"
00039
00040 #include "fp_PageSize.h"
00041
00042 class XAP_Frame;
00043 class UT_String;
00044
00045 class ABI_EXPORT AP_Dialog_Options : public XAP_TabbedDialog_NonPersistent
00046 {
00047 public:
00048
00049 AP_Dialog_Options(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id);
00050 virtual ~AP_Dialog_Options(void);
00051
00052 virtual void runModal(XAP_Frame * pFrame) = 0;
00053
00054
00055 typedef enum { a_OK, a_CANCEL, a_SAVE, a_APPLY } tAnswer;
00056
00057
00058 typedef enum { id_CHECK_SPELL_CHECK_AS_TYPE = 0, id_CHECK_SPELL_HIDE_ERRORS,
00059 id_CHECK_SPELL_SUGGEST, id_CHECK_SPELL_MAIN_ONLY,
00060 id_CHECK_SPELL_UPPERCASE, id_CHECK_SPELL_NUMBERS,
00061 id_BUTTON_SPELL_AUTOREPLACE,
00062 id_CHECK_GRAMMAR_CHECK,
00063
00064 id_CHECK_SMART_QUOTES_ENABLE,
00065 id_CHECK_CUSTOM_SMART_QUOTES,
00066 id_LIST_VIEW_OUTER_QUOTE_STYLE,
00067 id_LIST_VIEW_INNER_QUOTE_STYLE,
00068
00069 id_CHECK_OTHER_DEFAULT_DIRECTION_RTL,
00070
00071 id_CHECK_AUTO_SAVE_FILE,
00072 id_TEXT_AUTO_SAVE_FILE_EXT,
00073 id_TEXT_AUTO_SAVE_FILE_PERIOD,
00074 id_TEXT_AUTO_SAVE_FILE_PERIOD_SPIN,
00075 id_CHECK_PREFS_AUTO_SAVE, id_COMBO_PREFS_SCHEME,
00076
00077 id_CHECK_VIEW_SHOW_RULER, id_LIST_VIEW_RULER_UNITS,
00078 id_CHECK_VIEW_CURSOR_BLINK,
00079 id_CHECK_VIEW_SHOW_STATUS_BAR,
00080 id_CHECK_VIEW_ALL, id_CHECK_VIEW_HIDDEN_TEXT,
00081 id_CHECK_VIEW_UNPRINTABLE,
00082 id_CHECK_COLOR_FOR_TRANSPARENT_IS_WHITE,
00083 id_PUSH_CHOOSE_COLOR_FOR_TRANSPARENT,
00084 id_BUTTON_SAVE, id_BUTTON_DEFAULTS,
00085 id_BUTTON_OK, id_BUTTON_CANCEL, id_BUTTON_APPLY,
00086
00087 id_CHECK_ENABLE_SMOOTH_SCROLLING,
00088 id_CHECK_ENABLE_OVERWRITE,
00089 id_CHECK_AUTO_LOAD_PLUGINS,
00090 id_NOTEBOOK,
00091 id_CHECK_LANG_WITH_KEYBOARD,
00092 id_CHECK_DIR_MARKER_AFTER_CLOSING_PARENTHESIS,
00093 id_last } tControl;
00094
00095
00096
00097 AP_Dialog_Options::tAnswer getAnswer(void) const;
00098
00099 virtual void _populateWindowData(void);
00100
00101 void _enableDisableLogic( tControl id );
00102
00103 virtual void _storeWindowData(void);
00104
00105 virtual void _storeDataForControl (tControl id);
00106
00107
00108 void _event_SetDefaults(void);
00109
00110
00111
00112
00113 const gchar * _gatherColorForTransparent(void);
00114 void _setColorForTransparent(const gchar * pzsColorForTransparent);
00115 bool isInitialPopulationHappenning(void)
00116 { return m_bInitialPop; }
00117
00118 typedef std::vector<std::pair<std::string, int> > UnitMenuContent;
00119 void _getUnitMenuContent(const XAP_StringSet *pSS, UnitMenuContent & content);
00120
00121 protected:
00122
00123
00124 virtual void _controlEnable( tControl id, bool value )=0;
00125
00126
00127
00128
00129 void _initEnableControls();
00130
00131
00132
00133
00134 virtual void _initEnableControlsPlatformSpecific(){};
00135
00136
00137 void _eventSave(void);
00138
00139
00140 #define SET_GATHER(a,u) virtual u _gather##a(void) = 0; \
00141 virtual void _set##a(const u) = 0
00142 SET_GATHER (SpellCheckAsType, bool);
00143 SET_GATHER (SpellHideErrors, bool);
00144 SET_GATHER (SpellSuggest, bool);
00145 SET_GATHER (SpellMainOnly, bool);
00146 SET_GATHER (SpellUppercase, bool);
00147 SET_GATHER (SpellNumbers, bool);
00148 SET_GATHER (GrammarCheck, bool);
00149 SET_GATHER (CustomSmartQuotes, bool);
00150 SET_GATHER (SmartQuotes, bool);
00151 SET_GATHER (PrefsAutoSave, bool);
00152 SET_GATHER (EnableOverwrite, bool);
00153
00154 #if !defined (TOOLKIT_GTK_ALL) && !defined(TOOLKIT_COCOA)
00155 SET_GATHER (ViewShowRuler, bool);
00156 virtual bool _gatherViewShowToolbar(UT_uint32 t) = 0;
00157 virtual void _setViewShowToolbar(UT_uint32 row, bool b) = 0;
00158 SET_GATHER (ViewShowStatusBar, bool);
00159 #endif
00160 SET_GATHER (ViewRulerUnits, UT_Dimension);
00161 SET_GATHER (OuterQuoteStyle, gint);
00162 SET_GATHER (InnerQuoteStyle, gint);
00163 SET_GATHER (ViewCursorBlink, bool);
00164
00165 SET_GATHER (ViewAll, bool);
00166 SET_GATHER (ViewHiddenText, bool);
00167 SET_GATHER (ViewUnprintable, bool);
00168 #if defined(TOOLKIT_GTK_ALL)
00169 SET_GATHER (EnableSmoothScrolling, bool);
00170 #endif
00171 SET_GATHER (AutoLoadPlugins, bool);
00172
00173 SET_GATHER (OtherDirectionRtl, bool);
00174
00175 SET_GATHER (AutoSaveFile, bool);
00176 virtual void _gatherAutoSaveFilePeriod(UT_String &stRetVal) = 0;
00177 virtual void _setAutoSaveFilePeriod(const UT_String &stPeriod) = 0;
00178 virtual void _gatherAutoSaveFileExt(UT_String &stRetVal) = 0;
00179 virtual void _setAutoSaveFileExt(const UT_String &stExt) = 0;
00180
00181
00182
00183 virtual void _gatherUILanguage(UT_String &stRetVal){stRetVal.clear();};
00184 virtual void _setUILanguage(const UT_String & ) {};
00185 virtual bool _gatherLanguageWithKeyboard() {return false;}
00186 virtual void _setLanguageWithKeyboard(const bool) {}
00187 virtual bool _gatherDirMarkerAfterClosingParenthesis(){return false;}
00188 virtual void _setDirMarkerAfterClosingParenthesis(const bool){}
00189
00190
00191
00192
00193 SET_GATHER (NotebookPageNum, int );
00194
00195 #undef SET_GATHER
00196 protected:
00197
00198
00199 tAnswer m_answer;
00200 XAP_Frame * m_pFrame;
00201 gchar m_CurrentTransparentColor[10];
00202
00203 private:
00204 bool m_bInitialPop;
00205
00206 };
00207
00208
00209 #endif