1 | /* |
---|
2 | * AIPreferenceControllerProtocol.h |
---|
3 | * Adium |
---|
4 | * |
---|
5 | * Created by Evan Schoenberg on 7/31/06. |
---|
6 | * |
---|
7 | */ |
---|
8 | |
---|
9 | #import <Adium/AIControllerProtocol.h> |
---|
10 | |
---|
11 | //Preference groups |
---|
12 | #define PREF_GROUP_GENERAL @"General" |
---|
13 | #define PREF_GROUP_ACCOUNTS @"Accounts" |
---|
14 | #define PREF_GROUP_TOOLBARS @"Toolbars" |
---|
15 | #define PREF_GROUP_WINDOW_POSITIONS @"Window Positions" |
---|
16 | #define PREF_GROUP_SPELLING @"Spelling" |
---|
17 | #define OBJECT_PREFS_PATH @"ByObject" //Path to object specific preference folder |
---|
18 | #define ACCOUNT_PREFS_PATH @"Accounts" //Path to account specific preference folder |
---|
19 | |
---|
20 | //Preference Categories |
---|
21 | typedef enum { |
---|
22 | AIPref_General= 0, |
---|
23 | AIPref_Accounts, |
---|
24 | AIPref_Personal, |
---|
25 | AIPref_Appearance, |
---|
26 | AIPref_Messages, |
---|
27 | AIPref_Status, |
---|
28 | AIPref_Events, |
---|
29 | AIPref_FileTransfer, |
---|
30 | AIPref_Advanced |
---|
31 | } AIPreferenceCategory; |
---|
32 | |
---|
33 | @class AIAdium, AIListObject; |
---|
34 | @class AIPreferencePane, AIAdvancedPreferencePane; |
---|
35 | |
---|
36 | @protocol AIPreferenceController <AIController> |
---|
37 | //Preference Window |
---|
38 | - (IBAction)showPreferenceWindow:(id)sender; |
---|
39 | - (IBAction)closePreferenceWindow:(id)sender; |
---|
40 | - (void)openPreferencesToCategoryWithIdentifier:(NSString *)identifier; |
---|
41 | - (void)addPreferencePane:(AIPreferencePane *)inPane; |
---|
42 | - (void)removePreferencePane:(AIPreferencePane *)inPane; |
---|
43 | - (NSArray *)paneArray; |
---|
44 | - (void)addAdvancedPreferencePane:(AIAdvancedPreferencePane *)inPane; |
---|
45 | - (NSArray *)advancedPaneArray; |
---|
46 | |
---|
47 | //Observing |
---|
48 | - (void)registerPreferenceObserver:(id)observer forGroup:(NSString *)group; |
---|
49 | - (void)unregisterPreferenceObserver:(id)observer; |
---|
50 | |
---|
51 | - (void)addObserver:(NSObject *)anObserver forKeyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options context:(void *)context; |
---|
52 | - (void)addObserver:(NSObject *)anObserver forKeyPath:(NSString *)keyPath ofObject:(AIListObject *)listObject options:(NSKeyValueObservingOptions)options context:(void *)context; |
---|
53 | |
---|
54 | - (void)informObserversOfChangedKey:(NSString *)key inGroup:(NSString *)group object:(AIListObject *)object; |
---|
55 | - (void)delayPreferenceChangedNotifications:(BOOL)inDelay; |
---|
56 | |
---|
57 | //Setting Preferences |
---|
58 | - (void)setPreference:(id)value forKey:(NSString *)key group:(NSString *)group; |
---|
59 | - (void)setPreference:(id)value forKey:(NSString *)inKey group:(NSString *)group object:(AIListObject *)object; |
---|
60 | - (void)setPreferences:(NSDictionary *)inPrefDict inGroup:(NSString *)group; |
---|
61 | - (void)setPreferences:(NSDictionary *)inPrefDict inGroup:(NSString *)group object:(AIListObject *)object; |
---|
62 | |
---|
63 | //Retrieving Preferences |
---|
64 | - (id)preferenceForKey:(NSString *)key group:(NSString *)group; |
---|
65 | - (id)preferenceForKey:(NSString *)key group:(NSString *)group object:(AIListObject *)object; |
---|
66 | - (id)preferenceForKey:(NSString *)key group:(NSString *)group objectIgnoringInheritance:(AIListObject *)object; |
---|
67 | - (NSDictionary *)preferencesForGroup:(NSString *)group; |
---|
68 | - (id)defaultPreferenceForKey:(NSString *)key group:(NSString *)group object:(AIListObject *)object; |
---|
69 | |
---|
70 | //Defaults |
---|
71 | - (void)registerDefaults:(NSDictionary *)defaultDict forGroup:(NSString *)group; |
---|
72 | - (void)registerDefaults:(NSDictionary *)defaultDict forGroup:(NSString *)group object:(AIListObject *)object; |
---|
73 | |
---|
74 | //Default download location |
---|
75 | - (NSString *)userPreferredDownloadFolder; |
---|
76 | - (void)setUserPreferredDownloadFolder:(NSString *)path; |
---|
77 | @end |
---|
78 | |
---|
79 | @interface NSObject (AIPreferenceObserver) |
---|
80 | - (void)preferencesChangedForGroup:(NSString *)group key:(NSString *)key |
---|
81 | object:(AIListObject *)object preferenceDict:(NSDictionary *)prefDict firstTime:(BOOL)firstTime; |
---|
82 | @end |
---|