Debian Codegraph @

svx/inc/sdr/properties/cellproperties.hxx

raw
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 #pragma once
20
21 #include "textproperties.hxx"
22 #include <svx/itextprovider.hxx>
23 #include <rtl/ref.hxx>
24
25 namespace sdr::table
26 {
27 class Cell;
28 typedef rtl::Reference<sdr::table::Cell> CellRef;
29 }
30
31 namespace sdr::properties
32 {
33 class CellTextProvider final : public svx::ITextProvider
34 {
35 public:
36 explicit CellTextProvider(sdr::table::CellRef xCell);
37 ~CellTextProvider();
38
39 private:
40 virtual sal_Int32 getTextCount() const override;
41 virtual SdrText* getText(sal_Int32 nIndex) const override;
42
43 private:
44 const sdr::table::CellRef m_xCell;
45 };
46
47 class CellProperties final : public TextProperties
48 {
49 protected:
50 // create a new itemset
51 SfxItemSet CreateObjectSpecificItemSet(SfxItemPool& rPool) override;
52
53 const svx::ITextProvider& getTextProvider() const override;
54
55 public:
56 // basic constructor
57 CellProperties(SdrObject& rObj, ::sdr::table::Cell* pCell);
58
59 // constructor for copying, but using new object
60 CellProperties(const CellProperties& rProps, SdrObject& rObj, sdr::table::Cell* pCell);
61 ~CellProperties();
62
63 // Clone() operator, normally just calls the local copy constructor
64 std::unique_ptr<BaseProperties> Clone(SdrObject& rObj) const override;
65
66 void ForceDefaultAttributes() override;
67
68 void ItemSetChanged(std::span<const SfxPoolItem* const> aChangedItems, sal_uInt16 nDeletedWhich,
69 bool bAdjustTextFrameWidthAndHeight = true) override;
70
71 void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = nullptr) override;
72
73 private:
74 sdr::table::CellRef mxCell;
75 const CellTextProvider maTextProvider;
76 };
77
78 } // namespace sdr::properties
79
80 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */