Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sw / source / core / inc / cellfrm.hxx
blob796cb1d3dfb31e9bcaee3346163b35aa31b4ce74
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 .
20 #ifndef INCLUDED_SW_SOURCE_CORE_INC_CELLFRM_HXX
21 #define INCLUDED_SW_SOURCE_CORE_INC_CELLFRM_HXX
23 #include "layfrm.hxx"
25 class SwTableBox;
26 struct SwCursorMoveState;
27 class SwBorderAttrs;
29 /// SwCellFrame is one table cell in the document layout.
30 class SW_DLLPUBLIC SwCellFrame final : public SwLayoutFrame
32 const SwTableBox* m_pTabBox;
34 virtual void DestroyImpl() override;
35 virtual ~SwCellFrame() override;
37 virtual void Format( vcl::RenderContext* pRenderContext, const SwBorderAttrs *pAttrs = nullptr ) override;
38 virtual void SwClientNotify(const SwModify&, const SfxHint&) override;
39 virtual const SwCellFrame* DynCastCellFrame() const override { return this; }
41 public:
42 SwCellFrame( const SwTableBox &, SwFrame*, bool bInsertContent );
44 virtual bool GetModelPositionForViewPoint( SwPosition *, Point&, SwCursorMoveState* = nullptr, bool bTestBackground = false ) const override;
45 virtual void PaintSwFrame( vcl::RenderContext& rRenderContext, SwRect const&,
46 SwPrintData const*const pPrintData = nullptr ) const override;
47 virtual void CheckDirection( bool bVert ) override;
49 // #i103961#
50 virtual void Cut() override;
52 const SwTableBox *GetTabBox() const { return m_pTabBox; }
54 // used for breaking table rows:
55 SwCellFrame* GetFollowCell() const;
56 SwCellFrame* GetPreviousCell() const;
58 virtual bool IsLeaveUpperAllowed() const override;
59 virtual bool IsCoveredCell() const override;
61 // used for rowspan stuff:
62 const SwCellFrame& FindStartEndOfRowSpanCell( bool bStart ) const;
63 tools::Long GetLayoutRowSpan() const;
65 /// If this is a vertically merged cell, then looks up its covered cell in rRow.
66 const SwCellFrame* GetCoveredCellInRow(const SwRowFrame& rRow) const;
68 /// If this is a vertically merged cell, then looks up its covered cells.
69 std::vector<const SwCellFrame*> GetCoveredCells() const;
71 void dumpAsXmlAttributes(xmlTextWriterPtr writer) const override;
73 void dumpAsXml(xmlTextWriterPtr writer = nullptr) const override;
76 #endif
78 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */