xref: /aoo41x/main/sw/inc/ndnotxt.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _NDNOTXT_HXX
28 #define _NDNOTXT_HXX
29 
30 #include "node.hxx"
31 
32 class PolyPolygon;
33 
34 // --------------------
35 // SwNoTxtNode
36 // --------------------
37 
38 class SW_DLLPUBLIC SwNoTxtNode : public SwCntntNode
39 {
40 	friend class SwNodes;
41 	friend class SwNoTxtFrm;
42 
43 //    String aAlternateText;      // alternativer Text  (HTML)
44 
45 	PolyPolygon *pContour;		// Polygon fuer Konturumlauf
46     sal_Bool bAutomaticContour : 1; // automatic contour polygon, not manipulated
47 	sal_Bool bContourMapModeValid : 1; // contour map mode is not the graphics's
48 								   // prefered map mode, but either
49    								   // MM100 or or pixel
50 	sal_Bool bPixelContour : 1;		// contour map mode is invalid and pixel.
51 
52 	// erzeugt fuer alle Ableitungen einen AttrSet mit Bereichen
53 	// fuer Frame- und Grafik-Attributen (wird nur vom SwCntntNode gerufen)
54 	virtual void NewAttrSet( SwAttrPool& );
55 
56 	SwNoTxtNode( const SwNoTxtNode& );				//nicht erlaubt
57 	SwNoTxtNode &operator=( const SwNoTxtNode& );	//nicht erlaubt
58 
59 protected:
60 	SwNoTxtNode( const SwNodeIndex &rWhere, const sal_uInt8 nNdType,
61 				SwGrfFmtColl *pGrColl, SwAttrSet* pAutoAttr = 0 );
62 
63 public:
64 	~SwNoTxtNode();
65 
66 	virtual SwCntntFrm *MakeFrm( SwFrm* );
67 
68     inline SwGrfFmtColl *GetGrfColl() const { return (SwGrfFmtColl*)GetRegisteredIn(); }
69 
70 	virtual Size GetTwipSize() const = 0;
71 
72 	virtual sal_Bool SavePersistentData();
73 	virtual sal_Bool RestorePersistentData();
74 
75     const String GetTitle() const;
76     void SetTitle( const String& rTitle,
77                    bool bBroadcast = false );
78     const String GetDescription() const;
79     void SetDescription( const String& rDescription,
80                          bool bBroadcast = false );
81 
82 //    const String GetAlternateText() const;
83 //    void SetAlternateText( const String& rTxt,
84 //                           sal_Bool bBroadcast=sal_False );
85 
86     void               SetContour( const PolyPolygon *pPoly,
87                                    sal_Bool bAutomatic = sal_False );
88 	const PolyPolygon *HasContour() const;
89 	sal_Bool		       _HasContour() const { return pContour!=0; };
90 	void  			   GetContour( PolyPolygon &rPoly ) const;
91 	void 			   CreateContour();
92 
93 	void			   SetAutomaticContour( sal_Bool bSet ) { bAutomaticContour = bSet; }
94     sal_Bool               HasAutomaticContour() const { return bAutomaticContour; }
95 
96 	// set either a MM100 or pixel contour
97     void               SetContourAPI( const PolyPolygon *pPoly );
98 
99 	// get either a MM100 or pixel contour, return sal_False if no contour is set.
100 	sal_Bool  			   GetContourAPI( PolyPolygon &rPoly ) const;
101 
102 	void			   SetPixelContour( sal_Bool bSet ) { bPixelContour = bSet; }
103     sal_Bool               IsPixelContour() const;
104 
105     sal_Bool               IsContourMapModeValid() const { return bContourMapModeValid; }
106 
107 	//Besorgt die Graphic, mit SwapIn fuer GrfNode, per GetData fuer OLE.
108 	Graphic GetGraphic() const;
109 };
110 
111 // Inline Metoden aus Node.hxx - erst hier ist der TxtNode bekannt !!
112 inline SwNoTxtNode *SwNode::GetNoTxtNode()
113 {
114 	return ND_NOTXTNODE & nNodeType ? (SwNoTxtNode*)this : 0;
115 }
116 inline const SwNoTxtNode *SwNode::GetNoTxtNode() const
117 {
118 	return ND_NOTXTNODE & nNodeType ? (const SwNoTxtNode*)this : 0;
119 }
120 
121 #endif	// _NDNOTXT_HXX
122