9 |
9 |
10 |
10 |
11 class MarkupBase: |
11 class MarkupBase: |
12 """ |
12 """ |
13 Class implementing the base class for the markup providers. |
13 Class implementing the base class for the markup providers. |
14 |
14 |
15 Note: Derived classes need only implement those method they provide |
15 Note: Derived classes need only implement those method they provide |
16 functionality for. This base class implements do nothing variants for |
16 functionality for. This base class implements do nothing variants for |
17 all methods. |
17 all methods. |
18 """ |
18 """ |
|
19 |
19 def __init__(self): |
20 def __init__(self): |
20 """ |
21 """ |
21 Constructor |
22 Constructor |
22 """ |
23 """ |
23 pass |
24 pass |
24 |
25 |
25 def kind(self): |
26 def kind(self): |
26 """ |
27 """ |
27 Public method to get the markup kind. |
28 Public method to get the markup kind. |
28 |
29 |
29 @return markup kind all lowercased |
30 @return markup kind all lowercased |
30 @rtype str |
31 @rtype str |
31 """ |
32 """ |
32 return "none" |
33 return "none" |
33 |
34 |
34 def hasBold(self): |
35 def hasBold(self): |
35 """ |
36 """ |
36 Public method to indicate the availability of bold markup. |
37 Public method to indicate the availability of bold markup. |
37 |
38 |
38 @return flag indicating the availability of bold markup |
39 @return flag indicating the availability of bold markup |
39 @rtype bool |
40 @rtype bool |
40 """ |
41 """ |
41 return False |
42 return False |
42 |
43 |
43 def bold(self, editor): |
44 def bold(self, editor): |
44 """ |
45 """ |
45 Public method to generate bold text. |
46 Public method to generate bold text. |
46 |
47 |
47 @param editor reference to the editor to work on |
48 @param editor reference to the editor to work on |
48 @type Editor |
49 @type Editor |
49 """ |
50 """ |
50 pass |
51 pass |
51 |
52 |
52 def hasItalic(self): |
53 def hasItalic(self): |
53 """ |
54 """ |
54 Public method to indicate the availability of italic markup. |
55 Public method to indicate the availability of italic markup. |
55 |
56 |
56 @return flag indicating the availability of italic markup |
57 @return flag indicating the availability of italic markup |
57 @rtype bool |
58 @rtype bool |
58 """ |
59 """ |
59 return False |
60 return False |
60 |
61 |
61 def italic(self, editor): |
62 def italic(self, editor): |
62 """ |
63 """ |
63 Public method to generate italic text. |
64 Public method to generate italic text. |
64 |
65 |
65 @param editor reference to the editor to work on |
66 @param editor reference to the editor to work on |
66 @type Editor |
67 @type Editor |
67 """ |
68 """ |
68 pass |
69 pass |
69 |
70 |
70 def hasStrikethrough(self): |
71 def hasStrikethrough(self): |
71 """ |
72 """ |
72 Public method to indicate the availability of strikethrough markup. |
73 Public method to indicate the availability of strikethrough markup. |
73 |
74 |
74 @return flag indicating the availability of strikethrough markup |
75 @return flag indicating the availability of strikethrough markup |
75 @rtype bool |
76 @rtype bool |
76 """ |
77 """ |
77 return False |
78 return False |
78 |
79 |
79 def strikethrough(self, editor): |
80 def strikethrough(self, editor): |
80 """ |
81 """ |
81 Public method to generate strikethrough text. |
82 Public method to generate strikethrough text. |
82 |
83 |
83 @param editor reference to the editor to work on |
84 @param editor reference to the editor to work on |
84 @type Editor |
85 @type Editor |
85 """ |
86 """ |
86 pass |
87 pass |
87 |
88 |
88 def headerLevels(self): |
89 def headerLevels(self): |
89 """ |
90 """ |
90 Public method to determine the available header levels. |
91 Public method to determine the available header levels. |
91 |
92 |
92 @return supported header levels |
93 @return supported header levels |
93 @rtype int |
94 @rtype int |
94 """ |
95 """ |
95 return 0 |
96 return 0 |
96 |
97 |
97 def header(self, editor, level): |
98 def header(self, editor, level): |
98 """ |
99 """ |
99 Public method to generate a header. |
100 Public method to generate a header. |
100 |
101 |
101 @param editor reference to the editor to work on |
102 @param editor reference to the editor to work on |
102 @type Editor |
103 @type Editor |
103 @param level header level |
104 @param level header level |
104 @type int |
105 @type int |
105 """ |
106 """ |
106 pass |
107 pass |
107 |
108 |
108 def hasCode(self): |
109 def hasCode(self): |
109 """ |
110 """ |
110 Public method to indicate the availability of inline code markup. |
111 Public method to indicate the availability of inline code markup. |
111 |
112 |
112 @return flag indicating the availability of inline code markup |
113 @return flag indicating the availability of inline code markup |
113 @rtype bool |
114 @rtype bool |
114 """ |
115 """ |
115 return False |
116 return False |
116 |
117 |
117 def code(self, editor): |
118 def code(self, editor): |
118 """ |
119 """ |
119 Public method to generate inline code text. |
120 Public method to generate inline code text. |
120 |
121 |
121 @param editor reference to the editor to work on |
122 @param editor reference to the editor to work on |
122 @type Editor |
123 @type Editor |
123 """ |
124 """ |
124 pass |
125 pass |
125 |
126 |
126 def hasCodeBlock(self): |
127 def hasCodeBlock(self): |
127 """ |
128 """ |
128 Public method to indicate the availability of code block markup. |
129 Public method to indicate the availability of code block markup. |
129 |
130 |
130 @return flag indicating the availability of code block markup |
131 @return flag indicating the availability of code block markup |
131 @rtype bool |
132 @rtype bool |
132 """ |
133 """ |
133 return False |
134 return False |
134 |
135 |
135 def codeBlock(self, editor): |
136 def codeBlock(self, editor): |
136 """ |
137 """ |
137 Public method to generate code block text. |
138 Public method to generate code block text. |
138 |
139 |
139 @param editor reference to the editor to work on |
140 @param editor reference to the editor to work on |
140 @type Editor |
141 @type Editor |
141 """ |
142 """ |
142 pass |
143 pass |
143 |
144 |
144 def hasHyperlink(self): |
145 def hasHyperlink(self): |
145 """ |
146 """ |
146 Public method to indicate the availability of hyperlink markup. |
147 Public method to indicate the availability of hyperlink markup. |
147 |
148 |
148 @return flag indicating the availability of hyperlink markup |
149 @return flag indicating the availability of hyperlink markup |
149 @rtype bool |
150 @rtype bool |
150 """ |
151 """ |
151 return False |
152 return False |
152 |
153 |
153 def hyperlink(self, editor): |
154 def hyperlink(self, editor): |
154 """ |
155 """ |
155 Public method to generate hyperlink text. |
156 Public method to generate hyperlink text. |
156 |
157 |
157 @param editor reference to the editor to work on |
158 @param editor reference to the editor to work on |
158 @type Editor |
159 @type Editor |
159 """ |
160 """ |
160 pass |
161 pass |
161 |
162 |
162 def hasLine(self): |
163 def hasLine(self): |
163 """ |
164 """ |
164 Public method to indicate the availability of a horizontal line markup. |
165 Public method to indicate the availability of a horizontal line markup. |
165 |
166 |
166 @return flag indicating the availability of a horizontal line markup |
167 @return flag indicating the availability of a horizontal line markup |
167 @rtype bool |
168 @rtype bool |
168 """ |
169 """ |
169 return False |
170 return False |
170 |
171 |
171 def line(self, editor): |
172 def line(self, editor): |
172 """ |
173 """ |
173 Public method to generate a horizontal line text. |
174 Public method to generate a horizontal line text. |
174 |
175 |
175 @param editor reference to the editor to work on |
176 @param editor reference to the editor to work on |
176 @type Editor |
177 @type Editor |
177 """ |
178 """ |
178 pass |
179 pass |
179 |
180 |
180 def hasQuote(self): |
181 def hasQuote(self): |
181 """ |
182 """ |
182 Public method to indicate the availability of block quote markup. |
183 Public method to indicate the availability of block quote markup. |
183 |
184 |
184 @return flag indicating the availability of block quote markup |
185 @return flag indicating the availability of block quote markup |
185 @rtype bool |
186 @rtype bool |
186 """ |
187 """ |
187 return False |
188 return False |
188 |
189 |
189 def quote(self, editor): |
190 def quote(self, editor): |
190 """ |
191 """ |
191 Public method to generate block quote text. |
192 Public method to generate block quote text. |
192 |
193 |
193 @param editor reference to the editor to work on |
194 @param editor reference to the editor to work on |
194 @type Editor |
195 @type Editor |
195 """ |
196 """ |
196 pass |
197 pass |
197 |
198 |
198 def hasImage(self): |
199 def hasImage(self): |
199 """ |
200 """ |
200 Public method to indicate the availability of image markup. |
201 Public method to indicate the availability of image markup. |
201 |
202 |
202 @return flag indicating the availability of image markup |
203 @return flag indicating the availability of image markup |
203 @rtype bool |
204 @rtype bool |
204 """ |
205 """ |
205 return False |
206 return False |
206 |
207 |
207 def image(self, editor): |
208 def image(self, editor): |
208 """ |
209 """ |
209 Public method to generate image text. |
210 Public method to generate image text. |
210 |
211 |
211 @param editor reference to the editor to work on |
212 @param editor reference to the editor to work on |
212 @type Editor |
213 @type Editor |
213 """ |
214 """ |
214 pass |
215 pass |
215 |
216 |
216 def hasBulletedList(self): |
217 def hasBulletedList(self): |
217 """ |
218 """ |
218 Public method to indicate the availability of bulleted list markup. |
219 Public method to indicate the availability of bulleted list markup. |
219 |
220 |
220 @return flag indicating the availability of bulleted list markup |
221 @return flag indicating the availability of bulleted list markup |
221 @rtype bool |
222 @rtype bool |
222 """ |
223 """ |
223 return False |
224 return False |
224 |
225 |
225 def bulletedList(self, editor): |
226 def bulletedList(self, editor): |
226 """ |
227 """ |
227 Public method to generate bulleted list text. |
228 Public method to generate bulleted list text. |
228 |
229 |
229 @param editor reference to the editor to work on |
230 @param editor reference to the editor to work on |
230 @type Editor |
231 @type Editor |
231 """ |
232 """ |
232 pass |
233 pass |
233 |
234 |
234 def hasNumberedList(self): |
235 def hasNumberedList(self): |
235 """ |
236 """ |
236 Public method to indicate the availability of numbered list markup. |
237 Public method to indicate the availability of numbered list markup. |
237 |
238 |
238 @return flag indicating the availability of numbered list markup |
239 @return flag indicating the availability of numbered list markup |
239 @rtype bool |
240 @rtype bool |
240 """ |
241 """ |
241 return False |
242 return False |
242 |
243 |
243 def numberedList(self, editor): |
244 def numberedList(self, editor): |
244 """ |
245 """ |
245 Public method to generate numbered list text. |
246 Public method to generate numbered list text. |
246 |
247 |
247 @param editor reference to the editor to work on |
248 @param editor reference to the editor to work on |
248 @type Editor |
249 @type Editor |
249 """ |
250 """ |
250 pass |
251 pass |