1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_SVX_HLNKITEM_HXX
20 #define INCLUDED_SVX_HLNKITEM_HXX
22 #include <rtl/ustring.hxx>
23 #include <svl/poolitem.hxx>
24 #include <sfx2/sfxsids.hrc>
25 #include <svl/macitem.hxx>
26 #include <svx/svxdllapi.h>
28 #define HYPERDLG_EVENT_MOUSEOVER_OBJECT 0x0001
29 #define HYPERDLG_EVENT_MOUSECLICK_OBJECT 0x0002
30 #define HYPERDLG_EVENT_MOUSEOUT_OBJECT 0x0004
32 enum SvxLinkInsertMode
37 HLINK_HTMLMODE
= 0x0080
40 class SVX_DLLPUBLIC SvxHyperlinkItem
: public SfxPoolItem
45 SvxLinkInsertMode eType
;
48 SvxMacroTableDtor
* pMacroTable
;
50 sal_uInt16 nMacroEvents
;
55 SvxHyperlinkItem( sal_uInt16 _nWhich
= SID_HYPERLINK_GETLINK
):
56 SfxPoolItem(_nWhich
), pMacroTable(NULL
) { eType
= HLINK_DEFAULT
; nMacroEvents
=0; };
57 SvxHyperlinkItem( const SvxHyperlinkItem
& rHyperlinkItem
);
58 SvxHyperlinkItem( sal_uInt16 nWhich
, const OUString
& rName
, const OUString
& rURL
,
59 const OUString
& rTarget
, const OUString
& rIntName
,
60 SvxLinkInsertMode eTyp
= HLINK_FIELD
,
61 sal_uInt16 nEvents
= 0,
62 SvxMacroTableDtor
*pMacroTbl
=NULL
);
63 virtual ~SvxHyperlinkItem () { delete pMacroTable
; }
65 inline SvxHyperlinkItem
& operator=( const SvxHyperlinkItem
&rItem
);
67 virtual bool operator==( const SfxPoolItem
& ) const SAL_OVERRIDE
;
68 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const SAL_OVERRIDE
;
69 virtual bool QueryValue( com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 ) const SAL_OVERRIDE
;
70 virtual bool PutValue( const com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 ) SAL_OVERRIDE
;
72 const OUString
& GetName() const { return sName
; }
73 void SetName(const OUString
& rName
) { sName
= rName
; }
75 const OUString
& GetURL() const { return sURL
; }
76 void SetURL(const OUString
& rURL
) { sURL
= rURL
; }
78 const OUString
& GetIntName () const { return sIntName
; }
79 void SetIntName(const OUString
& rIntName
) { sIntName
= rIntName
; }
81 const OUString
& GetTargetFrame() const { return sTarget
; }
82 void SetTargetFrame(const OUString
& rTarget
) { sTarget
= rTarget
; }
84 SvxLinkInsertMode
GetInsertMode() const { return eType
; }
85 void SetInsertMode( SvxLinkInsertMode eNew
) { eType
= eNew
; }
87 void SetMacro( sal_uInt16 nEvent
, const SvxMacro
& rMacro
);
89 void SetMacroTable( const SvxMacroTableDtor
& rTbl
);
90 const SvxMacroTableDtor
* GetMacroTable() const { return pMacroTable
; }
92 void SetMacroEvents (const sal_uInt16 nEvents
) { nMacroEvents
= nEvents
; }
93 sal_uInt16
GetMacroEvents() const { return nMacroEvents
; }
95 virtual SvStream
& Store( SvStream
&, sal_uInt16 nItemVersion
) const SAL_OVERRIDE
;
96 virtual SfxPoolItem
* Create( SvStream
&, sal_uInt16 nVer
) const SAL_OVERRIDE
;
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */