forked from Mynigma/HTMLPurifier
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHTMLPurifier_HTMLModuleManager.h
More file actions
131 lines (106 loc) · 3.54 KB
/
HTMLPurifier_HTMLModuleManager.h
File metadata and controls
131 lines (106 loc) · 3.54 KB
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
//
// HTMLPurifier_HTMLModuleManager.h
// HTMLPurifier
//
// Created by Roman Priebe on 14.01.14.
#import <Foundation/Foundation.h>
@class HTMLPurifier_DoctypeRegistry, HTMLPurifier_AttrTypes, HTMLPurifier_Config, HTMLPurifier_AttrCollections, HTMLPurifier_HTMLModule, HTMLPurifier_ElementDef, HTMLPurifier_ContentSets;
@interface HTMLPurifier_HTMLModuleManager : NSObject
/**
* @type HTMLPurifier_DoctypeRegistry
*/
@property HTMLPurifier_DoctypeRegistry* doctypes;
/**
* Instance of current doctype.
* @type string
*/
@property NSObject* doctype;
/**
* @type HTMLPurifier_AttrTypes
*/
@property HTMLPurifier_AttrTypes* attrTypes;
/**
* Active instances of modules for the specified doctype are
* indexed, by name, in this array.
* @type HTMLPurifier_HTMLModule[]
*/
@property NSMutableArray* modules;
/**
* Array of recognized HTMLPurifier_HTMLModule instances,
* indexed by module's class name. This array is usually lazy loaded, but a
* user can overload a module by pre-emptively registering it.
* @type HTMLPurifier_HTMLModule[]
*/
@property NSMutableDictionary* registeredModules;
/**
* List of extra modules that were added by the user
* using addModule(). These get unconditionally merged into the current doctype, whatever
* it may be.
* @type HTMLPurifier_HTMLModule[]
*/
@property NSMutableArray* userModules;
/**
* Associative array of element name to list of modules that have
* definitions for the element; this array is dynamically filled.
* @type array
*/
@property NSMutableDictionary* elementLookup;
/**
* List of prefixes we should use for registering small names.
* @type array
*/
@property NSMutableArray* prefixes;
/**
* @type HTMLPurifier_ContentSets
*/
@property HTMLPurifier_ContentSets* contentSets;
/**
* @type HTMLPurifier_AttrCollections
*/
@property HTMLPurifier_AttrCollections* attrCollections;
/**
* If set to true, unsafe elements and attributes will be allowed.
* @type bool
*/
@property BOOL trusted;
- (NSString*)registerModule:(NSObject*)module withConfig:(HTMLPurifier_Config*)config;
- (NSString*)registerModule:(NSObject*)module withConfig:(HTMLPurifier_Config*)config overload:(BOOL)overload;
/**
* Adds a module to the current doctype by first registering it,
* and then tacking it on to the active doctype
*/
- (void)addModule:(NSObject*)module withConfig:(HTMLPurifier_Config*)config;
/**
* Adds a class prefix that registerModule() will use to resolve a
* string name to a concrete class
*/
- (void)addPrefix:(NSString*)prefix;
/**
* Performs processing on modules, after being called you may
* use getElement() and getElements()
* @param HTMLPurifier_Config $config
*/
- (void)setup:(HTMLPurifier_Config*)config;
/**
* Takes a module and adds it to the active module collection,
* registering it if necessary.
*/
- (void)processModule:(NSString*)module withConfig:(HTMLPurifier_Config*)config;
/**
* Retrieves merged element definitions.
* @return Array of HTMLPurifier_ElementDef
*/
- (NSMutableDictionary*)getElements;
/**
* Retrieves a single merged element definition
* @param string $name Name of element
* @param bool $trusted Boolean trusted overriding parameter: set to true
* if you want the full version of an element
* @return HTMLPurifier_ElementDef Merged HTMLPurifier_ElementDef
* @note You may notice that modules are getting iterated over twice (once
* in getElements() and once here). This
* is because
*/
- (HTMLPurifier_ElementDef*)getElement:(NSString*)name;
- (HTMLPurifier_ElementDef*)getElement:(NSString*)name trusted:(BOOL)trusted;
@end