-
Notifications
You must be signed in to change notification settings - Fork 2
/
DocHeader.h
130 lines (100 loc) · 4.51 KB
/
DocHeader.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
/**
<abstract>Documentation page header or subheader.</abstract>
Copyright (C) 2008 Nicolas Roard
Author: Nicolas Roard
Author: Quentin Mathe <quentin.mathe@gmail.com>
Date: June 2008
License: Modified BSD (see COPYING)
*/
#import <Foundation/Foundation.h>
#import <EtoileFoundation/EtoileFoundation.h>
#import "DocElement.h"
#import "GSDocParser.h"
@class DocHTMLElement;
/** @group Doc Element Tree */
@interface DocHeader : DocElement <GSDocParserDelegate>
{
/* Basic Infos */
NSString *title;
NSString *abstract;
NSMutableArray *authors;
NSString *overview;
NSString *fileOverview;
/* Main Symbol (optional) presented on the page */
NSString *className;
NSString *protocolName;
NSString *categoryName;
NSString *declaredIn;
BOOL isInformalProtocol;
/* Main Symbol Inheritance (optional) */
NSString *superclassName;
NSMutableArray *adoptedProtocolNames;
/* Parsed Markup */
NSString *group;
}
/** @taskunit Basic Infos */
/** Adds the given author name to the author list. */
- (void) addAuthor: (NSString *)aName;
/** The page title.
See also -[DocElement name] which is a distinct property. */
@property (strong, nonatomic) NSString *title;
/** A brief summary limited to single line. */
@property (strong, nonatomic) NSString *abstract;
/** The main documentation.
In most cases, the overview describes a class, a category or a protocol that
the header introduces. And as such corresponds to the class, category or
protocol description comment in the code source.
See also -setFileOverview:. */
@property (strong, nonatomic) NSString *overview;
/** An additional documentation appended to -overview when the final output is
generated.
You should use -setFileOverview: rather than -setOverview:, when the overview
is stored outside the code. e.g. in a Markdown file. */
@property (strong, nonatomic) NSString *fileOverview;
/** The main authors who contributed to the code or content the header is related to. */
@property (readonly, nonatomic) NSArray *authors;
/** Returns the group name parsed from <em>@group</em> markup.
A header or the symbol it represents can belong to one or several groups (only one for now). */
@property (strong, nonatomic) NSString *group;
/** @taskunit Documented Class, Protocol or Category */
/** Adds a protocol name to -adoptedProtocolNames. */
- (void) addAdoptedProtocolName: (NSString *)aName;
/** The class presented on the page the header belongs to. */
@property (strong, nonatomic) NSString *className;
/** The superclass of the class presented on the page the header belongs to.
The class refers to the symbol the header introduces.<br />
See -className. */
@property (strong, nonatomic) NSString *superclassName;
/** The category presented on the page the header belongs to. */
@property (strong, nonatomic) NSString *categoryName;
/** The protocol presented on the page the header belongs to. */
@property (strong, nonatomic) NSString *protocolName;
/** The protocols to which the class, protocol or category conforms to.
The class, protocol or category refers to the symbol the header introduces.<br />
See -className, -protocolName and -categoryName. */
@property (readonly, nonatomic) NSArray *adoptedProtocolNames;
/** The name of the file in which the documented symbol is declared.
For DocHeader class, that would be DocHeader.h. */
@property (strong, nonatomic) NSString *declaredIn;
@property (assign, nonatomic) BOOL isInformalProtocol;
/** @taskunit HTML Generation */
/** Returns the overview rendered as a HTML element tree.
Will return +[DocHTMLElement blankElement] if no overview is available. */
- (DocHTMLElement *) HTMLOverviewRepresentation;
/** Returns the entire header rendered as a HTML element tree.
The returned representation includes -HTMLOverviewRepresentation.
The method creates a title block and hands it to
-HTMLRepresentationWithTitleBlockElement: in order to obtain the HTML
representation that should be returned. */
- (DocHTMLElement *) HTMLRepresentation;
/** Returns the entire header rendered as a HTML element tree with a custom
title element at the beginning.
The returned representation includes -HTMLOverviewRepresentation. */
- (DocHTMLElement *) HTMLRepresentationWithTitleBlockElement: (DocHTMLElement *)hTitleBlock;
/** Returns a short header, limited to its overview, rendered as a HTML element
tree.
The returned representation includes -HTMLOverviewRepresentation.
See DocTOCPage which uses this custom representation. e.g. to present all
the classes, categories and protocol on the API overview page. */
- (DocHTMLElement *) HTMLTOCRepresentation;
@end