Resolves tdf#142513 - Order of ZoomIn and ZoomOut at Print Preview
[LibreOffice.git] / sw / inc / ndnotxt.hxx
blobac2611966953585462f23ff0256a2a728c576101
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_SW_INC_NDNOTXT_HXX
20 #define INCLUDED_SW_INC_NDNOTXT_HXX
22 #include <memory>
23 #include "node.hxx"
25 class Size;
26 namespace tools { class PolyPolygon; }
28 // SwNoTextNode
30 class SW_DLLPUBLIC SwNoTextNode : public SwContentNode
32 friend class SwNodes;
33 friend class SwNoTextFrame;
35 std::unique_ptr<tools::PolyPolygon> m_pContour;
36 bool m_bAutomaticContour : 1; // automatic contour polygon, not manipulated
37 bool m_bContourMapModeValid : 1; // contour map mode is not the graphics's
38 // preferred map mode, but either
39 // MM100 or pixel
40 bool m_bPixelContour : 1; // contour map mode is invalid and pixel.
42 // Creates for all derivations an AttrSet with ranges for frame- and
43 // graphics-attributes (only called by SwContentNode).
44 virtual void NewAttrSet( SwAttrPool& ) override;
46 SwNoTextNode( const SwNoTextNode& ) = delete;
47 SwNoTextNode &operator=( const SwNoTextNode& ) = delete;
49 protected:
50 SwNoTextNode( const SwNodeIndex &rWhere, const SwNodeType nNdType,
51 SwGrfFormatColl *pGrColl, SwAttrSet const * pAutoAttr );
53 public:
54 virtual ~SwNoTextNode() override;
56 virtual SwContentFrame *MakeFrame( SwFrame* ) override;
58 SwGrfFormatColl *GetGrfColl() const { return const_cast<SwGrfFormatColl*>(static_cast<const SwGrfFormatColl*>(GetRegisteredIn())); }
60 virtual Size GetTwipSize() const = 0;
62 virtual bool SavePersistentData();
63 virtual bool RestorePersistentData();
65 OUString GetTitle() const;
66 void SetTitle( const OUString& rTitle );
67 OUString GetDescription() const;
68 void SetDescription( const OUString& rDescription );
70 void SetContour( const tools::PolyPolygon *pPoly,
71 bool bAutomatic = false );
72 const tools::PolyPolygon *HasContour() const;
73 bool HasContour_() const { return m_pContour!=nullptr; };
74 void GetContour( tools::PolyPolygon &rPoly ) const;
75 void CreateContour();
77 void SetAutomaticContour( bool bSet ) { m_bAutomaticContour = bSet; }
78 bool HasAutomaticContour() const { return m_bAutomaticContour; }
80 // set either a MM100 or pixel contour
81 void SetContourAPI( const tools::PolyPolygon *pPoly );
83 // get either a MM100 or pixel contour, return false if no contour is set.
84 bool GetContourAPI( tools::PolyPolygon &rPoly ) const;
86 void SetPixelContour( bool bSet ) { m_bPixelContour = bSet; }
87 bool IsPixelContour() const;
89 bool IsContourMapModeValid() const { return m_bContourMapModeValid; }
91 // Obtains the graphic with SwapIn for GrfNode via GetData for OLE.
92 Graphic GetGraphic() const;
95 // Inline methods from Node.hxx - we know TextNode only here!!
96 inline SwNoTextNode *SwNode::GetNoTextNode()
98 return SwNodeType::NoTextMask & m_nNodeType ? static_cast<SwNoTextNode*>(this) : nullptr;
100 inline const SwNoTextNode *SwNode::GetNoTextNode() const
102 return SwNodeType::NoTextMask & m_nNodeType ? static_cast<const SwNoTextNode*>(this) : nullptr;
105 #endif // INCLUDED_SW_INC_NDNOTXT_HXX
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */