Skip to content

Commit 268f7d5

Browse files
[various] Standardize Obj-C doc comment style (flutter#6232)
Standardizes Objective-C code on `///` for documentation comments, instead of a mix of that and `/** ... */`. This does not add enforcement, since my expectation is that if we start from a homogeneous style we will be much less likely to diverge again (and if some do creep in, it's harmless). This only changes comments, so is a no-op for package clients. Fixes flutter/flutter#143868
1 parent b3f10aa commit 268f7d5

File tree

45 files changed

+474
-761
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+474
-761
lines changed

packages/camera/camera_avfoundation/ios/Classes/CameraProperties.h

Lines changed: 23 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ NS_ASSUME_NONNULL_BEGIN
99

1010
#pragma mark - flash mode
1111

12-
/**
13-
* Represents camera's flash mode. Mirrors `FlashMode` enum in flash_mode.dart.
14-
*/
12+
/// Represents camera's flash mode. Mirrors `FlashMode` enum in flash_mode.dart.
1513
typedef NS_ENUM(NSInteger, FLTFlashMode) {
1614
FLTFlashModeOff,
1715
FLTFlashModeAuto,
@@ -22,23 +20,17 @@ typedef NS_ENUM(NSInteger, FLTFlashMode) {
2220
FLTFlashModeInvalid,
2321
};
2422

25-
/**
26-
* Gets FLTFlashMode from its string representation.
27-
* @param mode a string representation of the FLTFlashMode.
28-
*/
23+
/// Gets FLTFlashMode from its string representation.
24+
/// @param mode a string representation of the FLTFlashMode.
2925
extern FLTFlashMode FLTGetFLTFlashModeForString(NSString *mode);
3026

31-
/**
32-
* Gets AVCaptureFlashMode from FLTFlashMode.
33-
* @param mode flash mode.
34-
*/
27+
/// Gets AVCaptureFlashMode from FLTFlashMode.
28+
/// @param mode flash mode.
3529
extern AVCaptureFlashMode FLTGetAVCaptureFlashModeForFLTFlashMode(FLTFlashMode mode);
3630

3731
#pragma mark - exposure mode
3832

39-
/**
40-
* Represents camera's exposure mode. Mirrors ExposureMode in camera.dart.
41-
*/
33+
/// Represents camera's exposure mode. Mirrors ExposureMode in camera.dart.
4234
typedef NS_ENUM(NSInteger, FLTExposureMode) {
4335
FLTExposureModeAuto,
4436
FLTExposureModeLocked,
@@ -47,23 +39,17 @@ typedef NS_ENUM(NSInteger, FLTExposureMode) {
4739
FLTExposureModeInvalid,
4840
};
4941

50-
/**
51-
* Gets a string representation of exposure mode.
52-
* @param mode exposure mode
53-
*/
42+
/// Gets a string representation of exposure mode.
43+
/// @param mode exposure mode
5444
extern NSString *FLTGetStringForFLTExposureMode(FLTExposureMode mode);
5545

56-
/**
57-
* Gets FLTExposureMode from its string representation.
58-
* @param mode a string representation of the FLTExposureMode.
59-
*/
46+
/// Gets FLTExposureMode from its string representation.
47+
/// @param mode a string representation of the FLTExposureMode.
6048
extern FLTExposureMode FLTGetFLTExposureModeForString(NSString *mode);
6149

6250
#pragma mark - focus mode
6351

64-
/**
65-
* Represents camera's focus mode. Mirrors FocusMode in camera.dart.
66-
*/
52+
/// Represents camera's focus mode. Mirrors FocusMode in camera.dart.
6753
typedef NS_ENUM(NSInteger, FLTFocusMode) {
6854
FLTFocusModeAuto,
6955
FLTFocusModeLocked,
@@ -72,35 +58,25 @@ typedef NS_ENUM(NSInteger, FLTFocusMode) {
7258
FLTFocusModeInvalid,
7359
};
7460

75-
/**
76-
* Gets a string representation from FLTFocusMode.
77-
* @param mode focus mode
78-
*/
61+
/// Gets a string representation from FLTFocusMode.
62+
/// @param mode focus mode
7963
extern NSString *FLTGetStringForFLTFocusMode(FLTFocusMode mode);
8064

81-
/**
82-
* Gets FLTFocusMode from its string representation.
83-
* @param mode a string representation of focus mode.
84-
*/
65+
/// Gets FLTFocusMode from its string representation.
66+
/// @param mode a string representation of focus mode.
8567
extern FLTFocusMode FLTGetFLTFocusModeForString(NSString *mode);
8668

8769
#pragma mark - device orientation
8870

89-
/**
90-
* Gets UIDeviceOrientation from its string representation.
91-
*/
71+
/// Gets UIDeviceOrientation from its string representation.
9272
extern UIDeviceOrientation FLTGetUIDeviceOrientationForString(NSString *orientation);
9373

94-
/**
95-
* Gets a string representation of UIDeviceOrientation.
96-
*/
74+
/// Gets a string representation of UIDeviceOrientation.
9775
extern NSString *FLTGetStringForUIDeviceOrientation(UIDeviceOrientation orientation);
9876

9977
#pragma mark - resolution preset
10078

101-
/**
102-
* Represents camera's resolution present. Mirrors ResolutionPreset in camera.dart.
103-
*/
79+
/// Represents camera's resolution present. Mirrors ResolutionPreset in camera.dart.
10480
typedef NS_ENUM(NSInteger, FLTResolutionPreset) {
10581
FLTResolutionPresetVeryLow,
10682
FLTResolutionPresetLow,
@@ -114,22 +90,16 @@ typedef NS_ENUM(NSInteger, FLTResolutionPreset) {
11490
FLTResolutionPresetInvalid,
11591
};
11692

117-
/**
118-
* Gets FLTResolutionPreset from its string representation.
119-
* @param preset a string representation of FLTResolutionPreset.
120-
*/
93+
/// Gets FLTResolutionPreset from its string representation.
94+
/// @param preset a string representation of FLTResolutionPreset.
12195
extern FLTResolutionPreset FLTGetFLTResolutionPresetForString(NSString *preset);
12296

12397
#pragma mark - video format
12498

125-
/**
126-
* Gets VideoFormat from its string representation.
127-
*/
99+
/// Gets VideoFormat from its string representation.
128100
extern OSType FLTGetVideoFormatFromString(NSString *videoFormatString);
129101

130-
/**
131-
* Represents image format. Mirrors ImageFileFormat in camera.dart.
132-
*/
102+
/// Represents image format. Mirrors ImageFileFormat in camera.dart.
133103
typedef NS_ENUM(NSInteger, FCPFileFormat) {
134104
FCPFileFormatJPEG,
135105
FCPFileFormatHEIF,
@@ -138,9 +108,7 @@ typedef NS_ENUM(NSInteger, FCPFileFormat) {
138108

139109
#pragma mark - image extension
140110

141-
/**
142-
* Gets a string representation of ImageFileFormat.
143-
*/
111+
/// Gets a string representation of ImageFileFormat.
144112
extern FCPFileFormat FCPGetFileFormatFromString(NSString *fileFormatString);
145113

146114
NS_ASSUME_NONNULL_END

packages/camera/camera_avfoundation/ios/Classes/FLTCam.h

Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414

1515
NS_ASSUME_NONNULL_BEGIN
1616

17-
/**
18-
* A class that manages camera's state and performs camera operations.
19-
*/
17+
/// A class that manages camera's state and performs camera operations.
2018
@interface FLTCam : NSObject <FlutterTexture>
2119

2220
@property(readonly, nonatomic) AVCaptureDevice *captureDevice;
@@ -52,13 +50,11 @@ NS_ASSUME_NONNULL_BEGIN
5250
- (void)close;
5351
- (void)startVideoRecordingWithResult:(FLTThreadSafeFlutterResult *)result;
5452
- (void)setImageFileFormat:(FCPFileFormat)fileFormat;
55-
/**
56-
* Starts recording a video with an optional streaming messenger.
57-
* If the messenger is non-null then it will be called for each
58-
* captured frame, allowing streaming concurrently with recording.
59-
*
60-
* @param messenger Nullable messenger for capturing each frame.
61-
*/
53+
/// Starts recording a video with an optional streaming messenger.
54+
/// If the messenger is non-null then it will be called for each
55+
/// captured frame, allowing streaming concurrently with recording.
56+
///
57+
/// @param messenger Nullable messenger for capturing each frame.
6258
- (void)startVideoRecordingWithResult:(FLTThreadSafeFlutterResult *)result
6359
messengerForStreaming:(nullable NSObject<FlutterBinaryMessenger> *)messenger;
6460
- (void)stopVideoRecordingWithResult:(FLTThreadSafeFlutterResult *)result;
@@ -72,28 +68,24 @@ NS_ASSUME_NONNULL_BEGIN
7268
- (void)setFocusModeWithResult:(FLTThreadSafeFlutterResult *)result mode:(NSString *)modeStr;
7369
- (void)applyFocusMode;
7470

75-
/**
76-
* Acknowledges the receipt of one image stream frame.
77-
*
78-
* This should be called each time a frame is received. Failing to call it may
79-
* cause later frames to be dropped instead of streamed.
80-
*/
71+
/// Acknowledges the receipt of one image stream frame.
72+
///
73+
/// This should be called each time a frame is received. Failing to call it may
74+
/// cause later frames to be dropped instead of streamed.
8175
- (void)receivedImageStreamData;
8276

83-
/**
84-
* Applies FocusMode on the AVCaptureDevice.
85-
*
86-
* If the @c focusMode is set to FocusModeAuto the AVCaptureDevice is configured to use
87-
* AVCaptureFocusModeContinuousModeAutoFocus when supported, otherwise it is set to
88-
* AVCaptureFocusModeAutoFocus. If neither AVCaptureFocusModeContinuousModeAutoFocus nor
89-
* AVCaptureFocusModeAutoFocus are supported focus mode will not be set.
90-
* If @c focusMode is set to FocusModeLocked the AVCaptureDevice is configured to use
91-
* AVCaptureFocusModeAutoFocus. If AVCaptureFocusModeAutoFocus is not supported focus mode will not
92-
* be set.
93-
*
94-
* @param focusMode The focus mode that should be applied to the @captureDevice instance.
95-
* @param captureDevice The AVCaptureDevice to which the @focusMode will be applied.
96-
*/
77+
/// Applies FocusMode on the AVCaptureDevice.
78+
///
79+
/// If the @c focusMode is set to FocusModeAuto the AVCaptureDevice is configured to use
80+
/// AVCaptureFocusModeContinuousModeAutoFocus when supported, otherwise it is set to
81+
/// AVCaptureFocusModeAutoFocus. If neither AVCaptureFocusModeContinuousModeAutoFocus nor
82+
/// AVCaptureFocusModeAutoFocus are supported focus mode will not be set.
83+
/// If @c focusMode is set to FocusModeLocked the AVCaptureDevice is configured to use
84+
/// AVCaptureFocusModeAutoFocus. If AVCaptureFocusModeAutoFocus is not supported focus mode will not
85+
/// be set.
86+
///
87+
/// @param focusMode The focus mode that should be applied to the @captureDevice instance.
88+
/// @param captureDevice The AVCaptureDevice to which the @focusMode will be applied.
9789
- (void)applyFocusMode:(FLTFocusMode)focusMode onDevice:(AVCaptureDevice *)captureDevice;
9890
- (void)pausePreviewWithResult:(FLTThreadSafeFlutterResult *)result;
9991
- (void)resumePreviewWithResult:(FLTThreadSafeFlutterResult *)result;

packages/camera/camera_avfoundation/ios/Classes/FLTSavePhotoDelegate.h

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,14 @@ NS_ASSUME_NONNULL_BEGIN
1818
typedef void (^FLTSavePhotoDelegateCompletionHandler)(NSString *_Nullable path,
1919
NSError *_Nullable error);
2020

21-
/**
22-
Delegate object that handles photo capture results.
23-
*/
21+
/// Delegate object that handles photo capture results.
2422
@interface FLTSavePhotoDelegate : NSObject <AVCapturePhotoCaptureDelegate>
2523

26-
/**
27-
* Initialize a photo capture delegate.
28-
* @param path the path for captured photo file.
29-
* @param ioQueue the queue on which captured photos are written to disk.
30-
* @param completionHandler The completion handler block for save photo operations. Can
31-
* be called from either main queue or IO queue.
32-
*/
24+
/// Initialize a photo capture delegate.
25+
/// @param path the path for captured photo file.
26+
/// @param ioQueue the queue on which captured photos are written to disk.
27+
/// @param completionHandler The completion handler block for save photo operations. Can
28+
/// be called from either main queue or IO queue.
3329
- (instancetype)initWithPath:(NSString *)path
3430
ioQueue:(dispatch_queue_t)ioQueue
3531
completionHandler:(FLTSavePhotoDelegateCompletionHandler)completionHandler;

packages/camera/camera_avfoundation/ios/Classes/FLTSavePhotoDelegate_Test.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44

55
#import "FLTSavePhotoDelegate.h"
66

7-
/**
8-
API exposed for unit tests.
9-
*/
7+
/// API exposed for unit tests.
108
@interface FLTSavePhotoDelegate ()
119

1210
/// The completion handler block for capture and save photo operations.

packages/camera/camera_avfoundation/ios/Classes/FLTThreadSafeEventChannel.h

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,16 @@
66

77
NS_ASSUME_NONNULL_BEGIN
88

9-
/**
10-
* A thread safe wrapper for FlutterEventChannel that can be called from any thread, by dispatching
11-
* its underlying engine calls to the main thread.
12-
*/
9+
/// A thread safe wrapper for FlutterEventChannel that can be called from any thread, by dispatching
10+
/// its underlying engine calls to the main thread.
1311
@interface FLTThreadSafeEventChannel : NSObject
1412

15-
/**
16-
* Creates a FLTThreadSafeEventChannel by wrapping a FlutterEventChannel object.
17-
* @param channel The FlutterEventChannel object to be wrapped.
18-
*/
13+
/// Creates a FLTThreadSafeEventChannel by wrapping a FlutterEventChannel object.
14+
/// @param channel The FlutterEventChannel object to be wrapped.
1915
- (instancetype)initWithEventChannel:(FlutterEventChannel *)channel;
2016

21-
/*
22-
* Registers a handler on the main thread for stream setup requests from the Flutter side.
23-
# The completion block runs on the main thread.
24-
*/
17+
/// Registers a handler on the main thread for stream setup requests from the Flutter side.
18+
/// The completion block runs on the main thread.
2519
- (void)setStreamHandler:(nullable NSObject<FlutterStreamHandler> *)handler
2620
completion:(void (^)(void))completion;
2721

packages/camera/camera_avfoundation/ios/Classes/FLTThreadSafeFlutterResult.h

Lines changed: 14 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,56 +6,38 @@
66

77
NS_ASSUME_NONNULL_BEGIN
88

9-
/**
10-
* A thread safe wrapper for FlutterResult that can be called from any thread, by dispatching its
11-
* underlying engine calls to the main thread.
12-
*/
9+
/// A thread safe wrapper for FlutterResult that can be called from any thread, by dispatching its
10+
/// underlying engine calls to the main thread.
1311
@interface FLTThreadSafeFlutterResult : NSObject
1412

15-
/**
16-
* Gets the original FlutterResult object wrapped by this FLTThreadSafeFlutterResult instance.
17-
*/
13+
/// Gets the original FlutterResult object wrapped by this FLTThreadSafeFlutterResult instance.
1814
@property(readonly, nonatomic) FlutterResult flutterResult;
1915

20-
/**
21-
* Initializes with a FlutterResult object.
22-
* @param result The FlutterResult object that the result will be given to.
23-
*/
16+
/// Initializes with a FlutterResult object.
17+
/// @param result The FlutterResult object that the result will be given to.
2418
- (instancetype)initWithResult:(FlutterResult)result;
2519

26-
/**
27-
* Sends a successful result on the main thread without any data.
28-
*/
20+
/// Sends a successful result on the main thread without any data.
2921
- (void)sendSuccess;
3022

31-
/**
32-
* Sends a successful result on the main thread with data.
33-
* @param data Result data that is send to the Flutter Dart side.
34-
*/
23+
/// Sends a successful result on the main thread with data.
24+
/// @param data Result data that is send to the Flutter Dart side.
3525
- (void)sendSuccessWithData:(id)data;
3626

37-
/**
38-
* Sends an NSError as result on the main thread.
39-
* @param error Error that will be send as FlutterError.
40-
*/
27+
/// Sends an NSError as result on the main thread.
28+
/// @param error Error that will be send as FlutterError.
4129
- (void)sendError:(NSError *)error;
4230

43-
/**
44-
* Sends a FlutterError as result on the main thread.
45-
* @param flutterError FlutterError that will be sent to the Flutter Dart side.
46-
*/
31+
/// Sends a FlutterError as result on the main thread.
32+
/// @param flutterError FlutterError that will be sent to the Flutter Dart side.
4733
- (void)sendFlutterError:(FlutterError *)flutterError;
4834

49-
/**
50-
* Sends a FlutterError as result on the main thread.
51-
*/
35+
/// Sends a FlutterError as result on the main thread.
5236
- (void)sendErrorWithCode:(NSString *)code
5337
message:(nullable NSString *)message
5438
details:(nullable id)details;
5539

56-
/**
57-
* Sends FlutterMethodNotImplemented as result on the main thread.
58-
*/
40+
/// Sends FlutterMethodNotImplemented as result on the main thread.
5941
- (void)sendNotImplemented;
6042
@end
6143

packages/camera/camera_avfoundation/ios/Classes/FLTThreadSafeFlutterResult.m

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ - (void)sendNotImplemented {
4747
[self send:FlutterMethodNotImplemented];
4848
}
4949

50-
/**
51-
* Sends result to flutterResult on the main thread.
52-
*/
50+
/// Sends result to flutterResult on the main thread.
5351
- (void)send:(id _Nullable)result {
5452
FLTEnsureToRunOnMainQueue(^{
5553
// WARNING: Should not use weak self, because `FlutterResult`s are passed as arguments

packages/camera/camera_avfoundation/ios/Classes/FLTThreadSafeMethodChannel.h

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,15 @@
66

77
NS_ASSUME_NONNULL_BEGIN
88

9-
/**
10-
* A thread safe wrapper for FlutterMethodChannel that can be called from any thread, by dispatching
11-
* its underlying engine calls to the main thread.
12-
*/
9+
/// A thread safe wrapper for FlutterMethodChannel that can be called from any thread, by
10+
/// dispatching its underlying engine calls to the main thread.
1311
@interface FLTThreadSafeMethodChannel : NSObject
1412

15-
/**
16-
* Creates a FLTThreadSafeMethodChannel by wrapping a FlutterMethodChannel object.
17-
* @param channel The FlutterMethodChannel object to be wrapped.
18-
*/
13+
/// Creates a FLTThreadSafeMethodChannel by wrapping a FlutterMethodChannel object.
14+
/// @param channel The FlutterMethodChannel object to be wrapped.
1915
- (instancetype)initWithMethodChannel:(FlutterMethodChannel *)channel;
2016

21-
/**
22-
* Invokes the specified flutter method on the main thread with the specified arguments.
23-
*/
17+
/// Invokes the specified flutter method on the main thread with the specified arguments.
2418
- (void)invokeMethod:(NSString *)method arguments:(nullable id)arguments;
2519

2620
@end

0 commit comments

Comments
 (0)