xref: /aoo42x/main/svx/source/items/SmartTagItem.cxx (revision f6e50924)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_svx.hxx"
26 
27 // include ---------------------------------------------------------------
28 
29 #include <svx/SmartTagItem.hxx>
30 
31 #ifndef _COM_SUN_STAR_SMARTTAGS_XSMARTTAGPROPERTIES_HPP_
32 #include <com/sun/star/container/XStringKeyMap.hpp>
33 #endif
34 
35 
36 //#include <svl/memberid.hrc>
37 //#include "svxids.hrc"
38 //#include "svxitems.hrc"
39 
40 using namespace ::com::sun::star;
41 
42 TYPEINIT1(SvxSmartTagItem, SfxPoolItem);
43 
44 // class SvxFontItem -----------------------------------------------------
45 
SvxSmartTagItem(const sal_uInt16 nId,const com::sun::star::uno::Sequence<com::sun::star::uno::Sequence<com::sun::star::uno::Reference<com::sun::star::smarttags::XSmartTagAction>>> & rActionComponentsSequence,const com::sun::star::uno::Sequence<com::sun::star::uno::Sequence<sal_Int32>> & rActionIndicesSequence,const com::sun::star::uno::Sequence<com::sun::star::uno::Reference<com::sun::star::container::XStringKeyMap>> & rStringKeyMaps,const com::sun::star::uno::Reference<com::sun::star::text::XTextRange> rRange,const com::sun::star::uno::Reference<com::sun::star::frame::XController> rController,const com::sun::star::lang::Locale rLocale,const rtl::OUString & rApplicationName,const rtl::OUString & rRangeText)46 SvxSmartTagItem::SvxSmartTagItem( const sal_uInt16 nId,
47                                   const com::sun::star::uno::Sequence < com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::smarttags::XSmartTagAction > > >& rActionComponentsSequence,
48                                   const com::sun::star::uno::Sequence < com::sun::star::uno::Sequence< sal_Int32 > >& rActionIndicesSequence,
49                                   const com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::container::XStringKeyMap > >& rStringKeyMaps,
50                                   const com::sun::star::uno::Reference<com::sun::star::text::XTextRange> rRange,
51                                   const com::sun::star::uno::Reference<com::sun::star::frame::XController> rController,
52                                   const com::sun::star::lang::Locale rLocale,
53                                   const rtl::OUString& rApplicationName,
54                                   const rtl::OUString& rRangeText ) :
55 	SfxPoolItem( nId ),
56     maActionComponentsSequence( rActionComponentsSequence ),
57     maActionIndicesSequence( rActionIndicesSequence ),
58     maStringKeyMaps( rStringKeyMaps ),
59     mxRange( rRange ),
60     mxController( rController ),
61     maLocale( rLocale ),
62     maApplicationName( rApplicationName ),
63     maRangeText( rRangeText )
64 {
65 }
66 
67 // -----------------------------------------------------------------------
68 
69 // -----------------------------------------------------------------------
70 
QueryValue(uno::Any &,sal_uInt8) const71 sal_Bool SvxSmartTagItem::QueryValue( uno::Any& /* rVal */, sal_uInt8 /* nMemberId */ ) const
72 {
73     return sal_False;
74 }
75 // -----------------------------------------------------------------------
PutValue(const uno::Any &,sal_uInt8)76 sal_Bool SvxSmartTagItem::PutValue( const uno::Any& /*rVal*/, sal_uInt8 /* nMemberId */)
77 {
78     return sal_False;
79 }
80 
81 // -----------------------------------------------------------------------
82 
operator ==(const SfxPoolItem & rAttr) const83 int SvxSmartTagItem::operator==( const SfxPoolItem& rAttr ) const
84 {
85 	DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" );
86 
87 	const SvxSmartTagItem& rItem = static_cast<const SvxSmartTagItem&>(rAttr);
88 
89     int bRet = maActionComponentsSequence == rItem.maActionComponentsSequence &&
90                maActionIndicesSequence == rItem.maActionIndicesSequence &&
91                maStringKeyMaps == rItem.maStringKeyMaps &&
92                mxRange == rItem.mxRange &&
93                mxController == rItem.mxController &&
94                maApplicationName == rItem.maApplicationName &&
95                maRangeText == rItem.maRangeText;
96 
97 	return bRet;
98 }
99 
100 // -----------------------------------------------------------------------
101 
Clone(SfxItemPool *) const102 SfxPoolItem* SvxSmartTagItem::Clone( SfxItemPool * ) const
103 {
104 	return new SvxSmartTagItem( *this );
105 }
106 
107 // -----------------------------------------------------------------------
108 
Store(SvStream & rStream,sal_uInt16) const109 SvStream& SvxSmartTagItem::Store( SvStream& rStream, sal_uInt16 /*nItemVersion*/ ) const
110 {
111     return rStream;
112 }
113 
114 // -----------------------------------------------------------------------
115 
Create(SvStream &,sal_uInt16) const116 SfxPoolItem* SvxSmartTagItem::Create(SvStream& , sal_uInt16) const
117 {
118     return 0;
119 }
120