1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: hlnkitem.hxx,v $
10 * $Revision: 1.6.216.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SVX_HLNKITEM_HXX
31 #define _SVX_HLNKITEM_HXX
33 #include <tools/string.hxx>
34 #include <svtools/poolitem.hxx>
35 #include <sfx2/sfxsids.hrc>
36 #include <svtools/macitem.hxx>
37 #include "svx/svxdllapi.h"
39 #define HYPERDLG_EVENT_MOUSEOVER_OBJECT 0x0001
40 #define HYPERDLG_EVENT_MOUSECLICK_OBJECT 0x0002
41 #define HYPERDLG_EVENT_MOUSEOUT_OBJECT 0x0004
43 enum SvxLinkInsertMode
48 HLINK_HTMLMODE
= 0x0080
51 class SVX_DLLPUBLIC SvxHyperlinkItem
: public SfxPoolItem
56 SvxLinkInsertMode eType
;
59 SvxMacroTableDtor
* pMacroTable
;
66 SvxHyperlinkItem( USHORT _nWhich
= SID_HYPERLINK_GETLINK
):
67 SfxPoolItem(_nWhich
), pMacroTable(NULL
) { eType
= HLINK_DEFAULT
; nMacroEvents
=0; };
68 SvxHyperlinkItem( const SvxHyperlinkItem
& rHyperlinkItem
);
69 SvxHyperlinkItem( USHORT nWhich
, String
& rName
, String
& rURL
,
70 String
& rTarget
, String
& rIntName
,
71 SvxLinkInsertMode eTyp
= HLINK_FIELD
,
73 SvxMacroTableDtor
*pMacroTbl
=NULL
);
74 virtual ~SvxHyperlinkItem () { delete pMacroTable
; }
76 inline SvxHyperlinkItem
& operator=( const SvxHyperlinkItem
&rItem
);
78 virtual int operator==( const SfxPoolItem
& ) const;
79 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
80 virtual BOOL
QueryValue( com::sun::star::uno::Any
& rVal
, BYTE nMemberId
= 0 ) const;
81 virtual BOOL
PutValue( const com::sun::star::uno::Any
& rVal
, BYTE nMemberId
= 0 );
83 const String
& GetName() const { return sName
; }
84 void SetName(const String
& rName
) { sName
= rName
; }
86 const String
& GetURL() const { return sURL
; }
87 void SetURL(const String
& rURL
) { sURL
= rURL
; }
89 const String
& GetIntName () const { return sIntName
; }
90 void SetIntName(const String
& rIntName
) { sIntName
= rIntName
; }
92 const String
& GetTargetFrame() const { return sTarget
; }
93 void SetTargetFrame(const String
& rTarget
) { sTarget
= rTarget
; }
95 SvxLinkInsertMode
GetInsertMode() const { return eType
; }
96 void SetInsertMode( SvxLinkInsertMode eNew
) { eType
= eNew
; }
98 void SetMacro( USHORT nEvent
, const SvxMacro
& rMacro
);
100 void SetMacroTable( const SvxMacroTableDtor
& rTbl
);
101 const SvxMacroTableDtor
* GetMacroTbl() const { return pMacroTable
; }
103 void SetMacroEvents (const USHORT nEvents
) { nMacroEvents
= nEvents
; }
104 USHORT
GetMacroEvents() const { return nMacroEvents
; }
106 virtual SvStream
& Store( SvStream
&, USHORT nItemVersion
) const;
107 virtual SfxPoolItem
* Create( SvStream
&, USHORT nVer
) const;