forked from Awful/Awful.app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAwfulSettings.h
More file actions
104 lines (71 loc) · 3 KB
/
AwfulSettings.h
File metadata and controls
104 lines (71 loc) · 3 KB
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
// AwfulSettings.h
//
// Copyright 2012 Awful Contributors. CC BY-NC-SA 3.0 US https://github.com/Awful/Awful.app
#import <Foundation/Foundation.h>
@interface AwfulSettings : NSObject
/**
* Returns a convenient singleton instance.
*/
+ (instancetype)sharedSettings;
- (void)registerDefaults;
- (void)migrateOldSettings;
@property (readonly, strong) NSArray *sections;
- (NSDictionary *)infoForSettingWithKey:(NSString *)key;
@property (assign, nonatomic) BOOL showAvatars;
@property (assign, nonatomic) BOOL showImages;
@property (assign, nonatomic) BOOL bookmarksSortedByUnread;
@property (assign, nonatomic) BOOL confirmNewPosts;
@property (assign, nonatomic) BOOL darkTheme;
@property (copy, nonatomic) NSString *username;
@property (copy, nonatomic) NSString *userID;
@property (assign, nonatomic) double fontScale;
@property (assign, nonatomic) BOOL canSendPrivateMessages;
@property (assign, nonatomic) BOOL showThreadTags;
@property (copy, nonatomic) NSArray *favoriteForums;
@property (copy, nonatomic) NSString *lastOfferedPasteboardURL;
@property (copy, nonatomic) NSString *customBaseURL;
@property (assign, nonatomic) BOOL hideSidebarInLandscape;
- (BOOL)childrenExpandedForForumWithID:(NSString *)forumID;
- (void)setChildrenExpanded:(BOOL)shouldHide forForumWithID:(NSString *)forumID;
- (NSString *)themeNameForForumID:(NSString *)forumID;
- (void)setThemeName:(NSString *)themeName forForumID:(NSString *)forumID;
@property (copy, nonatomic) NSArray *ubiquitousThemeNames;
- (id)objectForKeyedSubscript:(id)key;
- (void)setObject:(id)object forKeyedSubscript:(id <NSCopying>)key;
/**
* Clear all settings.
*/
- (void)reset;
@end
/**
* Sent to default center whenever a setting changes. The userInfo dictionary has a value for AwfulSettingsDidChangeSettingKey.
*/
extern NSString * const AwfulSettingsDidChangeNotification;
/**
* One of the values in AwfulSettingsKeys indicating which setting changed.
*/
extern NSString * const AwfulSettingsDidChangeSettingKey;
/**
* Possible values for AwfulSettingsDidChangeSettingKey, and keys for subscripting.
*
* N.B. Undocumented here are:
* - "theme-X" keys, where X is a forum ID.
* - "forum-expanded-X" keys, where X is a forum ID.
*/
extern const struct AwfulSettingsKeys {
__unsafe_unretained NSString *showAvatars;
__unsafe_unretained NSString *showImages;
__unsafe_unretained NSString *confirmNewPosts;
__unsafe_unretained NSString *darkTheme;
__unsafe_unretained NSString *username;
__unsafe_unretained NSString *userID;
__unsafe_unretained NSString *bookmarksSortedByUnread;
__unsafe_unretained NSString *canSendPrivateMessages;
__unsafe_unretained NSString *showThreadTags;
__unsafe_unretained NSString *favoriteForums;
__unsafe_unretained NSString *lastOfferedPasteboardURL;
__unsafe_unretained NSString *customBaseURL;
__unsafe_unretained NSString *hideSidebarInLandscape;
__unsafe_unretained NSString *fontScale;
__unsafe_unretained NSString *ubiquitousThemeNames;
} AwfulSettingsKeys;