mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-07-12 14:29:24 +00:00
61 lines
1.9 KiB
Objective-C
61 lines
1.9 KiB
Objective-C
#import <SSignalKit/SSignalKit.h>
|
|
|
|
@protocol TGMediaSelectableItem
|
|
|
|
@property (nonatomic, readonly) NSString *uniqueIdentifier;
|
|
|
|
@end
|
|
|
|
@interface TGMediaSelectionContext : NSObject
|
|
|
|
- (instancetype)initWithGroupingAllowed:(bool)allowGrouping selectionLimit:(int)selectionLimit;
|
|
|
|
@property (nonatomic, readonly) bool allowGrouping;
|
|
@property (nonatomic, readonly) int selectionLimit;
|
|
@property (nonatomic, copy) void (^selectionLimitExceeded)(void);
|
|
|
|
@property (nonatomic, assign) bool grouping;
|
|
- (SSignal *)groupingChangedSignal;
|
|
- (void)toggleGrouping;
|
|
|
|
@property (nonatomic, copy) SSignal *(^updatedItemsSignal)(NSArray *items);
|
|
- (void)setItemSourceUpdatedSignal:(SSignal *)signal;
|
|
|
|
- (bool)setItem:(id<TGMediaSelectableItem>)item selected:(bool)selected;
|
|
- (bool)setItem:(id<TGMediaSelectableItem>)item selected:(bool)selected animated:(bool)animated sender:(id)sender;
|
|
|
|
- (NSUInteger)indexOfItem:(id<TGMediaSelectableItem>)item;
|
|
|
|
- (bool)toggleItemSelection:(id<TGMediaSelectableItem>)item success:(bool *)success;
|
|
- (bool)toggleItemSelection:(id<TGMediaSelectableItem>)item animated:(bool)animated sender:(id)sender success:(bool *)success;
|
|
|
|
- (void)clear;
|
|
|
|
- (bool)isItemSelected:(id<TGMediaSelectableItem>)item;
|
|
- (bool)isIdentifierSelected:(NSString *)identifier;
|
|
|
|
- (SSignal *)itemSelectedSignal:(id<TGMediaSelectableItem>)item;
|
|
- (SSignal *)itemInformativeSelectedSignal:(id<TGMediaSelectableItem>)item;
|
|
- (SSignal *)selectionChangedSignal;
|
|
|
|
- (void)enumerateSelectedItems:(void (^)(id<TGMediaSelectableItem>))enumerationBlock;
|
|
|
|
- (NSOrderedSet *)selectedItemsIdentifiers;
|
|
- (NSArray *)selectedItems;
|
|
|
|
- (NSUInteger)count;
|
|
|
|
+ (SSignal *)combinedSelectionChangedSignalForContexts:(NSArray *)contexts;
|
|
|
|
@end
|
|
|
|
|
|
@interface TGMediaSelectionChange : NSObject
|
|
|
|
@property (nonatomic, readonly) NSObject <TGMediaSelectableItem> *item;
|
|
@property (nonatomic, readonly) bool selected;
|
|
@property (nonatomic, readonly) bool animated;
|
|
@property (nonatomic, readonly, strong) id sender;
|
|
|
|
@end
|