Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef AP_COCOADIALOG_OPTIONS_H
00024 #define AP_COCOADIALOG_OPTIONS_H
00025
00026 #import <Cocoa/Cocoa.h>
00027
00028 #import "xap_Cocoa_NSTableUtils.h"
00029
00030 #import "ap_CocoaFrame.h"
00031
00032 #include "ap_Dialog_Options.h"
00033 #include "ap_Prefs.h"
00034
00035 class XAP_Frame;
00036
00037 class AP_CocoaDialog_Options;
00038
00039 @interface AP_CocoaDialog_OptionsController : NSWindowController
00040 {
00041 AP_CocoaDialog_Options * m_xap;
00042
00043 @public
00044 IBOutlet NSBox * m_boxAutoSave;
00045 IBOutlet NSBox * m_appStartup;
00046 IBOutlet NSBox * oBox_BiDiOptions;
00047 IBOutlet NSBox * oBox_General;
00048 IBOutlet NSBox * oBox_Ignore;
00049 IBOutlet NSBox * oBox_Dictionaries;
00050 IBOutlet NSBox * oBox_Grammar;
00051 IBOutlet NSBox * oBox_UserInterface;
00052
00053 IBOutlet NSButton * oButton_ChooseScreenColor;
00054 IBOutlet NSButton * oButton_Close;
00055 IBOutlet NSButton * m_buttonDefaults;
00056
00057 IBOutlet NSColorWell * oColorWell_Screen;
00058
00059 IBOutlet NSTextField * oLabel_WithExtension;
00060 IBOutlet NSTextField * oLabel_Minutes;
00061 IBOutlet NSTextField * oLabel_Units;
00062 IBOutlet NSTextField * m_textAutoSaveFilePeriod;
00063 IBOutlet NSTextField * m_textAutoSaveFileExt;
00064 IBOutlet NSBox * m_labelOuterQuoteStyle;
00065 IBOutlet NSBox * m_labelInnerQuoteStyle;
00066
00067 IBOutlet NSPopUpButton * m_menuUnits;
00068 IBOutlet NSPopUpButton * m_comboOuterQuote;
00069 IBOutlet NSPopUpButton * m_comboInnerQuote;
00070
00071 IBOutlet NSStepper * oStepper_Minutes;
00072
00073 IBOutlet NSButton * m_checkbuttonSpellCheckAsType;
00074 IBOutlet NSButton * m_checkbuttonGrammarCheck;
00075 IBOutlet NSButton * m_checkbuttonOtherDirectionRtl;
00076 IBOutlet NSButton * m_checkbuttonSpellHideErrors;
00077 IBOutlet NSButton * m_checkbuttonSpellSuggest;
00078 IBOutlet NSButton * m_checkbuttonSpellNumbers;
00079 IBOutlet NSButton * m_checkbuttonSpellUppercase;
00080 IBOutlet NSButton * m_checkbuttonSpellMainOnly;
00081 IBOutlet NSButton * m_checkbuttonAutoLoadPlugins;
00082 IBOutlet NSButton * oSwitch_ScreenColor;
00083 IBOutlet NSButton * m_checkbuttonSmartQuotes;
00084 IBOutlet NSButton * m_checkbuttonCustomSmartQuotes;
00085 IBOutlet NSButton * m_checkbuttonAutoSaveFile;
00086 IBOutlet NSButton * m_checkbuttonEnableOverwrite;
00087
00088 IBOutlet NSTabView * oTabView;
00089 }
00090 - (id)initFromNib;
00091 - (oneway void)dealloc;
00092 - (void)windowDidLoad;
00093
00094 - (void)setXAPOwner:(AP_CocoaDialog_Options *)owner;
00095
00096 - (IBAction)revertClicked:(id)sender;
00097 - (IBAction)checkboxClicked:(id)sender;
00098 - (IBAction)autoSaveClicked:(id)sender;
00099
00100 - (IBAction)controlChanged:(id)sender;
00101
00102 - (IBAction)closeClicked:(id)sender;
00103 @end
00104
00105
00106
00107 class AP_CocoaDialog_Options
00108 : public AP_Dialog_Options
00109 , public XAP_NotebookDialog
00110 {
00111 public:
00112 AP_CocoaDialog_Options(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id dlgid);
00113
00114 virtual ~AP_CocoaDialog_Options();
00115
00116 virtual void runModal(XAP_Frame * pFrame);
00117
00118 static XAP_Dialog * static_constructor(XAP_DialogFactory *, XAP_Dialog_Id dlgid);
00119
00120 id _lookupWidget( tControl cid );
00121 void _setupSmartQuotesCombos(NSPopUpButton *);
00122
00123 void setReinit(bool value)
00124 {
00125 m_reinit = value;
00126 }
00127 bool getReinit()
00128 {
00129 return m_reinit;
00130 }
00131
00132 virtual void _populateWindowData(void);
00133 protected:
00134
00135 virtual void _controlEnable( tControl cid, bool value );
00136
00137
00138 #define SET_GATHER(a,t) virtual t _gather##a(void); \
00139 virtual void _set##a(t)
00140
00141
00142 SET_GATHER (NotebookPageNum, int);
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152 SET_GATHER (ViewRulerUnits, UT_Dimension);
00153
00154
00155 virtual bool _gatherViewCursorBlink(void) { return true; }
00156 virtual void _setViewCursorBlink(const bool) {}
00157
00158
00159
00160 SET_GATHER (AutoLoadPlugins, bool);
00161
00162
00163
00164
00165
00166 SET_GATHER (AutoSaveFile, bool);
00167 virtual void _gatherAutoSaveFilePeriod ( UT_String &stRetVal);
00168 virtual void _setAutoSaveFilePeriod (const UT_String &stPeriod);
00169 virtual void _gatherAutoSaveFileExt ( UT_String &stRetVal);
00170 virtual void _setAutoSaveFileExt (const UT_String &stExt);
00171
00172
00173
00174 SET_GATHER (OtherDirectionRtl, bool);
00175
00176
00177
00178
00179
00180 SET_GATHER (SpellCheckAsType, bool);
00181 SET_GATHER (SpellHideErrors, bool);
00182
00183
00184
00185 SET_GATHER (SpellUppercase, bool);
00186 SET_GATHER (SpellNumbers, bool);
00187
00188
00189
00190 SET_GATHER (SpellSuggest, bool);
00191 SET_GATHER (SpellMainOnly, bool);
00192
00193
00194
00195 SET_GATHER (GrammarCheck, bool);
00196
00197
00198
00199 SET_GATHER (SmartQuotes, bool);
00200 SET_GATHER (CustomSmartQuotes, bool);
00201 SET_GATHER (OuterQuoteStyle, gint);
00202 SET_GATHER (InnerQuoteStyle, gint);
00203
00204
00205
00206 SET_GATHER (PrefsAutoSave, bool);
00207 SET_GATHER (ViewShowRuler, bool);
00208 SET_GATHER (ViewShowStatusBar, bool);
00209 SET_GATHER (ViewAll, bool);
00210 SET_GATHER (ViewHiddenText, bool);
00211 SET_GATHER (ViewUnprintable, bool);
00212 SET_GATHER (EnableSmoothScrolling, bool);
00213 SET_GATHER (EnableOverwrite, bool);
00214
00215 #undef SET_GATHER
00216
00217 virtual void addPage(const XAP_NotebookDialog::Page*)
00218 {
00219 UT_ASSERT(UT_SHOULD_NOT_HAPPEN);
00220 }
00221 private:
00222 AP_CocoaDialog_OptionsController * ctrl;
00223 bool m_reinit;
00224
00225
00226 bool m_boolEnableSmoothScrolling;
00227 bool m_boolPrefsAutoSave;
00228 bool m_boolViewAll;
00229 bool m_boolViewHiddenText;
00230 bool m_boolViewShowRuler;
00231 bool m_boolViewShowStatusBar;
00232 bool m_boolViewUnprintable;
00233 };
00234
00235 #endif