xref: /aoo41x/main/svx/inc/svx/hlnkitem.hxx (revision 3334a7e6)
1*3334a7e6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*3334a7e6SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*3334a7e6SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*3334a7e6SAndrew Rist  * distributed with this work for additional information
6*3334a7e6SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*3334a7e6SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*3334a7e6SAndrew Rist  * "License"); you may not use this file except in compliance
9*3334a7e6SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*3334a7e6SAndrew Rist  *
11*3334a7e6SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*3334a7e6SAndrew Rist  *
13*3334a7e6SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*3334a7e6SAndrew Rist  * software distributed under the License is distributed on an
15*3334a7e6SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*3334a7e6SAndrew Rist  * KIND, either express or implied.  See the License for the
17*3334a7e6SAndrew Rist  * specific language governing permissions and limitations
18*3334a7e6SAndrew Rist  * under the License.
19*3334a7e6SAndrew Rist  *
20*3334a7e6SAndrew Rist  *************************************************************/
21*3334a7e6SAndrew Rist 
22*3334a7e6SAndrew Rist 
23cdf0e10cSrcweir #ifndef _SVX_HLNKITEM_HXX
24cdf0e10cSrcweir #define _SVX_HLNKITEM_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <tools/string.hxx>
27cdf0e10cSrcweir #include <svl/poolitem.hxx>
28cdf0e10cSrcweir #include <sfx2/sfxsids.hrc>
29cdf0e10cSrcweir #include <svl/macitem.hxx>
30cdf0e10cSrcweir #include "svx/svxdllapi.h"
31cdf0e10cSrcweir 
32cdf0e10cSrcweir #define HYPERDLG_EVENT_MOUSEOVER_OBJECT		0x0001
33cdf0e10cSrcweir #define HYPERDLG_EVENT_MOUSECLICK_OBJECT	0x0002
34cdf0e10cSrcweir #define HYPERDLG_EVENT_MOUSEOUT_OBJECT		0x0004
35cdf0e10cSrcweir 
36cdf0e10cSrcweir enum SvxLinkInsertMode
37cdf0e10cSrcweir {
38cdf0e10cSrcweir 	HLINK_DEFAULT,
39cdf0e10cSrcweir 	HLINK_FIELD,
40cdf0e10cSrcweir 	HLINK_BUTTON,
41cdf0e10cSrcweir 	HLINK_HTMLMODE = 0x0080
42cdf0e10cSrcweir };
43cdf0e10cSrcweir 
44cdf0e10cSrcweir class SVX_DLLPUBLIC SvxHyperlinkItem : public SfxPoolItem
45cdf0e10cSrcweir {
46cdf0e10cSrcweir 	String sName;
47cdf0e10cSrcweir 	String sURL;
48cdf0e10cSrcweir 	String sTarget;
49cdf0e10cSrcweir 	SvxLinkInsertMode eType;
50cdf0e10cSrcweir 
51cdf0e10cSrcweir 	String sIntName;
52cdf0e10cSrcweir 	SvxMacroTableDtor*	pMacroTable;
53cdf0e10cSrcweir 
54cdf0e10cSrcweir 	sal_uInt16 nMacroEvents;
55cdf0e10cSrcweir 
56cdf0e10cSrcweir public:
57cdf0e10cSrcweir 	TYPEINFO();
58cdf0e10cSrcweir 
SvxHyperlinkItem(sal_uInt16 _nWhich=SID_HYPERLINK_GETLINK)59cdf0e10cSrcweir 	SvxHyperlinkItem( sal_uInt16 _nWhich = SID_HYPERLINK_GETLINK ):
60cdf0e10cSrcweir 				SfxPoolItem(_nWhich), pMacroTable(NULL)	{ eType = HLINK_DEFAULT; nMacroEvents=0; };
61cdf0e10cSrcweir 	SvxHyperlinkItem( const SvxHyperlinkItem& rHyperlinkItem );
62cdf0e10cSrcweir 	SvxHyperlinkItem( sal_uInt16 nWhich, String& rName, String& rURL,
63cdf0e10cSrcweir 								    String& rTarget, String& rIntName,
64cdf0e10cSrcweir 									SvxLinkInsertMode eTyp = HLINK_FIELD,
65cdf0e10cSrcweir 									sal_uInt16 nEvents = 0,
66cdf0e10cSrcweir 									SvxMacroTableDtor *pMacroTbl =NULL );
~SvxHyperlinkItem()67cdf0e10cSrcweir 	virtual	~SvxHyperlinkItem () { delete pMacroTable; }
68cdf0e10cSrcweir 
69cdf0e10cSrcweir 	inline SvxHyperlinkItem& operator=( const SvxHyperlinkItem &rItem );
70cdf0e10cSrcweir 
71cdf0e10cSrcweir 	virtual int 			 operator==( const SfxPoolItem& ) const;
72cdf0e10cSrcweir 	virtual SfxPoolItem*	 Clone( SfxItemPool *pPool = 0 ) const;
73cdf0e10cSrcweir 	virtual	sal_Bool        	 QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
74cdf0e10cSrcweir 	virtual	sal_Bool			 PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
75cdf0e10cSrcweir 
GetName() const76cdf0e10cSrcweir 	const	String& GetName() const { return sName; }
SetName(const String & rName)77cdf0e10cSrcweir 	void	SetName(const String& rName) { sName = rName; }
78cdf0e10cSrcweir 
GetURL() const79cdf0e10cSrcweir 	const	String& GetURL() const { return sURL; }
SetURL(const String & rURL)80cdf0e10cSrcweir 	void	SetURL(const String& rURL) { sURL = rURL; }
81cdf0e10cSrcweir 
GetIntName() const82cdf0e10cSrcweir 	const	String& GetIntName () const { return sIntName; }
SetIntName(const String & rIntName)83cdf0e10cSrcweir 	void	SetIntName(const String& rIntName) { sIntName = rIntName; }
84cdf0e10cSrcweir 
GetTargetFrame() const85cdf0e10cSrcweir 	const	String& GetTargetFrame() const { return sTarget; }
SetTargetFrame(const String & rTarget)86cdf0e10cSrcweir 	void	SetTargetFrame(const String& rTarget) { sTarget = rTarget; }
87cdf0e10cSrcweir 
GetInsertMode() const88cdf0e10cSrcweir 	SvxLinkInsertMode GetInsertMode() const { return eType; }
SetInsertMode(SvxLinkInsertMode eNew)89cdf0e10cSrcweir 	void	SetInsertMode( SvxLinkInsertMode eNew ) { eType = eNew; }
90cdf0e10cSrcweir 
91cdf0e10cSrcweir 	void SetMacro( sal_uInt16 nEvent, const SvxMacro& rMacro );
92cdf0e10cSrcweir 
93cdf0e10cSrcweir 	void SetMacroTable( const SvxMacroTableDtor& rTbl );
GetMacroTbl() const94cdf0e10cSrcweir 	const SvxMacroTableDtor* GetMacroTbl() const	{ return pMacroTable; }
95cdf0e10cSrcweir 
SetMacroEvents(const sal_uInt16 nEvents)96cdf0e10cSrcweir 	void SetMacroEvents (const sal_uInt16 nEvents) { nMacroEvents = nEvents; }
GetMacroEvents() const97cdf0e10cSrcweir 	sal_uInt16 GetMacroEvents() const { return nMacroEvents; }
98cdf0e10cSrcweir 
99cdf0e10cSrcweir 	virtual SvStream&			Store( SvStream &, sal_uInt16 nItemVersion ) const;
100cdf0e10cSrcweir 	virtual SfxPoolItem*		Create( SvStream &, sal_uInt16 nVer ) const;
101cdf0e10cSrcweir 
102cdf0e10cSrcweir };
103cdf0e10cSrcweir 
104cdf0e10cSrcweir #endif
105cdf0e10cSrcweir 
106cdf0e10cSrcweir 
107