forked from tomaz/appledoc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathXMLBasedOutputGenerator+ObjectSubclassAPI.h
373 lines (303 loc) · 16.9 KB
/
XMLBasedOutputGenerator+ObjectSubclassAPI.h
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
//
// XMLBasedOutputGenerator+ObjectSubclassAPI.h
// appledoc
//
// Created by Tomaz Kragelj on 28.5.09.
// Copyright (C) 2009, Tomaz Kragelj. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "XMLBasedOutputGenerator.h"
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
/** Defines helper virtual methods for the @c XMLBasedOutputGenerator subclasses that help
objects output generation.
*/
@interface XMLBasedOutputGenerator (ObjectSubclassAPI)
//////////////////////////////////////////////////////////////////////////////////////////
/// @name Subclass object file header and footer handling
//////////////////////////////////////////////////////////////////////////////////////////
/** Appends any header text before the actual generation starts.
The message is sent from the @c XMLBasedOutputGenerator::generateOutputForObject:() as
the first message. It gives subclasses a chance to append data to the output before the
actual output generation starts. After this message is sent, the rest of the messages are
followed and as the last one, @c appendObjectFooterToData:() is sent.
@param data The data to append to. This is guaranteed to be non @c mil.
@exception NSException Thrown if appending fails.
@see XMLBasedOutputGenerator::generateOutputForObject:
@see appendObjectFooterToData:
*/
- (void) appendObjectHeaderToData:(NSMutableData*) data;
/** Appends any footer text after output generation ends.
The message is sent from the @c XMLBasedOutputGenerator::generateOutputForObject:() as the
last message. It gives subclasses a chance to append data to the output after the rest
of the output is generated. This is ussually the place to "close" open tags or similar.
@param data The data to append to. This is guaranteed to be non @c mil.
@exception NSException Thrown if appending fails.
@see XMLBasedOutputGenerator::generateOutputForObject:
@see appendObjectHeaderToData:
*/
- (void) appendObjectFooterToData:(NSMutableData*) data;
//////////////////////////////////////////////////////////////////////////////////////////
/// @name Subclass object info handling
//////////////////////////////////////////////////////////////////////////////////////////
/** Appends any object info header text before the actual generation starts.
The message is sent from the @c XMLBasedOutputGenerator::generateOutputForObject:() just
before object info items are generated. It gives subclasses a chance to append data to
the output before the generation for secion items starts. After this message is sent,
at least one @c appendObjectInfoItemToData:fromItems:index:type:() message is sent and
then @c appendObjectInfoHeaderToData:() is sent at the end.
@param data The data to append to. This is guaranteed to be non @c mil.
@exception NSException Thrown if appending fails.
@see XMLBasedOutputGenerator::generateOutputForObject:
@see appendObjectInfoItemToData:fromItems:index:type:
@see appendObjectInfoFooterToData:
*/
- (void) appendObjectInfoHeaderToData:(NSMutableData*) data;
/** Appends any object info footer text after the object info items generation ends.
The message is sent from the @c XMLBasedOutputGenerator::generateOutputForObject:() as the
last info generation message. It gives subclasses a chance to append data to the output
after the info items generation is finished. This is ussually the place to "close" open
tags or similar.
@param data The data to append to. This is guaranteed to be non @c mil.
@exception NSException Thrown if appending fails.
@see XMLBasedOutputGenerator::generateOutputForObject:
@see appendObjectInfoHeaderToData:
@see appendObjectInfoItemToData:fromItems:index:type:
*/
- (void) appendObjectInfoFooterToData:(NSMutableData*) data;
/** Appends the given object info item data.
This message is sent from @c XMLBasedOutputGenerator::generateOutputForObject:() for each
applicable object info item type. The subclass should append the data for the given item.
The subclass can get more information about the object info item by investigating the
given array which contains objects that can be used to query additional data for
individual item.
The type identifies the type of the info item and can be one of the following:
- @c kTKInfoItemInherits: The @c nodes contain inherit from information. Only one node
is in the list in most (all) cases.
- @c kTKInfoItemConforms: The @c nodes contain conforms to information. The nodes list may
contain one or more protocols to which the object conforms.
- @c kTKInfoItemDeclared: The @c nodex contain declared in information. Only one node
is in the list in most (all) cases.
@param data The data to append to. This is guaranteed to be non @c mil.
@param items The array of info items instances describing individual items.
@param index Zero based index of the item within the info object info.
@param type The type of the item.
@exception NSException Thrown if appending fails.
@see XMLBasedOutputGenerator::generateOutputForObject:
@see appendObjectInfoHeaderToData:
@see appendObjectInfoFooterToData:
*/
- (void) appendObjectInfoItemToData:(NSMutableData*) data
fromItems:(NSArray*) items
index:(int) index
type:(int) type;
//////////////////////////////////////////////////////////////////////////////////////////
/// @name Subclass object overview handling
//////////////////////////////////////////////////////////////////////////////////////////
/** Appends object overview description.
This message is sent from @c XMLBasedOutputGenerator::generateOutputForObject:() if the object
has brief and or detailed documentation assigned. It gives subclasses a chance to append
object overview from the gathered documentation. The given @c item contains brief and
detailed object description and can be treated as any other description item.
@param data The data to append to. This is guaranteed to be non @c mil.
@param item The item that contains the brief and detailed description.
@exception NSException Thrown if appending fails.
@see XMLBasedOutputGenerator::generateOutputForObject:
*/
- (void) appendObjectOverviewToData:(NSMutableData*) data
fromItem:(id) item;
//////////////////////////////////////////////////////////////////////////////////////////
/// @name Subclass object tasks handling
//////////////////////////////////////////////////////////////////////////////////////////
/** Appends any tasks header before the actual tasks generation starts.
The message is sent from the @c XMLBasedOutputGenerator::generateOutputForObject:() if the
object has at least one task defined. It gives subclasses a chance to append data to the
output before any individual task handling is started. After this message is sent, each
individual task is handled and when all tasks are done, @c appendObjectTasksFooterToData:()
is sent.
@param data The data to append to. This is guaranteed to be non @c mil.
@exception NSException Thrown if appending fails.
@see XMLBasedOutputGenerator::generateOutputForObject:
@see appendObjectTaskHeaderToData:fromItem:index:
@see appendObjectTaskFooterToData:fromItem:index:
@see appendObjectTasksFooterToData:
*/
- (void) appendObjectTasksHeaderToData:(NSMutableData*) data;
/** Appends any tasks footer after sections generation ends.
The message is sent from the @c XMLBasedOutputGenerator::generateOutputForObject:() after all
tasks have been processed. It gives subclasses a chance to append data to the output at
that point. This is ussually the place to "close" tasks open tags or similar.
@param data The data to append to. This is guaranteed to be non @c mil.
@exception NSException Thrown if appending fails.
@see XMLBasedOutputGenerator::generateOutputForObject:
@see appendObjectTasksHeaderToData:
@see appendObjectTaskHeaderToData:fromItem:index:
@see appendObjectTaskMemberToData:fromItem:index:
@see appendObjectTaskFooterToData:fromItem:index:
*/
- (void) appendObjectTasksFooterToData:(NSMutableData*) data;
/** Appends an individual task header before the task members generation starts.
The message is sent from the @c XMLBasedOutputGenerator::generateOutputForObject:() for each
task which has at least one member. It gives subclasses a chance to append data to the
output before member handling for the given task starts.
@param data The data to append to. This is guaranteed to be non @c mil.
@param item The item that contains the task description.
@param index Zero based index of the task.
@exception NSException Thrown if appending fails.
@see XMLBasedOutputGenerator::generateOutputForObject:
@see appendObjectTasksHeaderToData:
@see appendObjectTaskMemberToData:fromItem:index:
@see appendObjectTaskFooterToData:fromItem:index:
@see appendObjectTasksFooterToData:
*/
- (void) appendObjectTaskHeaderToData:(NSMutableData*) data
fromItem:(id) item
index:(int) index;
/** Appends an individual task footer after the task members generation ends.
The message is sent from the @c XMLBasedOutputGenerator::generateOutputForObject:() after all
task members have been processed. It gives subclasses a chance to append data to the output
at that point. This is ussually the place to "close" tasks open tags or similar.
@param data The data to append to. This is guaranteed to be non @c mil.
@param item The item that contains the task description.
@param index Zero based index of the task.
@exception NSException Thrown if appending fails.
@see XMLBasedOutputGenerator::generateOutputForObject:
@see appendObjectTasksHeaderToData:
@see appendObjectTaskHeaderToData:fromItem:index:
@see appendObjectTaskMemberToData:fromItem:index:
@see appendObjectTasksFooterToData:
*/
- (void) appendObjectTaskFooterToData:(NSMutableData*) data
fromItem:(id) item
index:(int) index;
/** Appends a task member data.
This message is sent from the @c XMLBasedOutputGenerator::generateOutputForObject:() for each
task member (class or instance method or property). Subclasses should append any desired
data for the given member.
@param data The data to append to. This is guaranteed to be non @c mil.
@param item The item that contains the task member description.
@param index Zero based index of the member within the task.
@exception NSException Thrown if appending fails.
@see XMLBasedOutputGenerator::generateOutputForObject:
@see appendObjectTasksHeaderToData:
@see appendObjectTaskHeaderToData:fromItem:index:
@see appendObjectTaskFooterToData:fromItem:index:
@see appendObjectTasksFooterToData:
*/
- (void) appendObjectTaskMemberToData:(NSMutableData*) data
fromItem:(id) item
index:(int) index;
//////////////////////////////////////////////////////////////////////////////////////////
/// @name Subclass object member groups handling
//////////////////////////////////////////////////////////////////////////////////////////
/** Appends any main members documentation header before the actual member generation starts.
The message is sent from the @c XMLBasedOutputGenerator::generateOutputForObject:() if the
object has at least one main member group defined. It gives subclasses a chance to append
data to the output before any individual member handling is started. After this message
is sent, each individual member group is handled and when all members are done,
@c appendObjectMembersFooterToData:() is sent.
@param data The data to append to. This is guaranteed to be non @c mil.
@exception NSException Thrown if appending fails.
@see XMLBasedOutputGenerator::generateOutputForObject:
@see appendObjectMembersFooterToData:
@see appendObjectMemberGroupHeaderToData:type:
@see appendObjectMemberGroupFooterToData:type:
@see appendObjectMemberToData:fromItem:index:
*/
- (void) appendObjectMembersHeaderToData:(NSMutableData*) data;
/** Appends any main members documentation footer after members generation ends.
The message is sent from the @c XMLBasedOutputGenerator::generateOutputForObject:() after all
member groups have been processed. It gives subclasses a chance to append data to the
output at that point. This is ussually the place to "close" sections open tags or similar.
@param data The data to append to. This is guaranteed to be non @c mil.
@exception NSException Thrown if appending fails.
@see XMLBasedOutputGenerator::generateOutputForObject:
@see appendObjectMembersHeaderToData:
@see appendObjectMemberGroupHeaderToData:type:
@see appendObjectMemberGroupFooterToData:type:
@see appendObjectMemberToData:fromItem:index:
*/
- (void) appendObjectMembersFooterToData:(NSMutableData*) data;
/** Appends member group header data.
This message is sent from @c XMLBasedOutputGenerator::generateOutputForObject:() for each
main member documentation group. The group is specified with the @c type parameter and
can be one of the following:
- @c kTKObjectMemberTypeClass: The group describes class members.
- @c kTKObjectMemberTypeInstance: The group describes instance members.
- @c kTKObjectMemberTypeProperty: The group describes properties.
Subclasses should append any desired data for the given group type. The message is only
sent if at least one member of the given type is documented for the object. After this
message one or more @c appendObjectMemberToData:fromItem:index:() messages are sent, one
for each documented member of the given group and after all members output is generated,
@c appendObjectMemberGroupHeaderToData:type:() is sent.
@param data The data to append to. This is guaranteed to be non @c mil.
@param type The type of the group that is being described.
@exception NSException Thrown if appending fails.
@see XMLBasedOutputGenerator::generateOutputForObject:
@see appendObjectMembersHeaderToData:
@see appendObjectMembersFooterToData:
@see appendObjectMemberToData:fromItem:index:
@see appendObjectMemberGroupFooterToData:type:
*/
- (void) appendObjectMemberGroupHeaderToData:(NSMutableData*) data
type:(int) type;
/** Appends member group footer data.
This message is sent from @c XMLBasedOutputGenerator::generateOutputForObject:() for each main
member documentation group. The group is specified by the @c type parameter and can be
one of the following:
- @c kTKObjectMemberTypeClass: The group describes class members.
- @c kTKObjectMemberTypeInstance: The group describes instance members.
- @c kTKObjectMemberTypeProperty: The group describes properties.
Subclasses should append any desired data for the given group type. In most cases this
is the place to close any open tags or similar. The message is only sent if the
corresponding @c appendObjectMemberGroupHeaderToData:type:() was sent.
@param data The data to append to. This is guaranteed to be non @c mil.
@param type The type of the group that is being described.
@exception NSException Thrown if appending fails.
@see XMLBasedOutputGenerator::generateOutputForObject:
@see appendObjectMembersHeaderToData:
@see appendObjectMembersFooterToData:
@see appendObjectMemberGroupHeaderToData:type:
@see appendObjectMemberToData:fromItem:index:
*/
- (void) appendObjectMemberGroupFooterToData:(NSMutableData*) data
type:(int) type;
/** Appends individual member full documentation data.
This message is sent from @c XMLBasedOutputGenerator::generateOutputForObject:() for each
documented member. Subclasses should output the full documentation for the given member.
@param data The data to append to. This is guaranteed to be non @c mil.
@param item The item that describes the member data.
@param index Zero based index of the member within the group.
@exception NSException Thrown if appending fails.
@see XMLBasedOutputGenerator::generateOutputForObject:
@see appendObjectMembersHeaderToData:
@see appendObjectMembersFooterToData:
@see appendObjectMemberGroupHeaderToData:type:
@see appendObjectMemberGroupFooterToData:type:
*/
- (void) appendObjectMemberToData:(NSMutableData*) data
fromItem:(id) item
index:(int) index;
//////////////////////////////////////////////////////////////////////////////////////////
/// @name Properties
//////////////////////////////////////////////////////////////////////////////////////////
/** Returns current object output title. */
@property(readonly) NSString* objectTitle;
/** Returns current object name. */
@property(readonly) NSString* objectName;
/** Returns current object kind. */
@property(readonly) NSString* objectKind;
/** Returns the names of the class, the current object belongs to.
At the moment this is only applicable for categories. */
@property(readonly) NSString* objectClass;
/** Returns current object cleaned XML document. */
@property(readonly) NSXMLDocument* objectMarkup;
/** Returns current object relative directory within the generated output.
This is only the directory and nothing else, in contrary to @c objectRelativePath()
which also returns the file name. */
@property(readonly) NSString* objectRelativeDir;
/** Returns current object relative path within the generated output.
This returns the directory and the object name without the extension (the extension should
be specified by each concrete @c XMLBasedOutputGenerator class). See also @c objectRelativeDir(). */
@property(readonly) NSString* objectRelativePath;
@end