1 /**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23 #ifndef _NDNOTXT_HXX
24 #define _NDNOTXT_HXX
25
26 #include "node.hxx"
27
28 class PolyPolygon;
29
30 // --------------------
31 // SwNoTxtNode
32 // --------------------
33
34 class SW_DLLPUBLIC SwNoTxtNode : public SwCntntNode
35 {
36 friend class SwNodes;
37 friend class SwNoTxtFrm;
38
39 // String aAlternateText; // alternativer Text (HTML)
40
41 PolyPolygon *pContour; // Polygon fuer Konturumlauf
42 sal_Bool bAutomaticContour : 1; // automatic contour polygon, not manipulated
43 sal_Bool bContourMapModeValid : 1; // contour map mode is not the graphics's
44 // preferred map mode, but either
45 // MM100 or or pixel
46 sal_Bool bPixelContour : 1; // contour map mode is invalid and pixel.
47
48 // erzeugt fuer alle Ableitungen einen AttrSet mit Bereichen
49 // fuer Frame- und Grafik-Attributen (wird nur vom SwCntntNode gerufen)
50 virtual void NewAttrSet( SwAttrPool& );
51
52 SwNoTxtNode( const SwNoTxtNode& ); //nicht erlaubt
53 SwNoTxtNode &operator=( const SwNoTxtNode& ); //nicht erlaubt
54
55 protected:
56 SwNoTxtNode( const SwNodeIndex &rWhere, const sal_uInt8 nNdType,
57 SwGrfFmtColl *pGrColl, SwAttrSet* pAutoAttr = 0 );
58
59 public:
60 ~SwNoTxtNode();
61
62 virtual SwCntntFrm *MakeFrm( SwFrm* );
63
GetGrfColl() const64 inline SwGrfFmtColl *GetGrfColl() const { return (SwGrfFmtColl*)GetRegisteredIn(); }
65
66 virtual Size GetTwipSize() const = 0;
67
68 virtual sal_Bool SavePersistentData();
69 virtual sal_Bool RestorePersistentData();
70
71 const String GetTitle() const;
72 void SetTitle( const String& rTitle,
73 bool bBroadcast = false );
74 const String GetDescription() const;
75 void SetDescription( const String& rDescription,
76 bool bBroadcast = false );
77 bool IsDecorative() const;
78 void SetDecorative( bool bDecorative );
79
80 // const String GetAlternateText() const;
81 // void SetAlternateText( const String& rTxt,
82 // sal_Bool bBroadcast=sal_False );
83
84 void SetContour( const PolyPolygon *pPoly,
85 sal_Bool bAutomatic = sal_False );
86 const PolyPolygon *HasContour() const;
_HasContour() const87 sal_Bool _HasContour() const { return pContour!=0; };
88 void GetContour( PolyPolygon &rPoly ) const;
89 void CreateContour();
90
SetAutomaticContour(sal_Bool bSet)91 void SetAutomaticContour( sal_Bool bSet ) { bAutomaticContour = bSet; }
HasAutomaticContour() const92 sal_Bool HasAutomaticContour() const { return bAutomaticContour; }
93
94 // set either a MM100 or pixel contour
95 void SetContourAPI( const PolyPolygon *pPoly );
96
97 // get either a MM100 or pixel contour, return sal_False if no contour is set.
98 sal_Bool GetContourAPI( PolyPolygon &rPoly ) const;
99
SetPixelContour(sal_Bool bSet)100 void SetPixelContour( sal_Bool bSet ) { bPixelContour = bSet; }
101 sal_Bool IsPixelContour() const;
102
IsContourMapModeValid() const103 sal_Bool IsContourMapModeValid() const { return bContourMapModeValid; }
104
105 //Besorgt die Graphic, mit SwapIn fuer GrfNode, per GetData fuer OLE.
106 Graphic GetGraphic() const;
107 };
108
109 // Inline Metoden aus Node.hxx - erst hier ist der TxtNode bekannt !!
GetNoTxtNode()110 inline SwNoTxtNode *SwNode::GetNoTxtNode()
111 {
112 return ND_NOTXTNODE & nNodeType ? (SwNoTxtNode*)this : 0;
113 }
GetNoTxtNode() const114 inline const SwNoTxtNode *SwNode::GetNoTxtNode() const
115 {
116 return ND_NOTXTNODE & nNodeType ? (const SwNoTxtNode*)this : 0;
117 }
118
119 #endif // _NDNOTXT_HXX
120