xref: /aoo42x/main/sw/inc/txtinet.hxx (revision 1d2dbeb0)
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 _TXTINET_HXX
24 #define _TXTINET_HXX
25 
26 #include <txatbase.hxx>
27 #include <txtatr.hxx>
28 #include <calbck.hxx>
29 
30 class SwTxtNode;
31 class SwCharFmt;
32 
33 // ATT_INETFMT *********************************************
34 
35 class SW_DLLPUBLIC SwTxtINetFmt : public SwTxtAttrNesting, public SwClient
36 {
37     SwTxtNode * m_pTxtNode;
38     bool m_bVisited         : 1; // visited link?
39     bool m_bVisitedValid    : 1; // is m_bVisited valid?
40 
41 protected:
42 virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
43 
44 public:
45     SwTxtINetFmt( SwFmtINetFmt& rAttr, xub_StrLen nStart, xub_StrLen nEnd );
46 	virtual ~SwTxtINetFmt();
47 	TYPEINFO();
48 
49 	virtual sal_Bool GetInfo( SfxPoolItem& rInfo ) const;
50 
51     SW_DLLPRIVATE void InitINetFmt(SwTxtNode & rNode);
52 
53     // get and set TxtNode pointer
GetpTxtNode() const54     const SwTxtNode* GetpTxtNode() const { return m_pTxtNode; }
55 	inline const SwTxtNode& GetTxtNode() const;
ChgTxtNode(SwTxtNode * pNew)56     void ChgTxtNode( SwTxtNode* pNew ) { m_pTxtNode = pNew; }
57 
58 		  SwCharFmt* GetCharFmt();
GetCharFmt() const59 	const SwCharFmt* GetCharFmt() const
60             { return const_cast<SwTxtINetFmt*>(this)->GetCharFmt(); }
61 
IsVisited() const62     bool IsVisited() const { return m_bVisited; }
SetVisited(bool bNew)63     void SetVisited( bool bNew ) { m_bVisited = bNew; }
64 
IsVisitedValid() const65     bool IsVisitedValid() const { return m_bVisitedValid; }
SetVisitedValid(bool bNew)66     void SetVisitedValid( bool bNew ) { m_bVisitedValid = bNew; }
67 
68 	sal_Bool IsProtect() const;
69 };
70 
GetTxtNode() const71 inline const SwTxtNode& SwTxtINetFmt::GetTxtNode() const
72 {
73     ASSERT( m_pTxtNode, "SwTxtINetFmt: where is my TxtNode?" );
74     return *m_pTxtNode;
75 }
76 
77 #endif
78 
79