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 _FMTINFMT_HXX
29 : : #define _FMTINFMT_HXX
30 : :
31 : : #include <tools/string.hxx>
32 : : #include <svl/poolitem.hxx>
33 : : #include "swdllapi.h"
34 : :
35 : : class SvxMacro;
36 : : class SvxMacroTableDtor;
37 : : class SwTxtINetFmt;
38 : : class IntlWrapper;
39 : :
40 : : // ATT_INETFMT
41 : :
42 : : class SW_DLLPUBLIC SwFmtINetFmt: public SfxPoolItem
43 : : {
44 : : friend class SwTxtINetFmt;
45 : :
46 : : String aURL; // URL.
47 : : String aTargetFrame; // Target frame for URL.
48 : : String aINetFmt;
49 : : String aVisitedFmt;
50 : : String aName; // Name of the link.
51 : : SvxMacroTableDtor* pMacroTbl;
52 : : SwTxtINetFmt* pTxtAttr; // My TextAttribute.
53 : : sal_uInt16 nINetId;
54 : : sal_uInt16 nVisitedId;
55 : : public:
56 : : SwFmtINetFmt( const String& rURL, const String& rTarget );
57 : : SwFmtINetFmt( const SwFmtINetFmt& rAttr );
58 : : SwFmtINetFmt(); // For TypeInfo.
59 : : virtual ~SwFmtINetFmt();
60 : :
61 : : TYPEINFO();
62 : :
63 : : // "Pure virtual methods" of SfxPoolItem.
64 : : virtual int operator==( const SfxPoolItem& ) const;
65 : : virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
66 : : virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
67 : : SfxMapUnit eCoreMetric,
68 : : SfxMapUnit ePresMetric,
69 : : String &rText,
70 : : const IntlWrapper* pIntl = 0 ) const;
71 : :
72 : : virtual bool QueryValue( com::sun::star::uno::Any& rVal,
73 : : sal_uInt8 nMemberId = 0 ) const;
74 : : virtual bool PutValue( const com::sun::star::uno::Any& rVal,
75 : : sal_uInt8 nMemberId = 0 );
76 : :
77 : :
78 : 6 : const SwTxtINetFmt* GetTxtINetFmt() const { return pTxtAttr; }
79 : 3757 : SwTxtINetFmt* GetTxtINetFmt() { return pTxtAttr; }
80 : :
81 : 4889 : const String& GetValue() const { return aURL; }
82 : :
83 : 0 : const String& GetName() const { return aName; }
84 : 0 : void SetName( const String& rNm ) { aName = rNm; }
85 : :
86 : 3 : const String& GetTargetFrame() const { return aTargetFrame; }
87 : :
88 : 3760 : const String& GetINetFmt() const { return aINetFmt; }
89 : 0 : void SetINetFmt( const String& rNm ) { aINetFmt = rNm; }
90 : :
91 : 0 : const String& GetVisitedFmt() const { return aVisitedFmt; }
92 : 0 : void SetVisitedFmt( const String& rNm ) { aVisitedFmt = rNm; }
93 : :
94 : 403 : sal_uInt16 GetINetFmtId() const { return nINetId; }
95 : 0 : void SetINetFmtId( sal_uInt16 nNew ) { nINetId = nNew; }
96 : :
97 : 0 : sal_uInt16 GetVisitedFmtId() const { return nVisitedId; }
98 : 0 : void SetVisitedFmtId( sal_uInt16 nNew ) { nVisitedId = nNew; }
99 : :
100 : : // Set a new MacroTable or clear the current one.
101 : : void SetMacroTbl( const SvxMacroTableDtor* pTbl = 0 );
102 : 1001 : const SvxMacroTableDtor* GetMacroTbl() const { return pMacroTbl; }
103 : :
104 : : // Macro getter and setter.
105 : : void SetMacro( sal_uInt16 nEvent, const SvxMacro& rMacro );
106 : : const SvxMacro* GetMacro( sal_uInt16 nEvent ) const;
107 : : };
108 : :
109 : :
110 : : #endif
111 : :
112 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|