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
78 // const String GetAlternateText() const;
79 // void SetAlternateText( const String& rTxt,
80 // sal_Bool bBroadcast=sal_False );
81
82 void SetContour( const PolyPolygon *pPoly,
83 sal_Bool bAutomatic = sal_False );
84 const PolyPolygon *HasContour() const;
_HasContour() const85 sal_Bool _HasContour() const { return pContour!=0; };
86 void GetContour( PolyPolygon &rPoly ) const;
87 void CreateContour();
88
SetAutomaticContour(sal_Bool bSet)89 void SetAutomaticContour( sal_Bool bSet ) { bAutomaticContour = bSet; }
HasAutomaticContour() const90 sal_Bool HasAutomaticContour() const { return bAutomaticContour; }
91
92 // set either a MM100 or pixel contour
93 void SetContourAPI( const PolyPolygon *pPoly );
94
95 // get either a MM100 or pixel contour, return sal_False if no contour is set.
96 sal_Bool GetContourAPI( PolyPolygon &rPoly ) const;
97
SetPixelContour(sal_Bool bSet)98 void SetPixelContour( sal_Bool bSet ) { bPixelContour = bSet; }
99 sal_Bool IsPixelContour() const;
100
IsContourMapModeValid() const101 sal_Bool IsContourMapModeValid() const { return bContourMapModeValid; }
102
103 //Besorgt die Graphic, mit SwapIn fuer GrfNode, per GetData fuer OLE.
104 Graphic GetGraphic() const;
105 };
106
107 // Inline Metoden aus Node.hxx - erst hier ist der TxtNode bekannt !!
GetNoTxtNode()108 inline SwNoTxtNode *SwNode::GetNoTxtNode()
109 {
110 return ND_NOTXTNODE & nNodeType ? (SwNoTxtNode*)this : 0;
111 }
GetNoTxtNode() const112 inline const SwNoTxtNode *SwNode::GetNoTxtNode() const
113 {
114 return ND_NOTXTNODE & nNodeType ? (const SwNoTxtNode*)this : 0;
115 }
116
117 #endif // _NDNOTXT_HXX
118