dev.stuconnolly.com / svn / safaritabs

  1. #import <AppKit/NSNibDeclarations.h>
  2.  
  3. // Private class from the AppKit framework, used by Safari and Mail.
  4.  
  5. @protocol NSPreferencesModule
  6. #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
  7. - (BOOL) preferencesWindowShouldClose;
  8. - (BOOL) moduleCanBeRemoved;
  9. - (void) moduleWasInstalled;
  10. - (void) moduleWillBeRemoved;
  11. #endif
  12. - (void) didChange;
  13. - (void) initializeFromDefaults;
  14. - (void) willBeDisplayed;
  15. - (void) saveChanges;
  16. - (BOOL) hasChangesPending;
  17. - (NSImage *) imageForPreferenceNamed:(NSString *) name;
  18. - (NSView *) viewForPreferenceNamed:(NSString *) name;
  19. @end
  20.  
  21. @interface NSPreferences : NSObject {
  22. #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_2
  23.     id preferencesPanel;
  24.     NSBox *preferenceBox;
  25.     id moduleMatrix;
  26.     id okButton;
  27.     id cancelButton;
  28.     id applyButton;
  29. #else
  30.     NSWindow *_preferencesPanel;
  31.     NSBox *_preferenceBox;
  32.     NSMatrix *_moduleMatrix;
  33.     NSButtonCell *_okButton;
  34.     NSButtonCell *_cancelButton;
  35.     NSButtonCell *_applyButton;
  36. #endif
  37.     NSMutableArray *_preferenceTitles;
  38.     NSMutableArray *_preferenceModules;
  39. #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_2
  40.     NSMutableDictionary *_preferenceViews;
  41. #else
  42.     NSMutableDictionary *_masterPreferenceViews;
  43.     NSMutableDictionary *_currentSessionPreferenceViews;
  44. #endif
  45.     NSBox *_originalContentView;
  46.     BOOL _isModal;
  47. #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
  48.     CGFloat _constrainedWidth;
  49.     id _currentModule;
  50.     void *_reserved;
  51. #endif
  52. }
  53. + (id) sharedPreferences;
  54. + (void) setDefaultPreferencesClass:(Class) class;
  55. + (Class) defaultPreferencesClass;
  56.  
  57. - (id) init;
  58. - (void) dealloc;
  59. - (void) addPreferenceNamed:(NSString *) name owner:(id) owner;
  60.  
  61. - (NSSize) preferencesContentSize;
  62.  
  63. - (void) showPreferencesPanel;
  64. - (void) showPreferencesPanelForOwner:(id) owner;
  65. - (NSInteger) showModalPreferencesPanelForOwner:(id) owner;
  66. - (NSInteger) showModalPreferencesPanel;
  67.  
  68. - (void) ok:(id) sender;
  69. - (void) cancel:(id) sender;
  70. - (void) apply:(id) sender;
  71.  
  72. - (NSString *) windowTitle;
  73. - (BOOL) usesButtons;
  74.  
  75. #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_2
  76. - (void) selectModule:(id) sender;
  77. #endif
  78. @end
  79.  
  80. @interface NSPreferencesModule : NSObject <NSPreferencesModule> {
  81. #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_2
  82.     IBOutlet NSBox *preferencesView;
  83.     BOOL hasChanges;
  84. #else
  85.     IBOutlet NSBox *_preferencesView;
  86.     NSSize _minSize;
  87.     BOOL _hasChanges;
  88.     void *_reserved;
  89. #endif
  90. }
  91. + (id) sharedInstance;
  92. - (id) init;
  93. - (NSString *) preferencesNibName;
  94. #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
  95. - (void) setPreferencesView:(NSView *) view;
  96. #endif
  97. - (NSView *) viewForPreferenceNamed:(NSString *) name;
  98. - (NSImage *) imageForPreferenceNamed:(NSString *) name;
  99. #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
  100. - (NSString *) titleForIdentifier:(NSString *) identifier;
  101. #endif
  102. - (BOOL) hasChangesPending;
  103. - (void) saveChanges;
  104. - (void) willBeDisplayed;
  105. - (void) initializeFromDefaults;
  106. - (void) didChange;
  107. #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
  108. - (NSSize) minSize;
  109. - (void) setMinSize:(NSSize) size;
  110. - (void) moduleWillBeRemoved;
  111. - (void) moduleWasInstalled;
  112. - (BOOL) moduleCanBeRemoved;
  113. - (BOOL) preferencesWindowShouldClose;
  114. - (BOOL) isResizable;
  115. #endif
  116. @end
  117.