summaryrefslogtreecommitdiff
path: root/packages/cocoaint/src/foundation/NSKeyValueObserving.inc
blob: ff4cd622d29d05f265d16eb28cc92a7f6122bb6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
{ Parsed from Foundation.framework NSKeyValueObserving.h }
{ Version: 2.1.2 - Wed Dec 8 10:06:43 CET 2010 }


{$ifdef TYPES}
{$ifndef NSKEYVALUEOBSERVING_PAS_T}
{$define NSKEYVALUEOBSERVING_PAS_T}

{ Constants }

const
  NSKeyValueObservingOptionNew = $01;
  NSKeyValueObservingOptionOld = $02;
  NSKeyValueObservingOptionInitial = $04;
  NSKeyValueObservingOptionPrior = $08;

const
  NSKeyValueChangeSetting = 1;
  NSKeyValueChangeInsertion = 2;
  NSKeyValueChangeRemoval = 3;
  NSKeyValueChangeReplacement = 4;

const
  NSKeyValueUnionSetMutation = 1;
  NSKeyValueMinusSetMutation = 2;
  NSKeyValueIntersectSetMutation = 3;
  NSKeyValueSetSetMutation = 4;

{ Types }
type
  NSKeyValueObservingOptions = NSUInteger;
  NSKeyValueObservingOptionsPtr = ^NSKeyValueObservingOptions;
  NSKeyValueChange = NSUInteger;
  NSKeyValueChangePtr = ^NSKeyValueChange;
  NSKeyValueSetMutationKind = NSUInteger;
  NSKeyValueSetMutationKindPtr = ^NSKeyValueSetMutationKind;

{$endif}
{$endif}

{$ifdef RECORDS}
{$ifndef NSKEYVALUEOBSERVING_PAS_R}
{$define NSKEYVALUEOBSERVING_PAS_R}

{$endif}
{$endif}

{$ifdef FUNCTIONS}
{$ifndef NSKEYVALUEOBSERVING_PAS_F}
{$define NSKEYVALUEOBSERVING_PAS_F}

{$endif}
{$endif}

{$ifdef EXTERNAL_SYMBOLS}
{$ifndef NSKEYVALUEOBSERVING_PAS_S}
{$define NSKEYVALUEOBSERVING_PAS_S}

{ External string constants }
var
  NSKeyValueChangeKindKey: NSString; cvar; external;
  NSKeyValueChangeNewKey: NSString; cvar; external;
  NSKeyValueChangeOldKey: NSString; cvar; external;
  NSKeyValueChangeIndexesKey: NSString; cvar; external;
  NSKeyValueChangeNotificationIsPriorKey: NSString; cvar; external;

{$endif}
{$endif}

{$ifdef FORWARD}

{$endif}

{$ifdef CLASSES}
{$ifndef NSKEYVALUEOBSERVING_PAS_C}
{$define NSKEYVALUEOBSERVING_PAS_C}

{ NSKeyValueObservingCategory }
  NSKeyValueObservingCategory = objccategory(NSObject)
    procedure observeValueForKeyPath_ofObject_change_context(keyPath: NSString; object_: id; change: NSDictionary; context: Pointer); message 'observeValueForKeyPath:ofObject:change:context:';
  end; external;

{ NSKeyValueObserverRegistrationCategory }
  NSKeyValueObserverRegistrationCategory = objccategory(NSObject)
    procedure addObserver_forKeyPath_options_context(observer: NSObject; keyPath: NSString; options: NSKeyValueObservingOptions; context: Pointer); message 'addObserver:forKeyPath:options:context:';
    procedure removeObserver_forKeyPath(observer: NSObject; keyPath: NSString); message 'removeObserver:forKeyPath:';
  end; external;

{ NSKeyValueObserverRegistration_NSArrayCategory }
  NSKeyValueObserverRegistration_NSArrayCategory = objccategory(NSArray)
    procedure addObserver_toObjectsAtIndexes_forKeyPath_options_context(observer: NSObject; indexes: NSIndexSet; keyPath: NSString; options: NSKeyValueObservingOptions; context: Pointer); message 'addObserver:toObjectsAtIndexes:forKeyPath:options:context:';
    procedure removeObserver_fromObjectsAtIndexes_forKeyPath(observer: NSObject; indexes: NSIndexSet; keyPath: NSString); message 'removeObserver:fromObjectsAtIndexes:forKeyPath:';
    procedure addObserver_forKeyPath_options_context(observer: NSObject; keyPath: NSString; options: NSKeyValueObservingOptions; context: Pointer); message 'addObserver:forKeyPath:options:context:';
    procedure removeObserver_forKeyPath(observer: NSObject; keyPath: NSString); message 'removeObserver:forKeyPath:';
  end; external name 'NSKeyValueObserverRegistration';

{ NSKeyValueObserverRegistration_NSSetCategory }
  NSKeyValueObserverRegistration_NSSetCategory = objccategory(NSSet)
    procedure addObserver_forKeyPath_options_context(observer: NSObject; keyPath: NSString; options: NSKeyValueObservingOptions; context: Pointer); message 'addObserver:forKeyPath:options:context:';
    procedure removeObserver_forKeyPath(observer: NSObject; keyPath: NSString); message 'removeObserver:forKeyPath:';
  end; external name 'NSKeyValueObserverRegistration';

{ NSKeyValueObserverNotificationCategory }
  NSKeyValueObserverNotificationCategory = objccategory(NSObject)
    procedure willChangeValueForKey(key: NSString); message 'willChangeValueForKey:';
    procedure didChangeValueForKey(key: NSString); message 'didChangeValueForKey:';
    procedure willChange_valuesAtIndexes_forKey(changeKind: NSKeyValueChange; indexes: NSIndexSet; key: NSString); message 'willChange:valuesAtIndexes:forKey:';
    procedure didChange_valuesAtIndexes_forKey(changeKind: NSKeyValueChange; indexes: NSIndexSet; key: NSString); message 'didChange:valuesAtIndexes:forKey:';
    procedure willChangeValueForKey_withSetMutation_usingObjects(key: NSString; mutationKind: NSKeyValueSetMutationKind; objects: NSSet); message 'willChangeValueForKey:withSetMutation:usingObjects:';
    procedure didChangeValueForKey_withSetMutation_usingObjects(key: NSString; mutationKind: NSKeyValueSetMutationKind; objects: NSSet); message 'didChangeValueForKey:withSetMutation:usingObjects:';
  end; external;

{ NSKeyValueObservingCustomizationCategory }
  NSKeyValueObservingCustomizationCategory = objccategory(NSObject)
    class function keyPathsForValuesAffectingValueForKey(key: NSString): NSSet; message 'keyPathsForValuesAffectingValueForKey:';
    class function automaticallyNotifiesObserversForKey(key: NSString): Boolean; message 'automaticallyNotifiesObserversForKey:';
    procedure setObservationInfo(observationInfo: Pointer); message 'setObservationInfo:';
    function observationInfo: Pointer; message 'observationInfo';
  end; external;

{ NSDeprecatedKeyValueObservingCustomizationCategory }
  NSDeprecatedKeyValueObservingCustomizationCategory = objccategory(NSObject)
    class procedure setKeys_triggerChangeNotificationsForDependentKey(keys: NSArray; dependentKey: NSString); message 'setKeys:triggerChangeNotificationsForDependentKey:'; deprecated 'in Mac OS X 10.5 and later';
  end; external;

{$endif}
{$endif}