Files
ghostgram/submodules/TelegramUI/Components/RichTextEditor/Sources/RichTextInputDecUpstream/include/IDSelectionPresentation.h
T
ichmagmaus111andClaude Opus 5.5 534cabe35b bug fixes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 16:55:08 +01:00

43 lines
1.8 KiB
Objective-C

#import <TargetConditionals.h>
#if TARGET_OS_IOS
@import UIKit;
NS_ASSUME_NONNULL_BEGIN
@interface IDSelectionPresentationSnapshot : NSObject
@property(nonatomic, readonly) NSRange canonicalSelection;
@property(nonatomic, readonly) CGRect caretRect;
@property(nonatomic, copy, readonly) NSArray<UITextSelectionRect *> *selectionRects;
@property(nonatomic, readonly) CGRect visibleBounds;
@property(nonatomic, readonly) CGPoint contentOffset;
- (instancetype)initWithCanonicalSelection:(NSRange)selection
caretRect:(CGRect)caretRect
selectionRects:(NSArray<UITextSelectionRect *> *)rects
visibleBounds:(CGRect)visibleBounds
contentOffset:(CGPoint)contentOffset
NS_DESIGNATED_INITIALIZER;
- (instancetype)init NS_UNAVAILABLE;
@end
@protocol IDSelectionPresentationBackend <NSObject>
@property(nonatomic, readonly, nullable) UIView *existingSelectionContainerView;
@property(nonatomic, readonly) NSUInteger presentationUpdateCount;
@property(nonatomic, readonly) NSUInteger selectionContainerCreationCount;
- (UIView *)id_selectionContainerView;
- (void)placeSelectionContainerView;
- (void)updateWithSnapshot:(IDSelectionPresentationSnapshot *)snapshot;
- (void)tearDown;
@end
@class IDBlockTextView;
/// Gated with `IDBlockTextView`, which it takes as its parameter. Clang accepts an availability
/// attribute on a typedef, which is what this needs — compiling the typedef OUT at a lower floor
/// would leave `IDBlockTextViewInternal.h`'s initialiser referencing an undefined type.
typedef id<IDSelectionPresentationBackend> _Nonnull
(^IDSelectionPresentationBackendFactory)(IDBlockTextView *hostView) API_AVAILABLE(ios(18.4));
NS_ASSUME_NONNULL_END
#endif