Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef _SVX_HLNKITEM_HXX
29 : : #define _SVX_HLNKITEM_HXX
30 : :
31 : : #include <tools/string.hxx>
32 : : #include <svl/poolitem.hxx>
33 : : #include <sfx2/sfxsids.hrc>
34 : : #include <svl/macitem.hxx>
35 : : #include "svx/svxdllapi.h"
36 : :
37 : : #define HYPERDLG_EVENT_MOUSEOVER_OBJECT 0x0001
38 : : #define HYPERDLG_EVENT_MOUSECLICK_OBJECT 0x0002
39 : : #define HYPERDLG_EVENT_MOUSEOUT_OBJECT 0x0004
40 : :
41 : : enum SvxLinkInsertMode
42 : : {
43 : : HLINK_DEFAULT,
44 : : HLINK_FIELD,
45 : : HLINK_BUTTON,
46 : : HLINK_HTMLMODE = 0x0080
47 : : };
48 : :
49 : : class SVX_DLLPUBLIC SvxHyperlinkItem : public SfxPoolItem
50 : : {
51 : : String sName;
52 : : String sURL;
53 : : String sTarget;
54 : : SvxLinkInsertMode eType;
55 : :
56 : : String sIntName;
57 : : SvxMacroTableDtor* pMacroTable;
58 : :
59 : : sal_uInt16 nMacroEvents;
60 : :
61 : : public:
62 : : TYPEINFO();
63 : :
64 : 0 : SvxHyperlinkItem( sal_uInt16 _nWhich = SID_HYPERLINK_GETLINK ):
65 [ # # ][ # # ]: 0 : SfxPoolItem(_nWhich), pMacroTable(NULL) { eType = HLINK_DEFAULT; nMacroEvents=0; };
[ # # ][ # # ]
66 : : SvxHyperlinkItem( const SvxHyperlinkItem& rHyperlinkItem );
67 : : SvxHyperlinkItem( sal_uInt16 nWhich, String& rName, String& rURL,
68 : : String& rTarget, String& rIntName,
69 : : SvxLinkInsertMode eTyp = HLINK_FIELD,
70 : : sal_uInt16 nEvents = 0,
71 : : SvxMacroTableDtor *pMacroTbl =NULL );
72 [ # # ][ # # ]: 0 : virtual ~SvxHyperlinkItem () { delete pMacroTable; }
[ # # ][ # # ]
[ # # ][ # # ]
73 : :
74 : : inline SvxHyperlinkItem& operator=( const SvxHyperlinkItem &rItem );
75 : :
76 : : virtual int operator==( const SfxPoolItem& ) const;
77 : : virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
78 : : virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
79 : : virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
80 : :
81 : 0 : const String& GetName() const { return sName; }
82 : 0 : void SetName(const String& rName) { sName = rName; }
83 : :
84 : 0 : const String& GetURL() const { return sURL; }
85 : 0 : void SetURL(const String& rURL) { sURL = rURL; }
86 : :
87 : 0 : const String& GetIntName () const { return sIntName; }
88 : 0 : void SetIntName(const String& rIntName) { sIntName = rIntName; }
89 : :
90 : 0 : const String& GetTargetFrame() const { return sTarget; }
91 : 0 : void SetTargetFrame(const String& rTarget) { sTarget = rTarget; }
92 : :
93 : 0 : SvxLinkInsertMode GetInsertMode() const { return eType; }
94 : 0 : void SetInsertMode( SvxLinkInsertMode eNew ) { eType = eNew; }
95 : :
96 : : void SetMacro( sal_uInt16 nEvent, const SvxMacro& rMacro );
97 : :
98 : : void SetMacroTable( const SvxMacroTableDtor& rTbl );
99 : 0 : const SvxMacroTableDtor* GetMacroTbl() const { return pMacroTable; }
100 : :
101 : 0 : void SetMacroEvents (const sal_uInt16 nEvents) { nMacroEvents = nEvents; }
102 : 0 : sal_uInt16 GetMacroEvents() const { return nMacroEvents; }
103 : :
104 : : virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const;
105 : : virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nVer ) const;
106 : :
107 : : };
108 : :
109 : : #endif
110 : :
111 : :
112 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|