<commit_before>//
//  LYRUIParticipantPickerController.h
//  
//
//  Created by <NAME> on 8/29/14.
//
//

#import <UIKit/UIKit.h>
#import "LYRUIParticipantTableViewCell.h"
#import "LYRUIParticipant.h"
#import "LYRUIParticipantTableViewController.h"

@class LYRUIParticipantPickerController;

/**
 @abstract The `LYRUIParticipantPickerControllerDelegate` protocol must be adopted by objects that wish to act
 as the delegate for a `LYRUIParticipantPickerController` object.
 */
@protocol LYRUIParticipantPickerControllerDelegate <NSObject>

/**
 @abstract Tells the receiver that the participant picker was dismissed without making a selection.
 @param participantPickerController The participant picker that was dismissed.
 */
- (void)participantPickerControllerDidCancel:(LYRUIParticipantPickerController *)participantPickerController;

/**
 @abstract Tells the receiver that the user has selected a participant from a participant picker.
 @param participantPickerController The participant picker in which the selection was made.
 @param participant The participant who was selected.
 */
- (void)participantPickerController:(LYRUIParticipantPickerController *)participantPickerController didSelectParticipant:(id<LYRUIParticipant>)participant;

@end

/**
 @abstract Objects wishing to act as the data source for a participant picker must adopt the `LYRUIParticipantsPickerDataSource` protocol.
 */
@protocol LYRUIParticipantPickerDataSource <NSObject>

/**
 @abstract The set of participants to be presented in the picker. Each object in the returned collection must conform to the `LYRUIParticipant` protocol.
 @discussion The picker presents the returned participants in alphabetical order according to `sortType` and sectioned by the corresponding first initial.
 */
- (NSSet *)participantsForParticipantPickerController:(LYRUIParticipantPickerController *)participantPickerController;

/**
 @abstract Asynchronously searches for participants that match the given search text.
 @discussion Invoked by the participant picker controller when the user inputs text into the search bar. The receiver is
 to perform the search, build a set of matching participants, and then call the completion block. The controller will section
 the participants and present them in alphabetical order according to the value returned by the `sortType` property.
 */
- (void)participantPickerController:(LYRUIParticipantPickerController *)participantPickerController searchForParticipantsMatchingText:(NSString *)searchText completion:(void (^)(NSSet *participants))completion;

@end

/**
 @abstract Displays a list of participants in a navigation controller and allows for searching of participants.
 */
@interface LYRUIParticipantPickerController : UINavigationController

///------------------------------------
/// @name Creating a Participant Picker
///------------------------------------

/**
 @abstract Creates and returns a participant picker initialized with the given set of participants.
 @param participants The set of participants to display in the picker. Each object in the given set must conform to the `LYRUIParticipant` protocol.
 @returns A new participant picker initialized with the given set of participants.
 @raises NSInvalidArgumentException Raised if any object in the given set of participants does not conform to the `LYRUIParticipant` protocol.
 */
+ (instancetype)participantPickerWithDataSource:(id<LYRUIParticipantPickerDataSource>)dataSource sortType:(LYRUIParticipantPickerSortType)sortType;

///----------------------------------------
/// @name Accessing the Set of Participants
///----------------------------------------

@property (nonatomic) LYRUIParticipantPickerSortType sortType;

///-----------------------------------------
/// @name Accessing the Picker Data Source
///-----------------------------------------

@property (nonatomic, weak) id<LYRUIParticipantPickerDataSource> dataSource;

///-----------------------------------------
/// @name Accessing the Picker Delegate
///-----------------------------------------

@property (nonatomic, weak) id<LYRUIParticipantPickerControllerDelegate> participantPickerDelegate;<commit_msg>Corrected participant picker constructor comments.<commit_after>//
//  LYRUIParticipantPickerController.h
//  
//
//  Created by <NAME> on 8/29/14.
//
//

#import <UIKit/UIKit.h>
#import "LYRUIParticipantTableViewCell.h"
#import "LYRUIParticipant.h"
#import "LYRUIParticipantTableViewController.h"

@class LYRUIParticipantPickerController;

/**
 @abstract The `LYRUIParticipantPickerControllerDelegate` protocol must be adopted by objects that wish to act
 as the delegate for a `LYRUIParticipantPickerController` object.
 */
@protocol LYRUIParticipantPickerControllerDelegate <NSObject>

/**
 @abstract Tells the receiver that the participant picker was dismissed without making a selection.
 @param participantPickerController The participant picker that was dismissed.
 */
- (void)participantPickerControllerDidCancel:(LYRUIParticipantPickerController *)participantPickerController;

/**
 @abstract Tells the receiver that the user has selected a participant from a participant picker.
 @param participantPickerController The participant picker in which the selection was made.
 @param participant The participant who was selected.
 */
- (void)participantPickerController:(LYRUIParticipantPickerController *)participantPickerController didSelectParticipant:(id<LYRUIParticipant>)participant;

@end

/**
 @abstract Objects wishing to act as the data source for a participant picker must adopt the `LYRUIParticipantsPickerDataSource` protocol.
 */
@protocol LYRUIParticipantPickerDataSource <NSObject>

/**
 @abstract The set of participants to be presented in the picker. Each object in the returned collection must conform to the `LYRUIParticipant` protocol.
 @discussion The picker presents the returned participants in alphabetical order according to `sortType` and sectioned by the corresponding first initial.
 */
- (NSSet *)participantsForParticipantPickerController:(LYRUIParticipantPickerController *)participantPickerController;

/**
 @abstract Asynchronously searches for participants that match the given search text.
 @discussion Invoked by the participant picker controller when the user inputs text into the search bar. The receiver is
 to perform the search, build a set of matching participants, and then call the completion block. The controller will section
 the participants and present them in alphabetical order according to the value returned by the `sortType` property.
 */
- (void)participantPickerController:(LYRUIParticipantPickerController *)participantPickerController searchForParticipantsMatchingText:(NSString *)searchText completion:(void (^)(NSSet *participants))completion;

@end

/**
 @abstract Displays a list of participants in a navigation controller and allows for searching of participants.
 */
@interface LYRUIParticipantPickerController : UINavigationController

///------------------------------------
/// @name Creating a Participant Picker
///------------------------------------

/**
 @abstract Creates and returns a participant picker initialized with the given set of participants.
 @param dataSource The object to acts as the picker's data source.
 @param sortType The sort type to use for the participants.
 @returns A new participant picker initialized with the given data source and sort type.
 */
+ (instancetype)participantPickerWithDataSource:(id<LYRUIParticipantPickerDataSource>)dataSource sortType:(LYRUIParticipantPickerSortType)sortType;

///----------------------------------------
/// @name Accessing the Set of Participants
///----------------------------------------

@property (nonatomic) LYRUIParticipantPickerSortType sortType;

///-----------------------------------------
/// @name Accessing the Picker Data Source
///-----------------------------------------

@property (nonatomic, weak) id<LYRUIParticipantPickerDataSource> dataSource;

///-----------------------------------------
/// @name Accessing the Picker Delegate
///-----------------------------------------

@property (nonatomic, weak) id<LYRUIParticipantPickerControllerDelegate> participantPickerDelegate;
{'fraction_non_alphanumeric': 0.14179468422336017, 'fraction_numerical': 0.00121921482565228, 'mean_word_length': 3.7416184971098265, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6945711', 'n_tokens_mistral': 2048, 'n_tokens_neox': 1902, 'n_words': 720}