Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / svx / inc / sdr / properties / cellproperties.hxx
blobce8dd062bb66d265788aa0a86683a7a589d85e01
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
19 #pragma once
21 #include "textproperties.hxx"
22 #include <svx/itextprovider.hxx>
23 #include <rtl/ref.hxx>
25 namespace sdr::table
27 class Cell;
28 typedef rtl::Reference<sdr::table::Cell> CellRef;
31 namespace sdr::properties
33 class CellTextProvider : public svx::ITextProvider
35 public:
36 explicit CellTextProvider(sdr::table::CellRef xCell);
37 virtual ~CellTextProvider();
39 private:
40 virtual sal_Int32 getTextCount() const override;
41 virtual SdrText* getText(sal_Int32 nIndex) const override;
43 private:
44 const sdr::table::CellRef m_xCell;
47 class CellProperties : public TextProperties
49 protected:
50 // create a new itemset
51 SfxItemSet CreateObjectSpecificItemSet(SfxItemPool& rPool) override;
53 const svx::ITextProvider& getTextProvider() const override;
55 public:
56 // basic constructor
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);
61 ~CellProperties();
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;
75 private:
76 const CellTextProvider maTextProvider;
79 } // namespace sdr::properties
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */