LibreOffice Module svx (master) 1
sdrtableobjimpl.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
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
20#pragma once
21
22#include <sal/config.h>
23
24#include <memory>
25#include <vector>
26
27#include <com/sun/star/container/XIndexAccess.hpp>
28#include <com/sun/star/text/WritingMode.hpp>
29#include <com/sun/star/uno/Reference.hxx>
30#include <com/sun/star/util/XModifyListener.hpp>
32#include <sal/types.h>
33#include <svx/svdotable.hxx>
34#include <svx/svxdllapi.h>
35
36#include <celltypes.hxx>
37
38namespace sdr::table {
39
40class SVXCORE_DLLPUBLIC SdrTableObjImpl : public ::cppu::WeakImplHelper< css::util::XModifyListener >
41{
42public:
46 std::unique_ptr<TableLayouter> mpLayouter;
49 css::uno::Reference< css::container::XIndexAccess > mxTableStyle;
50 std::vector<std::unique_ptr<SdrUndoAction>> maUndos;
52
53 void CropTableModelToSelection(const CellPos& rStart, const CellPos& rEnd);
54
55 CellRef getCell( const CellPos& rPos ) const;
56 void LayoutTable( tools::Rectangle& rArea, bool bFitWidth, bool bFitHeight );
57
58 void ApplyCellStyles();
59 void UpdateCells( tools::Rectangle const & rArea );
60
62 virtual ~SdrTableObjImpl() override;
63
64 void init( SdrTableObj* pTable, sal_Int32 nColumns, sal_Int32 nRows );
65 void dispose();
66
67 sal_Int32 getColumnCount() const;
69 std::vector<sal_Int32> getColumnWidths() const;
70 sal_Int32 getRowCount() const;
71
72 void DragEdge( bool mbHorizontal, int nEdge, sal_Int32 nOffset );
73
74 SdrTableObjImpl& operator=( const SdrTableObjImpl& rSource );
75
76 // XModifyListener
77 virtual void SAL_CALL modified( const css::lang::EventObject& aEvent ) override;
78
79 // XEventListener
80 virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
81
82 void update();
83
84 void connectTableStyle();
85 void disconnectTableStyle();
86 bool isInUse();
87 void dumpAsXml(xmlTextWriterPtr pWriter) const;
88private:
92 static bool lastLayoutFitWidth;
94 static css::text::WritingMode lastLayoutMode;
95 static sal_Int32 lastRowCount;
96 static sal_Int32 lastColCount;
97 static std::vector<sal_Int32> lastColWidths;
98 static bool rowSizeChanged;
99};
100
101}
102
103/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
FILE * init(int, char **)
TableStyleSettings maTableStyle
std::unique_ptr< TableLayouter > mpLayouter
static tools::Rectangle lastLayoutResultRectangle
static css::text::WritingMode lastLayoutMode
static SdrTableObjImpl * lastLayoutTable
static tools::Rectangle lastLayoutInputRectangle
std::vector< std::unique_ptr< SdrUndoAction > > maUndos
css::uno::Reference< css::container::XIndexAccess > mxTableStyle
static std::vector< sal_Int32 > lastColWidths
struct _xmlTextWriter * xmlTextWriterPtr
void dispose()
TableStyleSettings.
Definition: svdotable.hxx:75
#define SVXCORE_DLLPUBLIC
Definition: svxdllapi.h:35
bool update()