update credits
[LibreOffice.git] / include / svx / hlnkitem.hxx
blobd1bdcfe5aa71d6e858516aaf101d1e2e1366ac4e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 _SVX_HLNKITEM_HXX
20 #define _SVX_HLNKITEM_HXX
22 #include <tools/string.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
34 HLINK_DEFAULT,
35 HLINK_FIELD,
36 HLINK_BUTTON,
37 HLINK_HTMLMODE = 0x0080
40 class SVX_DLLPUBLIC SvxHyperlinkItem : public SfxPoolItem
42 String sName;
43 String sURL;
44 String sTarget;
45 SvxLinkInsertMode eType;
47 String sIntName;
48 SvxMacroTableDtor* pMacroTable;
50 sal_uInt16 nMacroEvents;
52 public:
53 TYPEINFO();
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, String& rName, String& rURL,
59 String& rTarget, String& 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 int operator==( const SfxPoolItem& ) const;
68 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
69 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
70 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
72 const String& GetName() const { return sName; }
73 void SetName(const String& rName) { sName = rName; }
75 const String& GetURL() const { return sURL; }
76 void SetURL(const String& rURL) { sURL = rURL; }
78 const String& GetIntName () const { return sIntName; }
79 void SetIntName(const String& rIntName) { sIntName = rIntName; }
81 const String& GetTargetFrame() const { return sTarget; }
82 void SetTargetFrame(const String& 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* GetMacroTbl() 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;
96 virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nVer ) const;
100 #endif
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */