xref: /aoo41x/main/sw/inc/fmtinfmt.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 _FMTINFMT_HXX
28 #define _FMTINFMT_HXX
29 
30 #include <tools/string.hxx>
31 #include <svl/poolitem.hxx>
32 #include "swdllapi.h"
33 
34 class SvxMacro;
35 class SvxMacroTableDtor;
36 class SwTxtINetFmt;
37 class IntlWrapper;
38 
39 // ATT_INETFMT *********************************************
40 
41 class SW_DLLPUBLIC SwFmtINetFmt: public SfxPoolItem
42 {
43 	friend class SwTxtINetFmt;
44 
45 	String aURL;					// die URL
46 	String aTargetFrame;			// in diesen Frame soll die URL
47 	String aINetFmt;
48 	String aVisitedFmt;
49 	String aName;					// Name des Links
50 	SvxMacroTableDtor* pMacroTbl;
51 	SwTxtINetFmt* pTxtAttr;			// mein TextAttribut
52 	sal_uInt16 nINetId;
53 	sal_uInt16 nVisitedId;
54 public:
55 	SwFmtINetFmt( const String& rURL, const String& rTarget );
56 	SwFmtINetFmt( const SwFmtINetFmt& rAttr );
57     SwFmtINetFmt();                     // for TypeInfo
58 	virtual ~SwFmtINetFmt();
59 
60     TYPEINFO();
61 
62 	// "pure virtual Methoden" vom SfxPoolItem
63 	virtual int             operator==( const SfxPoolItem& ) const;
64 	virtual SfxPoolItem*	Clone( SfxItemPool* pPool = 0 ) const;
65 	virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
66 									SfxMapUnit eCoreMetric,
67 									SfxMapUnit ePresMetric,
68 									String &rText,
69                                     const IntlWrapper* pIntl = 0 ) const;
70 
71 	virtual	sal_Bool        	QueryValue( com::sun::star::uno::Any& rVal,
72 										sal_uInt8 nMemberId = 0 ) const;
73 	virtual	sal_Bool			PutValue( const com::sun::star::uno::Any& rVal,
74 										sal_uInt8 nMemberId = 0 );
75 
76 
77 	const SwTxtINetFmt* GetTxtINetFmt() const	{ return pTxtAttr; }
78 	SwTxtINetFmt* GetTxtINetFmt()				{ return pTxtAttr; }
79 
80 	const String& GetValue() const 			{ return aURL; }
81 
82 	const String& GetName() const 			{ return aName; }
83 	void SetName( const String& rNm )		{ aName = rNm; }
84 
85 	const String& GetTargetFrame() const 	{ return aTargetFrame; }
86 
87 	const String& GetINetFmt() const		{ return aINetFmt; }
88 	void SetINetFmt( const String& rNm )	{ aINetFmt = rNm; }
89 
90 	const String& GetVisitedFmt() const		{ return aVisitedFmt; }
91 	void SetVisitedFmt( const String& rNm )	{ aVisitedFmt = rNm; }
92 
93 	sal_uInt16 GetINetFmtId() const				{ return nINetId; }
94 	void SetINetFmtId( sal_uInt16 nNew )		{ nINetId = nNew; }
95 
96 	sal_uInt16 GetVisitedFmtId() const			{ return nVisitedId; }
97 	void SetVisitedFmtId( sal_uInt16 nNew )		{ nVisitedId = nNew; }
98 
99 	// setze eine neue oder loesche die akt. MakroTabelle
100 	void SetMacroTbl( const SvxMacroTableDtor* pTbl = 0 );
101 	const SvxMacroTableDtor* GetMacroTbl() const	{ return pMacroTbl; }
102 
103 	// setze / erfrage ein Makro
104 	void SetMacro( sal_uInt16 nEvent, const SvxMacro& rMacro );
105 	const SvxMacro* GetMacro( sal_uInt16 nEvent ) const;
106 };
107 
108 
109 #endif
110 
111