LibreOffice Module sw (master)  1
ModelTraverser.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice 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 
11 #pragma once
12 
13 #include <doc.hxx>
14 
15 class SwNode;
16 class SdrObject;
17 
18 namespace sw
19 {
21 {
22 public:
23  virtual ~ModelTraverseHandler() {}
24 
25  virtual void handleNode(SwNode* pNode) = 0;
26  virtual void handleSdrObject(SdrObject* pObject) = 0;
27 };
28 
30 {
31 private:
32  std::vector<std::shared_ptr<ModelTraverseHandler>> mpNodeHandler;
34 
35 public:
37  : m_pDoc(pDoc)
38  {
39  }
40 
41  void traverse();
42 
43  void addNodeHandler(std::shared_ptr<ModelTraverseHandler> pHandler)
44  {
45  mpNodeHandler.push_back(pHandler);
46  }
47 };
48 
49 } // end sw namespace
50 
51 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: doc.hxx:188
Dialog to specify the properties of date form field.
void addNodeHandler(std::shared_ptr< ModelTraverseHandler > pHandler)
ModelTraverser(SwDoc *pDoc)
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
std::vector< std::shared_ptr< ModelTraverseHandler > > mpNodeHandler
Base class of the Writer document model elements.
Definition: node.hxx:80