1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3  * This file is part of the libqxp project.
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 
10 #ifndef QXPCOLLECTOR_H_INCLUDED
11 #define QXPCOLLECTOR_H_INCLUDED
12 
13 #include "libqxp_utils.h"
14 
15 namespace libqxp
16 {
17 
18 struct Box;
19 struct Group;
20 struct Line;
21 struct Page;
22 struct QXPDocumentProperties;
23 struct Text;
24 struct TextBox;
25 struct TextPath;
26 
27 class QXPCollector
28 {
29   // disable copying
30   QXPCollector(const QXPCollector &other) = delete;
31   QXPCollector &operator=(const QXPCollector &other) = delete;
32 
33 public:
34   QXPCollector() = default;
35   virtual ~QXPCollector() = default;
36 
startDocument()37   virtual void startDocument() { }
endDocument()38   virtual void endDocument() { }
39 
startPage(const Page &)40   virtual void startPage(const Page &) { }
endPage()41   virtual void endPage() { }
42 
collectDocumentProperties(const QXPDocumentProperties &)43   virtual void collectDocumentProperties(const QXPDocumentProperties &) { }
44 
collectLine(const std::shared_ptr<Line> &)45   virtual void collectLine(const std::shared_ptr<Line> &) { }
collectBox(const std::shared_ptr<Box> &)46   virtual void collectBox(const std::shared_ptr<Box> &) { }
collectTextBox(const std::shared_ptr<TextBox> &)47   virtual void collectTextBox(const std::shared_ptr<TextBox> &) { }
collectTextPath(const std::shared_ptr<TextPath> &)48   virtual void collectTextPath(const std::shared_ptr<TextPath> &) { }
collectGroup(const std::shared_ptr<Group> &)49   virtual void collectGroup(const std::shared_ptr<Group> &) { }
50 
collectText(const std::shared_ptr<Text> &,const unsigned)51   virtual void collectText(const std::shared_ptr<Text> &, const unsigned) { }
52 };
53 
54 class QXPDummyCollector : public QXPCollector
55 {
56 public:
57   QXPDummyCollector() = default;
58 };
59 
60 }
61 
62 #endif // QXPCOLLECTOR_H_INCLUDED
63 
64 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
65