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>
27 #include <o3tl/typed_flags_set.hxx>
30 enum class HyperDialogEvent
{
32 MouseOverObject
= 0x0001,
33 MouseClickObject
= 0x0002,
34 MouseOutObject
= 0x0004,
37 template<> struct typed_flags
<HyperDialogEvent
> : is_typed_flags
<HyperDialogEvent
, 0x07> {};
40 enum SvxLinkInsertMode
45 HLINK_HTMLMODE
= 0x0080
48 class SVX_DLLPUBLIC SvxHyperlinkItem
: public SfxPoolItem
53 SvxLinkInsertMode eType
;
56 std::unique_ptr
<SvxMacroTableDtor
> pMacroTable
;
58 HyperDialogEvent nMacroEvents
;
61 static SfxPoolItem
* CreateDefault();
63 SvxHyperlinkItem( sal_uInt16 _nWhich
= SID_HYPERLINK_GETLINK
):
64 SfxPoolItem(_nWhich
) { eType
= HLINK_DEFAULT
; nMacroEvents
=HyperDialogEvent::NONE
; };
65 SvxHyperlinkItem( const SvxHyperlinkItem
& rHyperlinkItem
);
66 SvxHyperlinkItem( sal_uInt16 nWhich
, const OUString
& rName
, const OUString
& rURL
,
67 const OUString
& rTarget
, const OUString
& rIntName
,
68 SvxLinkInsertMode eTyp
,
69 HyperDialogEvent nEvents
,
70 SvxMacroTableDtor
const *pMacroTbl
);
72 virtual bool operator==( const SfxPoolItem
& ) const override
;
73 virtual SvxHyperlinkItem
* Clone( SfxItemPool
*pPool
= nullptr ) const override
;
74 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 ) const override
;
75 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt8 nMemberId
) override
;
77 const OUString
& GetName() const { return sName
; }
78 void SetName(const OUString
& rName
) { sName
= rName
; }
80 const OUString
& GetURL() const { return sURL
; }
81 void SetURL(const OUString
& rURL
) { sURL
= rURL
; }
83 const OUString
& GetIntName () const { return sIntName
; }
84 void SetIntName(const OUString
& rIntName
) { sIntName
= rIntName
; }
86 const OUString
& GetTargetFrame() const { return sTarget
; }
87 void SetTargetFrame(const OUString
& rTarget
) { sTarget
= rTarget
; }
89 SvxLinkInsertMode
GetInsertMode() const { return eType
; }
90 void SetInsertMode( SvxLinkInsertMode eNew
) { eType
= eNew
; }
92 void SetMacro( HyperDialogEvent nEvent
, const SvxMacro
& rMacro
);
94 void SetMacroTable( const SvxMacroTableDtor
& rTbl
);
95 const SvxMacroTableDtor
* GetMacroTable() const { return pMacroTable
.get(); }
97 void SetMacroEvents (const HyperDialogEvent nEvents
) { nMacroEvents
= nEvents
; }
98 HyperDialogEvent
GetMacroEvents() const { return nMacroEvents
; }
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */