|
| 1 | +/* CalendarKit - An ObjC wrapper around libical |
| 2 | + * Copyright (C) 2024 Hugo Melder |
| 3 | + * |
| 4 | + * SPDX-License-Identifier: MIT |
| 5 | + */ |
| 6 | + |
| 7 | +#import <Foundation/NSData.h> |
| 8 | +#import <Foundation/NSEnumerator.h> |
| 9 | +#import <Foundation/NSError.h> |
| 10 | +#import <Foundation/NSObjCRuntime.h> |
| 11 | +#import <Foundation/NSObject.h> |
| 12 | +#import <Foundation/NSString.h> |
| 13 | + |
| 14 | +// Class reference to avoid cyclic dependency |
| 15 | +@class ICALProperty; |
| 16 | + |
| 17 | +NS_ASSUME_NONNULL_BEGIN |
| 18 | + |
| 19 | +typedef NS_ENUM(NSUInteger, ICALComponentKind) { |
| 20 | + ICALComponentKindPlaceholder, |
| 21 | + /// Used to select all components |
| 22 | + ICALComponentKindAny, |
| 23 | + ICALComponentKindXROOT, |
| 24 | + /// MIME attached data, returned by parser |
| 25 | + ICALComponentKindXATTACH, |
| 26 | + ICALComponentKindVEVENT, |
| 27 | + ICALComponentKindVTODO, |
| 28 | + ICALComponentKindVJOURNAL, |
| 29 | + ICALComponentKindVCALENDAR, |
| 30 | + ICALComponentKindVAGENDA, |
| 31 | + ICALComponentKindVFREEBUSY, |
| 32 | + ICALComponentKindVALARM, |
| 33 | + ICALComponentKindXAUDIOALARM, |
| 34 | + ICALComponentKindXDISPLAYALARM, |
| 35 | + ICALComponentKindXEMAILALARM, |
| 36 | + ICALComponentKindXPROCEDUREALARM, |
| 37 | + ICALComponentKindVTIMEZONE, |
| 38 | + ICALComponentKindXSTANDARD, |
| 39 | + ICALComponentKindXDAYLIGHT, |
| 40 | + ICALComponentKindX, |
| 41 | + ICALComponentKindVSCHEDULE, |
| 42 | + ICALComponentKindVQUERY, |
| 43 | + ICALComponentKindVREPLY, |
| 44 | + ICALComponentKindVCAR, |
| 45 | + ICALComponentKindVCOMMAND, |
| 46 | + ICALComponentKindXLICINVALID, |
| 47 | + ICALComponentKindXLICMIMEPART, |
| 48 | + ICALComponentKindVAVAILABILITY, |
| 49 | + ICALComponentKindXAVAILABLE, |
| 50 | + ICALComponentKindVPOLL, |
| 51 | + ICALComponentKindVVOTER, |
| 52 | + ICALComponentKindXVOTE, |
| 53 | + ICALComponentKindVPATCH, |
| 54 | + ICALComponentKindXPATCH |
| 55 | +}; |
| 56 | + |
| 57 | +@interface ICALComponent : NSObject <NSCopying> { |
| 58 | + void *_handle; |
| 59 | + ICALComponent *_Nullable _root; |
| 60 | +} |
| 61 | + |
| 62 | ++ (instancetype)componentWithData:(NSData *)data error:(NSError **)error; |
| 63 | + |
| 64 | +- (instancetype)initWithData:(NSData *)data error:(NSError **)error; |
| 65 | + |
| 66 | +- (ICALComponentKind)kind; |
| 67 | + |
| 68 | +- (NSString *_Nullable)uid; |
| 69 | + |
| 70 | +- (NSString *_Nullable)summary; |
| 71 | + |
| 72 | +- (id)copyWithZone:(NSZone *)zone; |
| 73 | + |
| 74 | +- (NSInteger)numberOfChildren; |
| 75 | +- (NSInteger)numberOfProperties; |
| 76 | + |
| 77 | +- (void)enumerateComponentsUsingBlock:(void (^)(ICALComponent *component, BOOL *stop))block; |
| 78 | +- (void)enumeratePropertiesUsingBlock:(void (^)(ICALProperty *property, BOOL *stop))block; |
| 79 | + |
| 80 | +@end |
| 81 | + |
| 82 | +NS_ASSUME_NONNULL_END |
0 commit comments