From 40ed4a3181ef62a9f41ef76a57d7bfa1ff669b2c Mon Sep 17 00:00:00 2001 From: Kiryl Kaveryn Date: Thu, 15 Aug 2024 21:09:56 +0400 Subject: [PATCH] [ios] implement `track recording` feature support to the FrameworkHelper to ineterop with the cpp code Signed-off-by: Kiryl Kaveryn --- .../CoreApi/Framework/MWMFrameworkHelper.h | 12 ++++++++++- .../CoreApi/Framework/MWMFrameworkHelper.mm | 20 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/iphone/CoreApi/CoreApi/Framework/MWMFrameworkHelper.h b/iphone/CoreApi/CoreApi/Framework/MWMFrameworkHelper.h index 1f0d5c170f..8bae421b92 100644 --- a/iphone/CoreApi/CoreApi/Framework/MWMFrameworkHelper.h +++ b/iphone/CoreApi/CoreApi/Framework/MWMFrameworkHelper.h @@ -11,8 +11,18 @@ NS_ASSUME_NONNULL_BEGIN typedef void (^SearchInDownloaderCompletions)(NSArray *results, BOOL finished); +@protocol TrackRecorder + ++ (void)startTrackRecording; ++ (void)stopTrackRecording; ++ (void)saveTrackRecordingWithName:(nullable NSString *)name; ++ (BOOL)isTrackRecordingEnabled; ++ (BOOL)isTrackRecordingEmpty; + +@end + NS_SWIFT_NAME(FrameworkHelper) -@interface MWMFrameworkHelper : NSObject +@interface MWMFrameworkHelper : NSObject + (void)processFirstLaunch:(BOOL)hasLocation; + (void)setVisibleViewport:(CGRect)rect scaleFactor:(CGFloat)scale; diff --git a/iphone/CoreApi/CoreApi/Framework/MWMFrameworkHelper.mm b/iphone/CoreApi/CoreApi/Framework/MWMFrameworkHelper.mm index 6581a9cdd5..57febe24ea 100644 --- a/iphone/CoreApi/CoreApi/Framework/MWMFrameworkHelper.mm +++ b/iphone/CoreApi/CoreApi/Framework/MWMFrameworkHelper.mm @@ -196,4 +196,24 @@ return GetFramework().GetDrawScale(); } ++ (void)startTrackRecording { + GetFramework().StartTrackRecording(); +} + ++ (void)stopTrackRecording { + GetFramework().StopTrackRecording(); +} + ++ (void)saveTrackRecordingWithName:(nullable NSString *)name { + GetFramework().SaveTrackRecordingWithName(name == nil ? "" : name.UTF8String); +} + ++ (BOOL)isTrackRecordingEnabled { + return GetFramework().IsTrackRecordingEnabled(); +} + ++ (BOOL)isTrackRecordingEmpty { + return GetFramework().IsTrackRecordingEmpty(); +} + @end