Line data Source code
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 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 : #ifndef _NDNOTXT_HXX
20 : #define _NDNOTXT_HXX
21 :
22 : #include "node.hxx"
23 :
24 : class PolyPolygon;
25 :
26 : // SwNoTxtNode
27 :
28 : class SW_DLLPUBLIC SwNoTxtNode : public SwCntntNode
29 : {
30 : friend class SwNodes;
31 : friend class SwNoTxtFrm;
32 :
33 : PolyPolygon *pContour;
34 : sal_Bool bAutomaticContour : 1; // automatic contour polygon, not manipulated
35 : sal_Bool bContourMapModeValid : 1; // contour map mode is not the graphics's
36 : // prefered map mode, but either
37 : // MM100 or or pixel
38 : sal_Bool bPixelContour : 1; // contour map mode is invalid and pixel.
39 :
40 : // Creates for all derivations an AttrSet with ranges for frame- and
41 : // graphics-attributes (only called by SwCntntNode).
42 : virtual void NewAttrSet( SwAttrPool& );
43 :
44 : SwNoTxtNode( const SwNoTxtNode& ); // Not allowed.
45 : SwNoTxtNode &operator=( const SwNoTxtNode& ); // Not allowed.
46 :
47 : protected:
48 : SwNoTxtNode( const SwNodeIndex &rWhere, const sal_uInt8 nNdType,
49 : SwGrfFmtColl *pGrColl, SwAttrSet* pAutoAttr = 0 );
50 :
51 : public:
52 : ~SwNoTxtNode();
53 :
54 : virtual SwCntntFrm *MakeFrm( SwFrm* );
55 :
56 2 : inline SwGrfFmtColl *GetGrfColl() const { return (SwGrfFmtColl*)GetRegisteredIn(); }
57 :
58 : virtual Size GetTwipSize() const = 0;
59 :
60 : virtual sal_Bool SavePersistentData();
61 : virtual sal_Bool RestorePersistentData();
62 :
63 : const String GetTitle() const;
64 : void SetTitle( const String& rTitle,
65 : bool bBroadcast = false );
66 : const String GetDescription() const;
67 : void SetDescription( const String& rDescription,
68 : bool bBroadcast = false );
69 :
70 : void SetContour( const PolyPolygon *pPoly,
71 : sal_Bool bAutomatic = sal_False );
72 : const PolyPolygon *HasContour() const;
73 0 : sal_Bool _HasContour() const { return pContour!=0; };
74 : void GetContour( PolyPolygon &rPoly ) const;
75 : void CreateContour();
76 :
77 0 : void SetAutomaticContour( sal_Bool bSet ) { bAutomaticContour = bSet; }
78 2 : sal_Bool HasAutomaticContour() const { return bAutomaticContour; }
79 :
80 : // set either a MM100 or pixel contour
81 : void SetContourAPI( const PolyPolygon *pPoly );
82 :
83 : // get either a MM100 or pixel contour, return sal_False if no contour is set.
84 : sal_Bool GetContourAPI( PolyPolygon &rPoly ) const;
85 :
86 0 : void SetPixelContour( sal_Bool bSet ) { bPixelContour = bSet; }
87 : sal_Bool IsPixelContour() const;
88 :
89 0 : sal_Bool IsContourMapModeValid() const { return bContourMapModeValid; }
90 :
91 : // Obtains the graphic with SwapIn for GrfNode via GetData for OLE.
92 : Graphic GetGraphic() const;
93 : };
94 :
95 : // Inline methods from Node.hxx - we know TxtNode only here!!
96 100 : inline SwNoTxtNode *SwNode::GetNoTxtNode()
97 : {
98 100 : return ND_NOTXTNODE & nNodeType ? (SwNoTxtNode*)this : 0;
99 : }
100 79 : inline const SwNoTxtNode *SwNode::GetNoTxtNode() const
101 : {
102 79 : return ND_NOTXTNODE & nNodeType ? (const SwNoTxtNode*)this : 0;
103 : }
104 :
105 : #endif // _NDNOTXT_HXX
106 :
107 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|