Coverage Report

Created: 2026-04-29 07:28

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/librevenge/inc/librevenge/RVNGPresentationInterface.h
Line
Count
Source
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2
/* librevenge
3
 * Version: MPL 2.0 / LGPLv2.1+
4
 *
5
 * This Source Code Form is subject to the terms of the Mozilla Public
6
 * License, v. 2.0. If a copy of the MPL was not distributed with this
7
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
 *
9
 * Alternatively, the contents of this file may be used under the terms
10
 * of the GNU Lesser General Public License Version 2.1 or later
11
 * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
12
 * applicable instead of those above.
13
 */
14
15
#ifndef RVNGPRESENTATIONINTERFACE_H
16
#define RVNGPRESENTATIONINTERFACE_H
17
18
#include "RVNGPropertyList.h"
19
#include "RVNGPropertyListVector.h"
20
21
namespace librevenge
22
{
23
24
/** Interface for import of presentations.
25
  */
26
class RVNGPresentationInterface
27
{
28
public:
29
59.8k
  virtual ~RVNGPresentationInterface() {}
30
31
  // none of the other callback functions will be called before this function is called
32
  virtual void startDocument(const RVNGPropertyList &propList) = 0;
33
34
  // none of the other callback functions will be called after this function is called
35
  virtual void endDocument() = 0;
36
37
  /**
38
  Called when all document metadata should be set. This is always the first callback made.
39
  \param propList Property list for the metadata. May contain:
40
  \li \c dc:creator
41
  \li \c dc:language The document's keywords
42
  \li \c dc:publisher The document's publisher
43
  \li \c dc:source
44
  \li \c dc:subject The document's subject
45
  \li \c dc:type The document's type
46
  \li \c dcterms:available Date when the document was completed
47
  \li \c dcterms:issued: Date of the version of the document
48
  \li \c librevenge:abstract Abstract of the document's contents
49
  \li \c librevenge:account Account
50
  \li \c librevenge:address Address
51
  \li \c librevenge:attachments
52
  \li \c librevenge:authorization
53
  \li \c librevenge:bill-to
54
  \li \c librevenge:blind-copy
55
  \li \c librevenge:carbon-copy
56
  \li \c librevenge:checked-by
57
  \li \c librevenge:client
58
  \li \c librevenge:comments
59
  \li \c librevenge:department
60
  \li \c librevenge:descriptive-name The descriptive name for the document
61
  \li \c librevenge:descriptive-type The descriptive type for the document
62
  \li \c librevenge:destination
63
  \li \c librevenge:disposition
64
  \li \c librevenge:division
65
  \li \c librevenge:document-number
66
  \li \c librevenge:editor
67
  \li \c librevenge:forward-to
68
  \li \c librevenge:group
69
  \li \c librevenge:mail-stop
70
  \li \c librevenge:matter
71
  \li \c librevenge:office
72
  \li \c librevenge:owner
73
  \li \c librevenge:project
74
  \li \c librevenge:purpose
75
  \li \c librevenge:received-from
76
  \li \c librevenge:recorded-by
77
  \li \c librevenge:recorded-date Date when the document was recorded
78
  \li \c librevenge:reference
79
  \li \c librevenge:revision-notes
80
  \li \c librevenge:revision-number
81
  \li \c librevenge:section
82
  \li \c librevenge:security
83
  \li \c librevenge:status
84
  \li \c librevenge:telephone-number
85
  \li \c librevenge:version-notes
86
  \li \c librevenge:version-number
87
  \li \c meta:creation-date Document creation date
88
  \li \c meta:initial-creator The document's author
89
  \li \c meta:keyword The document's keywords
90
  \li \c
91
  */
92
  virtual void setDocumentMetaData(const RVNGPropertyList &propList) = 0;
93
94
  /**
95
  Called when an embedded font should be defined
96
  \param propList A set of properties that specify the font. May contain:
97
  \li \c librevenge:name The name of the font
98
  \li \c librevenge:mime-type The mimetype of the font
99
  \li \c office:binary-data The font data
100
  \li \c librevenge:replacement-objects A property list vector containing alternative formats of the font. Every element is a property list containing:
101
      -# \c librevenge:mime-type The mimetype of the replacement object
102
      -# \c office:binary-data The replacement object data
103
  */
104
  virtual void defineEmbeddedFont(const RVNGPropertyList &propList) = 0;
105
106
  virtual void startSlide(const RVNGPropertyList &propList) = 0;
107
108
  virtual void endSlide() = 0;
109
110
  virtual void startMasterSlide(const RVNGPropertyList &propList) = 0;
111
112
  virtual void endMasterSlide() = 0;
113
114
  virtual void setStyle(const RVNGPropertyList &propList) = 0;
115
116
  /**
117
  Called when a transition should be added to the current slide.
118
  \param propList Property list for the metadata. May contain:
119
  \li \c smil:type Type of the transition.
120
  \li \c smil:subtype Subtype of the transition.
121
  \li \c smil:dur Duration of the transition.
122
  \li \c smil:startProgress The amount of progress through the transition at which to begin execution. Value must be in the range [0.0, 1.0].
123
  \li \c smil:endProgress The amount of progress through the transition at which to end execution. Value must be in the range [0.0, 1.0].
124
    */
125
  virtual void setSlideTransition(const RVNGPropertyList &propList) = 0;
126
127
  virtual void startLayer(const RVNGPropertyList &propList) = 0;
128
129
  virtual void endLayer() = 0;
130
131
  virtual void startEmbeddedGraphics(const RVNGPropertyList &propList) = 0;
132
133
  virtual void endEmbeddedGraphics() = 0;
134
135
  virtual void openGroup(const RVNGPropertyList &propList) = 0;
136
137
  virtual void closeGroup() = 0;
138
139
  // Different primitive shapes
140
  virtual void drawRectangle(const RVNGPropertyList &propList) = 0;
141
142
  virtual void drawEllipse(const RVNGPropertyList &propList) = 0;
143
144
  virtual void drawPolygon(const RVNGPropertyList &propList) = 0;
145
146
  virtual void drawPolyline(const RVNGPropertyList &propList) = 0;
147
148
  virtual void drawPath(const RVNGPropertyList &propList) = 0;
149
150
  /**
151
  Called when a binary/raster object should be inserted
152
  \param propList Defines a set of properties for the object. May contain:
153
  \li \c librevenge:mime-type The mimetype of the object
154
  \li \c office:binary-data The object data
155
  \li \c librevenge:replacement-objects A property list vector containing alternative representations of the content. Every element is a property list containing:
156
      -# \c librevenge:mime-type The mimetype of the replacement object
157
      -# \c office:binary-data The replacement object data
158
  \li \c librevenge:replacement-text A string containing a text representation of the content.
159
160
  \note to insert a MathMl file, set the mimetype value to "application/mathml-presentation+xml"
161
     or "application/mathml+xml".
162
  */
163
  virtual void drawGraphicObject(const RVNGPropertyList &propList) = 0;
164
165
  /** Draw a connector.
166
    The connector will be typically between two shapes, but free-standing connectors are allowed too.
167
    \param propList Defines a set of properties for the object. May contain:
168
    \li \c draw:end-shape The \c ID of the shape attached at the end. Should not be present if the connector's end is not attached to any object.
169
    \li \c draw:start-shape The \c ID of the shape attached at the beginning. Should not be present if the connector's start is not attached to any object.
170
    \li \c svg:d The connector's geometric path. This is optional; if missing, the consumer is free to render it any way it likes.
171
    \li \c svg:x1 The \c X coordinate of the start point.
172
    \li \c svg:y1 The \c Y coordinate of the start point.
173
    \li \c svg:x2 The \c X coordinate of the end point.
174
    \li \c svg:y2 The \c Y coordinate of the end point.
175
    */
176
  virtual void drawConnector(const RVNGPropertyList &propList) = 0;
177
178
  /** Start a text object.
179
    */
180
  virtual void startTextObject(const RVNGPropertyList &propList) = 0;
181
182
  /** End a text object.
183
    */
184
  virtual void endTextObject() = 0;
185
186
  /**
187
  Called when a TAB character should be inserted
188
  */
189
  virtual void insertTab() = 0;
190
191
  /**
192
  Called when an explicit space should be inserted
193
  */
194
  virtual void insertSpace() = 0;
195
196
  /**
197
  Called when a string of text should be inserted
198
  \param text A textbuffer encoded as a UTF8 string
199
  */
200
  virtual void insertText(const RVNGString &text) = 0;
201
202
  /**
203
  Called when a line break should be inserted
204
  */
205
  virtual void insertLineBreak() = 0;
206
207
  /**
208
  Called when a field should be inserted. Field types may include:
209
  - \c librevenge:field-type field types may include:
210
     -# \c text:page-number Current page number
211
     -# \c text:page-count Total # of pages in document
212
  - \c style:num-format Type of page number (for page number)
213
  */
214
  virtual void insertField(const RVNGPropertyList &propList) = 0;
215
216
  /**
217
  Called when a new ordered list level should be opened
218
  \param propList Defines a set of properties for the list. May contain:
219
  \li \c librevenge:list-id A unique integer identifier for the list
220
  \li \c librevenge:level The level of the list in the hierarchy
221
  \li \c style:num-format Type of list
222
  \li \c style:num-prefix Text that comes before the number in the list
223
  \li \c style:num-suffix Text that comes after the number in the list
224
  \li \c text:start-value The starting number of the list
225
  \li \c text:min-label-width The distance between the list label and the actual text, stored in inches
226
  \li \c text:space-before The indentation level of the lists, stored in inches
227
  */
228
  virtual void openOrderedListLevel(const RVNGPropertyList &propList) = 0;
229
230
  /**
231
  Called when a new unordered list level should be opened
232
  \param propList Defines a set of properties for the list level. May contain:
233
  \li \c librevenge:list-id A unique integer identifier for the list
234
  \li \c librevenge:level The level of the list in the hierarchy
235
  \li \c text:bullet-char The string that should be used as a bullet
236
  \li \c text:min-label-width The distance between the bullet and the actual text, stored in inches
237
  \li \c text:space-before The indentation level of the lists, stored in inches
238
  */
239
  virtual void openUnorderedListLevel(const RVNGPropertyList &propList) = 0;
240
241
  /**
242
  Called when an unordered list level should be closed
243
  */
244
  virtual void closeOrderedListLevel() = 0;
245
246
  /**
247
  Called when an ununordered list level should be closed
248
  */
249
  virtual void closeUnorderedListLevel() = 0;
250
251
  /**
252
  Called when a list element should be opened
253
  \param propList Property list for the paragraph. May contain:
254
  \li \c fo:text-align The justification of this paragraph (left, center, end, full, or justify)
255
  \li \c fo:margin-left The left indentation of this paragraph, in inches
256
  \li \c fo:margin-right The right indentation of this paragraph, in inches
257
  \li \c fo:margin-top The amount of extra spacing to be placed before the paragraph, in inches
258
  \li \c fo:margin-bottom The amount of extra spacing to be placed after the paragraph, in inches
259
  \li \c fo:text-indent The indentation of first line, in inches (difference relative to margin-left)
260
  \li \c fo:line-height The amount of spacing between lines, in number of lines (1.0 is single spacing)
261
  \li \c fo:break-before Whether this paragraph should be placed in a new column or page (the value is set to column or page if so)
262
  \li \c librevenge:tab-stops List of tabstop definitions for the paragraph. If the list is empty, default tabstop definition should be used. Each tab stop may contain:
263
      -# \c style:type Type of tab (left, right, center, or char)
264
      -# \c style:char Alingnment character for char aligned tabs
265
      -# \c style:leader-text The leader character
266
      -# \c style:position Position of the tab
267
  */
268
  virtual void openListElement(const RVNGPropertyList &propList) = 0;
269
270
  /**
271
  Called when a list element should be closed
272
  */
273
  virtual void closeListElement() = 0;
274
275
  virtual void defineParagraphStyle(const RVNGPropertyList &propList) = 0;
276
277
  /**
278
  Called when a new paragraph is opened. This (or openListElement) will always be called before any text or span is placed into the document.
279
  \param propList Property list for the paragraph. May contain:
280
  \paragraphproperties
281
  \li \c librevenge:tab-stops List of tabstop definitions for the paragraph. If the list is empty, default tabstop definition should be used. Each tab stop may contain:
282
      -# \c style:type Type of tab (left, right, center, or char)
283
      -# \c style:char Alingnment character for char aligned tabs
284
      -# \c style:leader-text The leader character
285
      -# \c style:position Position of the tab
286
  */
287
  virtual void openParagraph(const RVNGPropertyList &propList) = 0;
288
289
  /**
290
  Called when a paragraph is closed.
291
  */
292
  virtual void closeParagraph() = 0;
293
294
  virtual void defineCharacterStyle(const RVNGPropertyList &propList) = 0;
295
296
  /**
297
  Called when a text span is opened
298
  \param propList Property list for the span. May contain:
299
  \textproperties
300
  */
301
  virtual void openSpan(const RVNGPropertyList &propList) = 0;
302
303
  /**
304
  Called when a text span is closed
305
  */
306
  virtual void closeSpan() = 0;
307
308
  /**
309
  Called when a link should be opened
310
  \param propList Defines a set of properties for the link. May contain:
311
  \li \c xlink:type .
312
  \li \c xlink:href .
313
  */
314
  virtual void openLink(const RVNGPropertyList &propList) = 0;
315
316
  /**
317
  Called when the current link is closed
318
  */
319
  virtual void closeLink() = 0;
320
321
  /**
322
  Called when a table should be opened
323
  \param propList Defines a set of properties for the table. May contain:
324
  \li \c table:align The alignment (left, right, center, or margins)
325
  \li \c fo:margin-left The left indentation of the table, in inches
326
  \li \c fo:margin-right The right indentation of the table, in inches
327
  \li \c style:width Total width of the table, in inches
328
  \li \c fo:break-before Whether this table should be placed in a new column or page (the value is set to column or page if so)
329
  \li \c librevenge:table-columns Column definitions for the table. May contain
330
      -# \c style:column-width Width of a column, in inches
331
  */
332
  virtual void startTableObject(const RVNGPropertyList &propList) = 0;
333
  /**
334
  Called when a new table row is opened
335
  \param propList Defines a set of properties for the table row. May contain:
336
  \li \c style:row-height The row's height, in inches
337
  \li \c style:min-row-height The row's minimum height, in inches
338
  \li \c librevenge:is-header-row This row contains headings of columns and should repeat at every page (for tables that span several pages)
339
  */
340
  virtual void openTableRow(const RVNGPropertyList &propList) = 0;
341
  /**
342
  Called when the current table row is closed
343
  */
344
  virtual void closeTableRow() = 0;
345
  /**
346
  Called when a new table cell is opened
347
  \param propList Property list for the table cell. May contain:
348
  \li \c librevenge:column Number of the column in which the cell is positioned
349
  \li \c librevenge:row Number of the row in which the cell is positioned
350
  \li \c table:number-columns-spanned Number of columns that the cell spans
351
  \li \c table:number-rows-spanned Number of rows that the cell spans
352
  \li \c fo:border-left Properties of the left border of the cell
353
  \li \c fo:border-right Properties of the right border of the cell
354
  \li \c fo:border-top Properties of the top border of the cell
355
  \li \c fo:border-bottom Properties of the bottom border of the cell
356
  \li \c fo:background-color Color of the cell (encoded in hex: \#RRGGBB)
357
  \li \c style:vertical-align Vertical alignment of the content in the cell (top, middle, or bottom)
358
  */
359
  virtual void openTableCell(const RVNGPropertyList &propList) = 0;
360
  /**
361
  Called when the current table cell is closed
362
  */
363
  virtual void closeTableCell() = 0;
364
  /**
365
  Called when a covered (spanned by another cell in the table) table cell is opened
366
  \param propList Property list for the table cell. May contain:
367
  \li \c librevenge:column Number of the column in which the cell is positioned
368
  \li \c librevenge:row Number of the row in which the cell is positioned
369
  */
370
  virtual void insertCoveredTableCell(const RVNGPropertyList &propList) = 0;
371
  /**
372
  Called when the current table is closed
373
  */
374
  virtual void endTableObject() = 0;
375
376
  /** Start a comment.
377
    */
378
  virtual void startComment(const RVNGPropertyList &propList) = 0;
379
380
  /** End a comment.
381
    */
382
  virtual void endComment() = 0;
383
384
  /** Start slide notes.
385
    */
386
  virtual void startNotes(const RVNGPropertyList &propList) = 0;
387
388
  /** End slide notes.
389
    */
390
  virtual void endNotes() = 0;
391
392
  // Charts
393
394
  virtual void defineChartStyle(const RVNGPropertyList &propList) = 0;
395
396
  /**
397
  Called when a chart should be opened
398
  \param propList Property list for the sheet. May contain:
399
  \li \c librevenge:name Determines the sheet name
400
  */
401
  virtual void openChart(const RVNGPropertyList &propList) = 0;
402
  /**
403
  Called when a chart should be closed.
404
  */
405
  virtual void closeChart() = 0;
406
407
  /**
408
  Called when a chart text zone:label/legend/title/subtitle/footer should be opened.
409
  */
410
  virtual void openChartTextObject(const RVNGPropertyList &propList) = 0;
411
  /**
412
  Called when a chart text zone:legend/title/subtitle/footer should be closed.
413
  */
414
  virtual void closeChartTextObject() = 0;
415
416
  /**
417
  Called when a chart plot area should be opened.
418
  */
419
  virtual void openChartPlotArea(const RVNGPropertyList &propList) = 0;
420
  /**
421
  Called when a chart plot arre should be closed.
422
  */
423
  virtual void closeChartPlotArea() = 0;
424
  /**
425
   Called when a axis should be add in a plot area
426
   */
427
  virtual void insertChartAxis(const RVNGPropertyList &propList) = 0;
428
  /**
429
   Called when a serie should be opened (in a plot area)
430
   */
431
  virtual void openChartSeries(const librevenge::RVNGPropertyList &propList) = 0;
432
  /**
433
   Called when a serie should be closed (in a plot area)
434
   */
435
  virtual void closeChartSeries() = 0;
436
437
  // Animations
438
439
  /**
440
    Called when a set of animations should be applied one after another.
441
    */
442
  virtual void openAnimationSequence(const RVNGPropertyList &propList) = 0;
443
  virtual void closeAnimationSequence() = 0;
444
445
  /**
446
    Called when a set of animations should be applied in parallel.
447
    */
448
  virtual void openAnimationGroup(const RVNGPropertyList &propList) = 0;
449
  virtual void closeAnimationGroup() = 0;
450
451
  virtual void openAnimationIteration(const RVNGPropertyList &propList) = 0;
452
  virtual void closeAnimationIteration() = 0;
453
454
  /**
455
    Insert an animation that moves the target object along a specified path.
456
    */
457
  virtual void insertMotionAnimation(const RVNGPropertyList &propList) = 0;
458
  /**
459
    Insert an animation that changes color of the target object.
460
    */
461
  virtual void insertColorAnimation(const RVNGPropertyList &propList) = 0;
462
  /**
463
    Insert a generic animation.
464
    */
465
  virtual void insertAnimation(const RVNGPropertyList &propList) = 0;
466
  /**
467
    Set one-time animation effect on the target object.
468
    */
469
  virtual void insertEffect(const RVNGPropertyList &propList) = 0;
470
};
471
472
}
473
474
#endif // RVNGPRESENTATIONINTERFACE_H
475
476
/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */