summaryrefslogtreecommitdiff
path: root/fpcsrc/packages/cocoaint/src/foundation/NSMetadata.inc
blob: 98f50411ea38cca0383d995ef5bb1af30fbafe99 (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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
{ Parsed from Foundation.framework NSMetadata.h }

{$ifdef TYPES}
{$ifndef NSMETADATA_PAS_T}
{$define NSMETADATA_PAS_T}

{$endif}
{$endif}

{$ifdef RECORDS}
{$ifndef NSMETADATA_PAS_R}
{$define NSMETADATA_PAS_R}

{$endif}
{$endif}

{$ifdef FUNCTIONS}
{$ifndef NSMETADATA_PAS_F}
{$define NSMETADATA_PAS_F}

{$endif}
{$endif}

{$ifdef EXTERNAL_SYMBOLS}
{$ifndef NSMETADATA_PAS_S}
{$define NSMETADATA_PAS_S}

{ External string constants }
var
  NSMetadataQueryDidStartGatheringNotification: NSString; cvar; external;
  NSMetadataQueryGatheringProgressNotification: NSString; cvar; external;
  NSMetadataQueryDidFinishGatheringNotification: NSString; cvar; external;
  NSMetadataQueryDidUpdateNotification: NSString; cvar; external;
  NSMetadataQueryResultContentRelevanceAttribute: NSString; cvar; external;
  NSMetadataQueryUserHomeScope: NSString; cvar; external;
  NSMetadataQueryLocalComputerScope: NSString; cvar; external;
  NSMetadataQueryNetworkScope: NSString; cvar; external;

{$endif}
{$endif}

{$ifdef FORWARD}
  NSMetadataQueryDelegateProtocol = objcprotocol;
  NSMetadataQuery = objcclass;
  NSMetadataQueryPointer = ^NSMetadataQuery;
  NSMetadataQueryPtr = NSMetadataQueryPointer;
  NSMetadataItem = objcclass;
  NSMetadataItemPointer = ^NSMetadataItem;
  NSMetadataItemPtr = NSMetadataItemPointer;
  NSMetadataQueryAttributeValueTuple = objcclass;
  NSMetadataQueryAttributeValueTuplePointer = ^NSMetadataQueryAttributeValueTuple;
  NSMetadataQueryAttributeValueTuplePtr = NSMetadataQueryAttributeValueTuplePointer;
  NSMetadataQueryResultGroup = objcclass;
  NSMetadataQueryResultGroupPointer = ^NSMetadataQueryResultGroup;
  NSMetadataQueryResultGroupPtr = NSMetadataQueryResultGroupPointer;

{$endif}

{$ifdef CLASSES}
{$ifndef NSMETADATA_PAS_C}
{$define NSMETADATA_PAS_C}

{ NSMetadataQuery }
  NSMetadataQuery = objcclass external (NSObject)
  private
    _flags: NSUInteger;
    _interval: NSTimeInterval;
    _private: array[0..(11)-1] of id;
    _reserved: Pointer; {garbage collector: __strong }
    
  public
    function init: id; message 'init';
    function delegate: NSMetadataQueryDelegateProtocol; message 'delegate';
    procedure setDelegate(delegate_: NSMetadataQueryDelegateProtocol); message 'setDelegate:';
    function predicate: NSPredicate; message 'predicate';
    procedure setPredicate(predicate_: NSPredicate); message 'setPredicate:';
    function sortDescriptors: NSArray; message 'sortDescriptors';
    procedure setSortDescriptors(descriptors: NSArray); message 'setSortDescriptors:';
    function valueListAttributes: NSArray; message 'valueListAttributes';
    procedure setValueListAttributes(attrs: NSArray); message 'setValueListAttributes:';
    function groupingAttributes: NSArray; message 'groupingAttributes';
    procedure setGroupingAttributes(attrs: NSArray); message 'setGroupingAttributes:';
    function notificationBatchingInterval: NSTimeInterval; message 'notificationBatchingInterval';
    procedure setNotificationBatchingInterval(ti: NSTimeInterval); message 'setNotificationBatchingInterval:';
    function searchScopes: NSArray; message 'searchScopes';
    procedure setSearchScopes(scopes: NSArray); message 'setSearchScopes:';
    function startQuery: Boolean; message 'startQuery';
    procedure stopQuery; message 'stopQuery';
    function isStarted: Boolean; message 'isStarted';
    function isGathering: Boolean; message 'isGathering';
    function isStopped: Boolean; message 'isStopped';
    procedure disableUpdates; message 'disableUpdates';
    procedure enableUpdates; message 'enableUpdates';
    function resultCount: NSUInteger; message 'resultCount';
    function resultAtIndex(idx: NSUInteger): id; message 'resultAtIndex:';
    function results: NSArray; message 'results';
    function indexOfResult(result_: id): NSUInteger; message 'indexOfResult:';
    function valueLists: NSDictionary; message 'valueLists';
    function groupedResults: NSArray; message 'groupedResults';
    function valueOfAttribute_forResultAtIndex(attrName: NSString; idx: NSUInteger): id; message 'valueOfAttribute:forResultAtIndex:';
  end;

{ NSMetadataItem }
  NSMetadataItem = objcclass external (NSObject)
  private
    _item: id;
    _reserved: Pointer; {garbage collector: __strong }
    
  public
    function valueForAttribute(key: NSString): id; message 'valueForAttribute:';
    function valuesForAttributes(keys: NSArray): NSDictionary; message 'valuesForAttributes:';
    function attributes: NSArray; message 'attributes';
  end;

{ NSMetadataQueryAttributeValueTuple }
  NSMetadataQueryAttributeValueTuple = objcclass external (NSObject)
  private
    _attr: id;
    _value: id;
    _count: NSUInteger;
    _reserved: Pointer;
    
  public
    function attribute: NSString; message 'attribute';
    function value: id; message 'value';
    function count: NSUInteger; message 'count';
  end;

{ NSMetadataQueryResultGroup }
  NSMetadataQueryResultGroup = objcclass external (NSObject)
  private
    _private: array[0..(9)-1] of id;
    _private2: array[0..(1)-1] of NSUInteger;
    _reserved: Pointer;
    
  public
    function attribute: NSString; message 'attribute';
    function value: id; message 'value';
    function subgroups: NSArray; message 'subgroups';
    function resultCount: NSUInteger; message 'resultCount';
    function resultAtIndex(idx: NSUInteger): id; message 'resultAtIndex:';
    function results: NSArray; message 'results';
  end;

{$endif}
{$endif}
{$ifdef PROTOCOLS}
{$ifndef NSMETADATA_PAS_P}
{$define NSMETADATA_PAS_P}
  
{ NSMetadataQueryDelegate Protocol }
  NSMetadataQueryDelegateProtocol = objcprotocol external name 'NSMetadataQueryDelegate'
  optional
    function metadataQuery_replacementObjectForResultObject(query: NSMetadataQuery; result_: NSMetadataItem): id; message 'metadataQuery:replacementObjectForResultObject:';
    function metadataQuery_replacementValueForAttribute_value(query: NSMetadataQuery; attrName: NSString; attrValue: id): id; message 'metadataQuery:replacementValueForAttribute:value:';
  end;
{$endif}
{$endif}