LibreOffice Module svx (master) 1
SmartTagItem.cxx
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
21#include <svx/SmartTagItem.hxx>
22#include <sal/log.hxx>
23
24#include <com/sun/star/container/XStringKeyMap.hpp>
25#include <utility>
26
27
28using namespace ::com::sun::star;
29
30
31SfxPoolItem* SvxSmartTagItem::CreateDefault() { SAL_WARN( "svx", "No SvxSmartTagItem factory available"); return nullptr; }
32
34 const css::uno::Sequence < css::uno::Sequence< css::uno::Reference< css::smarttags::XSmartTagAction > > >& rActionComponentsSequence,
35 const css::uno::Sequence < css::uno::Sequence< sal_Int32 > >& rActionIndicesSequence,
36 const css::uno::Sequence< css::uno::Reference< css::container::XStringKeyMap > >& rStringKeyMaps,
37 css::uno::Reference<css::text::XTextRange> xRange,
38 css::uno::Reference<css::frame::XController> xController,
39 css::lang::Locale aLocale,
40 OUString aApplicationName,
41 OUString aRangeText ) :
43 maActionComponentsSequence( rActionComponentsSequence ),
44 maActionIndicesSequence( rActionIndicesSequence ),
45 maStringKeyMaps( rStringKeyMaps ),
46 mxRange(std::move( xRange )),
47 mxController(std::move( xController )),
48 maLocale(std::move( aLocale )),
49 maApplicationName(std::move( aApplicationName )),
50 maRangeText(std::move( aRangeText ))
51{
52}
53
54
55bool SvxSmartTagItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
56{
58 { "ActionComponents", css::uno::Any( maActionComponentsSequence ) },
59 { "ActionIndices", css::uno::Any( maActionIndicesSequence ) },
60 { "StringKeyMaps", css::uno::Any( maStringKeyMaps ) },
61 { "TextRange", css::uno::Any( mxRange ) },
62 { "Controller", css::uno::Any( mxController ) },
63 { "Locale", css::uno::Any( maLocale ) },
64 { "ApplicationName", css::uno::Any( maApplicationName ) },
65 { "RangeText", css::uno::Any( maRangeText ) },
66 } );
67 return true;
68}
69
70bool SvxSmartTagItem::PutValue( const uno::Any& /*rVal*/, sal_uInt8 /* nMemberId */)
71{
72 return false;
73}
74
75
76bool SvxSmartTagItem::operator==( const SfxPoolItem& rAttr ) const
77{
78 assert(SfxPoolItem::operator==(rAttr));
79
80 const SvxSmartTagItem& rItem = static_cast<const SvxSmartTagItem&>(rAttr);
81
85 mxRange == rItem.mxRange &&
86 mxController == rItem.mxController &&
88 maRangeText == rItem.maRangeText;
89}
90
91
93{
94 return new SvxSmartTagItem( *this );
95}
96
97/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const css::lang::Locale maLocale
const css::uno::Sequence< css::uno::Sequence< css::uno::Reference< css::smarttags::XSmartTagAction > > > maActionComponentsSequence
const css::uno::Sequence< css::uno::Reference< css::container::XStringKeyMap > > maStringKeyMaps
static SfxPoolItem * CreateDefault()
const css::uno::Reference< css::text::XTextRange > mxRange
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
virtual SvxSmartTagItem * Clone(SfxItemPool *pPool=nullptr) const override
const css::uno::Sequence< css::uno::Sequence< sal_Int32 > > maActionIndicesSequence
const css::uno::Reference< css::frame::XController > mxController
const OUString maRangeText
const OUString maApplicationName
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
SvxSmartTagItem(const TypedWhichId< SvxSmartTagItem > nId, const css::uno::Sequence< css::uno::Sequence< css::uno::Reference< css::smarttags::XSmartTagAction > > > &rActionComponentsSequence, const css::uno::Sequence< css::uno::Sequence< sal_Int32 > > &rActionIndicesSequence, const css::uno::Sequence< css::uno::Reference< css::container::XStringKeyMap > > &rStringKeyMaps, css::uno::Reference< css::text::XTextRange > xRange, css::uno::Reference< css::frame::XController > xController, css::lang::Locale aLocale, OUString aApplicationName, OUString aRangeText)
virtual bool operator==(const SfxPoolItem &) const override
#define SAL_WARN(area, stream)
css::uno::Sequence< css::beans::PropertyValue > InitPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
sal_Int16 nId
Reference< XController > xController
unsigned char sal_uInt8