Refactor sections as enum types

This commit is contained in:
Andy Uhnak
2022-04-04 09:24:22 +01:00
parent 6cde2f4461
commit 3f34fd655a
10 changed files with 454 additions and 296 deletions
@@ -22,6 +22,7 @@
@protocol RecentsListServiceProtocol;
@class DiscussionsCount;
@class MXSpace;
@class RecentsDataSourceSections;
/**
List the different modes used to prepare the recents data source.
@@ -67,16 +68,10 @@ extern NSString *const kRecentsDataSourceTapOnDirectoryServerChange;
*/
@interface RecentsDataSource : MXKInterleavedRecentsDataSource
@property (nonatomic) NSInteger crossSigningBannerSection;
@property (nonatomic) NSInteger secureBackupBannerSection;
@property (nonatomic) NSInteger directorySection;
@property (nonatomic) NSInteger invitesSection;
@property (nonatomic) NSInteger favoritesSection;
@property (nonatomic) NSInteger peopleSection;
@property (nonatomic) NSInteger conversationSection;
@property (nonatomic) NSInteger lowPrioritySection;
@property (nonatomic) NSInteger serverNoticeSection;
@property (nonatomic) NSInteger suggestedRoomsSection;
/**
A set of sections visible in the current table view and associated with their semantic meaning (e.g. "favorites" = 2)
*/
@property (nonatomic, strong, readonly) RecentsDataSourceSections *sections;
@property (nonatomic, readonly) NSInteger totalVisibleItemCount;
@@ -127,6 +122,11 @@ extern NSString *const kRecentsDataSourceTapOnDirectoryServerChange;
*/
@property (nonatomic) PublicRoomsDirectoryDataSource *publicRoomsDirectoryDataSource;
/**
Make a new sections object that reflects the latest state of the data sources
*/
- (RecentsDataSourceSections *)makeDataSourceSections;
/**
Refresh the recents data source and notify its delegate.
*/