Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef _NDNOTXT_HXX
29 : : #define _NDNOTXT_HXX
30 : :
31 : : #include "node.hxx"
32 : :
33 : : class PolyPolygon;
34 : :
35 : : // SwNoTxtNode
36 : :
37 : : class SW_DLLPUBLIC SwNoTxtNode : public SwCntntNode
38 : : {
39 : : friend class SwNodes;
40 : : friend class SwNoTxtFrm;
41 : :
42 : : PolyPolygon *pContour;
43 : : sal_Bool bAutomaticContour : 1; // automatic contour polygon, not manipulated
44 : : sal_Bool bContourMapModeValid : 1; // contour map mode is not the graphics's
45 : : // prefered map mode, but either
46 : : // MM100 or or pixel
47 : : sal_Bool bPixelContour : 1; // contour map mode is invalid and pixel.
48 : :
49 : : // Creates for all derivations an AttrSet with ranges for frame- and
50 : : // graphics-attributes (only called by SwCntntNode).
51 : : virtual void NewAttrSet( SwAttrPool& );
52 : :
53 : : SwNoTxtNode( const SwNoTxtNode& ); // Not allowed.
54 : : SwNoTxtNode &operator=( const SwNoTxtNode& ); // Not allowed.
55 : :
56 : : protected:
57 : : SwNoTxtNode( const SwNodeIndex &rWhere, const sal_uInt8 nNdType,
58 : : SwGrfFmtColl *pGrColl, SwAttrSet* pAutoAttr = 0 );
59 : :
60 : : public:
61 : : ~SwNoTxtNode();
62 : :
63 : : virtual SwCntntFrm *MakeFrm( SwFrm* );
64 : :
65 : 3 : inline SwGrfFmtColl *GetGrfColl() const { return (SwGrfFmtColl*)GetRegisteredIn(); }
66 : :
67 : : virtual Size GetTwipSize() const = 0;
68 : :
69 : : virtual sal_Bool SavePersistentData();
70 : : virtual sal_Bool RestorePersistentData();
71 : :
72 : : const String GetTitle() const;
73 : : void SetTitle( const String& rTitle,
74 : : bool bBroadcast = false );
75 : : const String GetDescription() const;
76 : : void SetDescription( const String& rDescription,
77 : : bool bBroadcast = false );
78 : :
79 : : void SetContour( const PolyPolygon *pPoly,
80 : : sal_Bool bAutomatic = sal_False );
81 : : const PolyPolygon *HasContour() const;
82 : 0 : sal_Bool _HasContour() const { return pContour!=0; };
83 : : void GetContour( PolyPolygon &rPoly ) const;
84 : : void CreateContour();
85 : :
86 : 0 : void SetAutomaticContour( sal_Bool bSet ) { bAutomaticContour = bSet; }
87 : 3 : sal_Bool HasAutomaticContour() const { return bAutomaticContour; }
88 : :
89 : : // set either a MM100 or pixel contour
90 : : void SetContourAPI( const PolyPolygon *pPoly );
91 : :
92 : : // get either a MM100 or pixel contour, return sal_False if no contour is set.
93 : : sal_Bool GetContourAPI( PolyPolygon &rPoly ) const;
94 : :
95 : 0 : void SetPixelContour( sal_Bool bSet ) { bPixelContour = bSet; }
96 : : sal_Bool IsPixelContour() const;
97 : :
98 : 0 : sal_Bool IsContourMapModeValid() const { return bContourMapModeValid; }
99 : :
100 : : // Obtains the graphic with SwapIn for GrfNode via GetData for OLE.
101 : : Graphic GetGraphic() const;
102 : : };
103 : :
104 : : // Inline methods from Node.hxx - we know TxtNode only here!!
105 : 150 : inline SwNoTxtNode *SwNode::GetNoTxtNode()
106 : : {
107 [ + + ]: 150 : return ND_NOTXTNODE & nNodeType ? (SwNoTxtNode*)this : 0;
108 : : }
109 : 223 : inline const SwNoTxtNode *SwNode::GetNoTxtNode() const
110 : : {
111 [ + - ]: 223 : return ND_NOTXTNODE & nNodeType ? (const SwNoTxtNode*)this : 0;
112 : : }
113 : :
114 : : #endif // _NDNOTXT_HXX
115 : :
116 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|