Skip to content

Commit

Permalink
[#97] Rename CRApplication{Delegate} to `Criollo.Application{Delega…
Browse files Browse the repository at this point in the history
…te}`
  • Loading branch information
thecatalinstan committed Sep 14, 2022
1 parent 8667300 commit ce045d8
Showing 1 changed file with 35 additions and 32 deletions.
67 changes: 35 additions & 32 deletions Criollo/Public Headers/Criollo/CRApplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@

#import <Foundation/Foundation.h>

/**
* These constants define wether a Criollo app should terminate or not and are
* are used by the CRApplicationDelegate method `applicationShouldTerminate`.
*
* @see https://developer.apple.com/reference/appkit/nsapplicationterminatereply
*/
typedef NS_ENUM(NSUInteger, CRApplicationTerminateReply) {
/// These constants define wether a Criollo app should terminate or not and are
/// are used by the @c CRApplicationDelegate method @c -applicationShouldTerminate:
///
/// @see https://developer.apple.com/reference/appkit/nsapplicationterminatereply

typedef NS_ENUM(NSUInteger, CRApplicationTerminateReply) {
CRTerminateCancel = 0,
CRTerminateNow = 1,
CRTerminateLater = 2
Expand All @@ -24,38 +23,41 @@ typedef NS_ENUM(NSUInteger, CRApplicationTerminateReply) {

NS_ASSUME_NONNULL_BEGIN

/**
* The CRApplicationDelegate protocol defines the methods that may be implemented
* by delegates of CRApplication objects. It is mean to mimic the behavior of
* NSApplicationDelegate.
*
* @see https://developer.apple.com/reference/appkit/nsapplicationdelegate
*/
/// The @c CRApplicationDelegate protocol defines the methods that may be
/// implemented by delegates of @c CRApplication objects. It is meant to mimic
/// the behavior of @c NSApplicationDelegate.
///
/// @see https://developer.apple.com/reference/appkit/nsapplicationdelegate
NS_SWIFT_NAME(ApplicationDelegate)
@protocol CRApplicationDelegate

@required
/**
* Sent by the default notification center after the application has been launched
* and initialized but before it has received its first event.
*
* @param notification A notification named CRApplicationDidFinishLaunchingNotification.
* Calling the `object` method of this notification returns the CRApplication
* object itself.
*/

/// Sent by the default notification center after the application has been launched
/// and initialized but before it has received its first event.
///
/// @param notification A notification named @c CRApplicationDidFinishLaunchingNotification.
///
/// Calling the @c object method of this notification returns the @c CRApplication
/// object itself.
- (void)applicationDidFinishLaunching:(NSNotification *)notification;

@optional
/**
* Sent by the default notification center immediately before the application
* object is initialized.
*
* @param notification A notification named CRApplicationWillFinishLaunchingNotification.
* Calling the `object` method of this notification returns the CRApplication
* object itself.
*/
/// Sent by the default notification center immediately before the application
/// object is initialized.
///
/// @param notification A notification named CRApplicationWillFinishLaunchingNotification.
///
/// Calling the `object` method of this notification returns the CRApplication
/// object itself.
- (void)applicationWillFinishLaunching:(NSNotification *)notification;

/// <#Description#>
/// @param sender <#sender description#>
- (CRApplicationTerminateReply)applicationShouldTerminate:(CRApplication *)sender;

/// <#Description#>
/// @param notification <#notification description#>
- (void)applicationWillTerminate:(NSNotification *)notification;

@end
Expand All @@ -64,9 +66,10 @@ FOUNDATION_EXPORT NSNotificationName const CRApplicationWillFinishLaunchingNotif
FOUNDATION_EXPORT NSNotificationName const CRApplicationDidFinishLaunchingNotification;
FOUNDATION_EXPORT NSNotificationName const CRApplicationWillTerminateNotification;

FOUNDATION_EXPORT id CRApp;
FOUNDATION_EXPORT int CRApplicationMain(int argc, const char * _Nullable argv[_Nullable], id<CRApplicationDelegate> delegate);
FOUNDATION_EXPORT id CRApp NS_SWIFT_UNAVAILABLE("");
FOUNDATION_EXPORT int CRApplicationMain(int argc, const char * _Nullable argv[_Nullable], id<CRApplicationDelegate> delegate) NS_SWIFT_UNAVAILABLE("");

NS_SWIFT_NAME(Application)
@interface CRApplication : NSObject

@property (nonatomic, readonly, weak) id<CRApplicationDelegate> delegate;
Expand Down

0 comments on commit ce045d8

Please sign in to comment.