LibreOffice Module svx (master) 1
hlnkitem.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#ifndef INCLUDED_SVX_HLNKITEM_HXX
20#define INCLUDED_SVX_HLNKITEM_HXX
21
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#include <memory>
29#include <rtl/ustrbuf.hxx>
30
31enum class HyperDialogEvent {
32 NONE = 0x0000,
33 MouseOverObject = 0x0001,
34 MouseClickObject = 0x0002,
35 MouseOutObject = 0x0004,
36};
37namespace o3tl {
38 template<> struct typed_flags<HyperDialogEvent> : is_typed_flags<HyperDialogEvent, 0x07> {};
39}
40
42{
46 HLINK_HTMLMODE = 0x0080
47};
48
50{
51 OUString sName;
52 OUString sURL;
53 OUString sTarget;
56
57 OUString sIntName;
58 std::unique_ptr<SvxMacroTableDtor> pMacroTable;
59
61
62public:
63 static SfxPoolItem* CreateDefault();
64
65 SvxHyperlinkItem( TypedWhichId<SvxHyperlinkItem> _nWhich = SID_HYPERLINK_GETLINK ):
66 SfxPoolItem(_nWhich) { eType = HLINK_DEFAULT; nMacroEvents=HyperDialogEvent::NONE; };
67 SvxHyperlinkItem( const SvxHyperlinkItem& rHyperlinkItem );
68 SvxHyperlinkItem( TypedWhichId<SvxHyperlinkItem> nWhich, OUString aName, OUString aURL,
69 OUString aTarget, OUString aIntName,
71 HyperDialogEvent nEvents,
72 SvxMacroTableDtor const *pMacroTbl,
73 OUString aReplacementText = OUString());
74
75 virtual bool operator==( const SfxPoolItem& ) const override;
76 virtual SvxHyperlinkItem* Clone( SfxItemPool *pPool = nullptr ) const override;
77 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
78 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
79
80 const OUString& GetName() const { return sName; }
81 void SetName(const OUString& rName) { sName = rName; }
82
83 const OUString& GetURL() const { return sURL; }
84 void SetURL(const OUString& rURL) { sURL = rURL; }
85
86 const OUString& GetIntName () const { return sIntName; }
87 void SetIntName(const OUString& rIntName) { sIntName = rIntName; }
88
89 const OUString& GetTargetFrame() const { return sTarget; }
90 void SetTargetFrame(const OUString& rTarget) { sTarget = rTarget; }
91
93 void SetInsertMode( SvxLinkInsertMode eNew ) { eType = eNew; }
94
95 void SetMacro( HyperDialogEvent nEvent, const SvxMacro& rMacro );
96
97 void SetMacroTable( const SvxMacroTableDtor& rTbl );
98 const SvxMacroTableDtor* GetMacroTable() const { return pMacroTable.get(); }
99
100 void SetMacroEvents (const HyperDialogEvent nEvents) { nMacroEvents = nEvents; }
101 HyperDialogEvent GetMacroEvents() const { return nMacroEvents; }
102
103 const OUString& GetReplacementText() const { return sReplacementText; }
104 void SetReplacementText(const OUString& rReplacementText) { sReplacementText = rReplacementText; }
105
106};
107
108#endif
109
110
111/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
virtual bool operator==(const SfxPoolItem &) const=0
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId)
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
void SetMacroEvents(const HyperDialogEvent nEvents)
Definition: hlnkitem.hxx:100
void SetReplacementText(const OUString &rReplacementText)
Definition: hlnkitem.hxx:104
HyperDialogEvent GetMacroEvents() const
Definition: hlnkitem.hxx:101
const OUString & GetReplacementText() const
Definition: hlnkitem.hxx:103
OUString sTarget
Definition: hlnkitem.hxx:53
HyperDialogEvent nMacroEvents
Definition: hlnkitem.hxx:60
SvxLinkInsertMode eType
Definition: hlnkitem.hxx:54
SvxLinkInsertMode GetInsertMode() const
Definition: hlnkitem.hxx:92
OUString sIntName
Definition: hlnkitem.hxx:57
void SetIntName(const OUString &rIntName)
Definition: hlnkitem.hxx:87
SvxHyperlinkItem(TypedWhichId< SvxHyperlinkItem > _nWhich=SID_HYPERLINK_GETLINK)
Definition: hlnkitem.hxx:65
const OUString & GetName() const
Definition: hlnkitem.hxx:80
const OUString & GetURL() const
Definition: hlnkitem.hxx:83
const OUString & GetIntName() const
Definition: hlnkitem.hxx:86
void SetName(const OUString &rName)
Definition: hlnkitem.hxx:81
OUString sURL
Definition: hlnkitem.hxx:52
std::unique_ptr< SvxMacroTableDtor > pMacroTable
Definition: hlnkitem.hxx:58
OUString sReplacementText
Definition: hlnkitem.hxx:55
void SetInsertMode(SvxLinkInsertMode eNew)
Definition: hlnkitem.hxx:93
const SvxMacroTableDtor * GetMacroTable() const
Definition: hlnkitem.hxx:98
OUString sName
Definition: hlnkitem.hxx:51
void SetURL(const OUString &rURL)
Definition: hlnkitem.hxx:84
const OUString & GetTargetFrame() const
Definition: hlnkitem.hxx:89
void SetTargetFrame(const OUString &rTarget)
Definition: hlnkitem.hxx:90
FilterGroup & rTarget
DocumentType eType
OUString sName
HyperDialogEvent
Definition: hlnkitem.hxx:31
SvxLinkInsertMode
Definition: hlnkitem.hxx:42
@ HLINK_FIELD
Definition: hlnkitem.hxx:44
@ HLINK_DEFAULT
Definition: hlnkitem.hxx:43
@ HLINK_HTMLMODE
Definition: hlnkitem.hxx:46
@ HLINK_BUTTON
Definition: hlnkitem.hxx:45
NONE
#define SVX_DLLPUBLIC
Definition: svxdllapi.h:28
unsigned char sal_uInt8