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