home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Examples / AppKit / TextEdit / Preferences.h < prev    next >
Text File  |  1996-04-20  |  2KB  |  62 lines

  1. #import <Foundation/NSObject.h>
  2. #import <Foundation/NSDictionary.h>
  3. #import <AppKit/NSFont.h>
  4. #import "Document.h"
  5.  
  6. /* Keys in the dictionary... */   
  7. #define RichTextFont @"RichTextFont"
  8. #define PlainTextFont @"PlainTextFont"
  9. #define DeleteBackup @"DeleteBackup"
  10. #define SaveFilesWritable @"SaveFilesWritable"
  11. #define RichText @"RichText"
  12. #define ShowPageBreaks @"ShowPageBreaks"
  13. #define WindowWidth @"WidthInChars"
  14. #define WindowHeight @"HeightInChars"
  15. #define PlainTextEncoding @"PlainTextEncoding"
  16. #define TabWidth @"TabWidth"
  17. #define ForegroundLayoutToIndex @"ForegroundLayoutToIndex"
  18. #define OpenPanelFollowsMainWindow @"OpenPanelFollowsMainWindow"
  19.  
  20. @interface Preferences : NSObject {
  21.     id richTextFontNameField;
  22.     id plainTextFontNameField;
  23.     id deleteBackupMatrix;
  24.     id saveFilesWritableButton;
  25.     id richTextMatrix;
  26.     id showPageBreaksButton;
  27.     id windowWidthField;
  28.     id windowHeightField;
  29.     id plainTextEncodingPopup;
  30.     id tabWidthField;
  31.  
  32.     NSDictionary *curValues;
  33.     NSMutableDictionary *displayedValues;
  34. }
  35.  
  36. + (id)objectForKey:(id)key;    /* Convenience for getting global preferences */
  37. + (void)saveDefaults;        /* Convenience for saving global preferences */
  38.  
  39. + (Preferences *)sharedInstance;
  40.  
  41. - (NSDictionary *)preferences;    /* The current preferences; contains values for the documented keys */
  42.  
  43. - (void)showPanel:(id)sender;    /* Shows the panel */
  44.  
  45. - (void)updateUI;        /* Updates the displayed values in the UI */
  46. - (void)commitDisplayedValues;    /* The displayed values are made current */
  47. - (void)discardDisplayedValues;    /* The displayed values are replaced with current prefs and updateUI is called */
  48.  
  49. - (void)revert:(id)sender;    /* Reverts the displayed values to the current preferences */
  50. - (void)ok:(id)sender;        /* Calls commitUI to commit the displayed values as current */
  51. - (void)revertToDefault:(id)sender;    
  52.  
  53. - (void)miscChanged:(id)sender;        /* Action message for most of the misc items in the UI to get displayedValues */
  54. - (void)changeRichTextFont:(id)sender;    /* Request to change the rich text font */
  55. - (void)changePlainTextFont:(id)sender;    /* Request to change the plain text font */
  56. - (void)changeFont:(id)fontManager;    /* Sent by the font manager */
  57.  
  58. + (NSDictionary *)preferencesFromDefaults;
  59. + (void)savePreferencesToDefaults:(NSDictionary *)dict;
  60.  
  61. @end
  62.