1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
21 #include "textproperties.hxx"
22 #include <svx/itextprovider.hxx>
23 #include <rtl/ref.hxx>
28 typedef rtl::Reference
<sdr::table::Cell
> CellRef
;
31 namespace sdr::properties
33 class CellTextProvider
: public svx::ITextProvider
36 explicit CellTextProvider(sdr::table::CellRef xCell
);
37 virtual ~CellTextProvider();
40 virtual sal_Int32
getTextCount() const override
;
41 virtual SdrText
* getText(sal_Int32 nIndex
) const override
;
44 const sdr::table::CellRef m_xCell
;
47 class CellProperties
: public TextProperties
50 // create a new itemset
51 SfxItemSet
CreateObjectSpecificItemSet(SfxItemPool
& rPool
) override
;
53 const svx::ITextProvider
& getTextProvider() const override
;
57 CellProperties(SdrObject
& rObj
, ::sdr::table::Cell
* pCell
);
59 // constructor for copying, but using new object
60 CellProperties(const CellProperties
& rProps
, SdrObject
& rObj
, sdr::table::Cell
* pCell
);
63 // Clone() operator, normally just calls the local copy constructor
64 std::unique_ptr
<BaseProperties
> Clone(SdrObject
& rObj
) const override
;
66 void ForceDefaultAttributes() override
;
68 void ItemSetChanged(o3tl::span
<const SfxPoolItem
* const> aChangedItems
,
69 sal_uInt16 nDeletedWhich
) override
;
71 void ItemChange(const sal_uInt16 nWhich
, const SfxPoolItem
* pNewItem
= nullptr) override
;
73 sdr::table::CellRef mxCell
;
76 const CellTextProvider maTextProvider
;
79 } // namespace sdr::properties
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */