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