-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathBlogService.h
120 lines (104 loc) · 4.29 KB
/
BlogService.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
#import <Foundation/Foundation.h>
#import "Blog.h"
@import WordPressData;
NS_ASSUME_NONNULL_BEGIN
extern NSString *const WordPressMinimumVersion;
extern NSString *const WPBlogUpdatedNotification;
extern NSString *const WPBlogSettingsUpdatedNotification;
@class WPAccount;
@class SiteInfo;
@interface BlogService : CoreDataService
/**
* Sync all available blogs for an acccount
*
* @param account the account for the associated blogs.
* @param success a block that is invoked when the sync is successful.
* @param failure a block that in invoked when the sync fails.
*/
- (void)syncBlogsForAccount:(WPAccount *)account
success:(void (^)(void))success
failure:(void (^)(NSError *error))failure;
/**
* Sync the blog and its top-level details such as the 'options' data and any jetpack configuration.
*
* @param blog the blog from where to read the information from
* @param success a block that is invoked when the sync is successful.
* @param failure a block that in invoked when the sync fails.
*/
- (void)syncBlog:(Blog *)blog
success:(void (^)(void))success
failure:(void (^)(NSError *error))failure;
/**
* Sync the blog and all available metadata or configuration. Such as top-level details, postTypes, postFormats, categories, multi-author and jetpack configuration.
*
* @note Used for instances where the entire blog should be refreshed or initially downloaded.
*
* @param blog the blog from where to read the information from
* @param success a block that is invoked when the sync is successful.
* @param failure a block that in invoked when the sync fails.
*/
- (void)syncBlogAndAllMetadata:(Blog *)blog
completionHandler:(void (^)(void))completionHandler;
/**
* Sync the available postTypes configured for the blog.
*
* @param blog the blog from where to read the information from
* @param success a block that is invoked when the sync is successful.
* @param failure a block that in invoked when the sync fails.
*/
- (void)syncPostTypesForBlog:(Blog *)blog
success:(void (^)(void))success
failure:(void (^)(NSError *error))failure;
/**
* Sync the available postFormats configured for the blog.
*
* @param blog the blog from where to read the information from
* @param success a block that is invoked when the sync is successful.
* @param failure a block that in invoked when the sync fails.
*/
- (void)syncPostFormatsForBlog:(Blog *)blog
success:(void (^)(void))success
failure:(void (^)(NSError *error))failure;
/**
* Sync blog settings from the server
*
* @param blog the blog from where to read the information from
* @param success a block that is invoked when the sync is successful
* @param failure a block that in invoked when the sync fails.
*/
- (void)syncSettingsForBlog:(Blog *)blog
success:(void (^)(void))success
failure:(void (^)(NSError *error))failure;
/**
* Sync authors from the server
*
* @param blog the blog from where to read the information from
* @param success a block that is invoked when the sync is successful
* @param failure a block that in invoked when the sync fails.
*/
- (void)syncAuthorsForBlog:(Blog *)blog
success:(void (^)(void))success
failure:(void (^)(NSError *error))failure;
/**
* Update blog settings to the server
*
* @param blog the blog to update
* @param success a block that is invoked when the update is successful
* @param failure a block that in invoked when the update fails.
*/
- (void)updateSettingsForBlog:(Blog *)blog
success:(nullable void (^)(void))success
failure:(nullable void (^)(NSError *error))failure;
/**
* Associate synced blogs to the specified Jetpack account.
*
* @param account the account
* @param success a block that is invoked when the update is successful
* @param failure a block that in invoked when the update fails.
*/
- (void)associateSyncedBlogsToJetpackAccount:(WPAccount *)account
success:(void (^)(void))success
failure:(void (^)(NSError *error))failure;
- (void)removeBlog:(Blog *)blog;
@end
NS_ASSUME_NONNULL_END