summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/private/SDLPreloadPresentChoicesOperationUtilities.h
blob: 72be60d9a6435b14a558c99ec454de9005b2c8fb (plain)
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
//
//  SDLPreloadPresentChoiceSetOperationUtilities.h
//  SmartDeviceLink
//
//  Created by Joel Fischer on 8/27/21.
//  Copyright © 2021 smartdevicelink. All rights reserved.
//

#import <Foundation/Foundation.h>

@class SDLChoiceCell;
@class SDLChoiceSet;
@class SDLWindowCapability;

NS_ASSUME_NONNULL_BEGIN

@interface SDLPreloadPresentChoicesOperationUtilities : NSObject

@property (class, assign, nonatomic) UInt16 choiceId;
@property (class, assign, nonatomic) BOOL reachedMaxId;

/// Assigns a unique id to each choice item.
/// @param cells An array of choices
/// @param loadedCells The already loaded cells with ids to avoid
+ (void)assignIdsToCells:(NSOrderedSet<SDLChoiceCell *> *)cells loadedCells:(NSSet<SDLChoiceCell *> *)loadedCells;

+ (void)makeCellsToUploadUnique:(NSMutableOrderedSet<SDLChoiceCell *> *)cellsToUpload basedOnLoadedCells:(NSMutableSet<SDLChoiceCell *> *)loadedCells windowCapability:(SDLWindowCapability *)windowCapability;
+ (void)updateChoiceSet:(SDLChoiceSet *)choiceSet withLoadedCells:(NSSet<SDLChoiceCell *> *)loadedCells cellsToUpload:(NSSet<SDLChoiceCell *> *)cellsToUpload;

@end

NS_ASSUME_NONNULL_END