JubeatPlus 3.9.11
Loading...
Searching...
No Matches
StorePackListController.h
Go to the documentation of this file.
1
17
18#import <Foundation/Foundation.h>
19#import <StoreKit/StoreKit.h>
20
21#import "Downloader.h"
22#import "StorePackInfo.h"
23
24NS_ASSUME_NONNULL_BEGIN
25
28@class StorePromotion;
29
36@protocol StorePackListDelegate <NSObject>
37@optional
43- (void)packListDownloadError:(StorePackListController *)controller
44 errorMessage:(nullable NSString *)errorMessage;
51- (void)packListDownloadSuccess:(StorePackListController *)controller
52 isInitial:(BOOL)isInitial
53 showPack:(nullable StorePackInfo *)showPack;
58- (void)packListDownloadNothing:(StorePackListController *)controller;
64- (void)additionPackInfoDownloadSuccess:(StorePackListController *)controller
65 showPack:(nullable StorePackInfo *)showPack;
66@end
67
71@interface StorePackListController : NSObject <DownloaderDelegate, SKProductsRequestDelegate>
72
78+ (nullable NSString *)storeCountry;
79
85- (instancetype)init;
86
92- (NSUInteger)numGenres;
93
99- (NSArray<NSString *> *)genreNames;
100
106- (NSArray<StorePackListGenre *> *)genreInfos;
107
114- (void)addGenres:(nullable NSArray *)genreList;
115
123- (void)addGenres:(nullable NSArray *)genreList extendList:(nullable NSDictionary *)extendList;
124
131- (void)addPromotions:(nullable NSArray *)promotionList
132 validProducts:(nullable NSArray<SKProduct *> *)validProducts;
133
139- (nullable NSArray<StorePromotion *> *)promotions;
140
149- (int)genreIndexForgenreID:(NSInteger)genreID;
150
157- (nullable StorePackListGenre *)packListForGenreID:(NSInteger)genreID;
158
165- (nullable StorePackListGenre *)packListForGenreIndex:(NSUInteger)genreIndex;
166
172- (void)startFetchForGenreID:(NSUInteger)genreID;
173
179- (void)startFetchForGenreIndex:(NSUInteger)genreIndex;
180
186- (void)startFetchGenre:(nullable StorePackListGenre *)genre;
187
193- (void)startFetchAdditionalPack:(nullable NSNumber *)packID;
194
199- (void)cancelFetching;
200
207@property(nonatomic, readonly) BOOL isFetching;
208
213@property(nonatomic, readonly) BOOL initiallyLoaded;
214
219@property(nonatomic, strong, nullable) NSNumber *additionalPackID;
220
225@property(nonatomic, weak, nullable) id<StorePackListDelegate> delegate;
226
227@end
228
229NS_ASSUME_NONNULL_END
230
231// code: language=Objective-C
232// kate: hl Objective-C;
233// vim: set ft=objc :
The HTTP client.
One purchasable pack in the store.
A pack's identity, name, price, store flags, and track list.
Definition StorePackInfo.h:18
Fetches, groups, and vends the store's genre and pack lists.
Definition StorePackListController.h:71
BOOL initiallyLoaded
Whether the genre and promotion lists have been loaded at least once.
Definition StorePackListController.h:213
NSArray< NSString * > * genreNames()
The display names of the held genres, in order.
Definition StorePackListController.m:122
void cancelFetching()
Cancels any in-flight download or product request and clears the pending additional pack.
Definition StorePackListController.m:349
instancetype init()
Builds an empty controller seeded with a single "all" genre.
Definition StorePackListController.m:97
id< StorePackListDelegate > delegate
The download-outcome delegate.
Definition StorePackListController.h:225
NSArray< StorePackListGenre * > * genreInfos()
A copy of the held genre models, in order.
Definition StorePackListController.m:134
nullable NSArray< StorePromotion * > * promotions()
The most recently built promotion list.
Definition StorePackListController.m:301
nullable NSString * storeCountry()
The App Store country recorded from the most recent product's price locale.
Definition StorePackListController.m:87
NSNumber * additionalPackID
The pending additional-pack identifier, held for the duration of its StoreKit request.
Definition StorePackListController.h:219
BOOL isFetching
Whether a download or product request is currently in flight.
Definition StorePackListController.m:362
NSUInteger numGenres()
The number of genres currently held.
Definition StorePackListController.m:117
A store model for a single pack-list genre.
Definition StorePackListGenre.h:25
A promoted pack or genre, with its banner artwork and, for a pack, its sample list.
Definition StorePromotion.h:24
Performs a single HTTP request.
Definition Downloader.h:30