Added more protocols to clarify types for certain editors

This commit is contained in:
Michael Starke
2022-03-01 10:59:04 +01:00
parent 101cf7f6bd
commit a790103cd2
8 changed files with 32 additions and 10 deletions

View File

@@ -7,6 +7,10 @@
//
#import <Foundation/Foundation.h>
@class KPKAttribute;
@class KPKEntry;
@class KPKTimeInfo;
@class KPKNode;
NS_ASSUME_NONNULL_BEGIN
@@ -14,12 +18,33 @@ NS_ASSUME_NONNULL_BEGIN
/// Individual editors shoudl adopt different APIs to accomodate their needs
/// The preferred way to set model data is to use the representedObject
@protocol MPInspectorEditor <NSObject>
@required
@property (nonatomic) BOOL isEditor;
- (void)commitChanges;
@end
/// NodeInspectorEditors require the represented object to be a KPKNode
@protocol KPKNodeInspectorEditor <MPInspectorEditor>
@required
@property (nonatomic, nullable, readonly, strong) KPKNode *representedNode;
@end
/// EntryInspectorEditors require the represented object to be a KPKEnty
@protocol MPEntryInspectorEditor <MPInspectorEditor>
@required
@property (nonatomic, nullable, readonly, strong) KPKEntry *representedEntry;
@end
/// AttributeInspectorEditors require the represented object to be a KPKAttribute
@protocol MPAttributeInspectorEditor <MPInspectorEditor>
@required
@property (nonatomic, nullable, readonly, strong) KPKAttribute *representedAttribute;
@end
/// TimeInfoInpspectorEditors require the represented object to be a KPKTimeInfo
@protocol MPTimeInfoInpspectorEditor <MPInspectorEditor>
@required
@property (nonatomic, nullable, readonly, strong) KPKTimeInfo *representedTimeInfo;
@end
NS_ASSUME_NONNULL_END