LibreOffice Module toolkit (master) 1
tablerenderer.hxx
Go to the documentation of this file.
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
20#pragma once
21
23
24#include <rtl/ustring.hxx>
25
26#include <memory>
27
28namespace com :: sun :: star :: uno { class Any; }
29namespace tools { class Rectangle; }
30namespace vcl { class Window; }
31
32class OutputDevice;
33class StyleSettings;
34namespace vcl {
36};
37
38
39namespace svt::table
40{
41
42
43 //= ITableRenderer
44
48 {
49 public:
50
93 virtual void PaintHeaderArea(
94 vcl::RenderContext& _rDevice, const tools::Rectangle& _rArea,
95 bool _bIsColHeaderArea, bool _bIsRowHeaderArea,
96 const StyleSettings& _rStyle ) = 0;
97
109 virtual void PaintColumnHeader( ColPos _nCol,
110 vcl::RenderContext& _rDevice, const tools::Rectangle& _rArea,
111 const StyleSettings& _rStyle ) = 0;
112
144 virtual void PrepareRow( RowPos _nRow, bool i_hasControlFocus, bool _bSelected,
145 vcl::RenderContext& _rDevice, const tools::Rectangle& _rRowArea,
146 const StyleSettings& _rStyle ) = 0;
147
160 virtual void PaintRowHeader(
161 vcl::RenderContext& _rDevice, tools::Rectangle const & _rArea,
162 StyleSettings const & _rStyle ) = 0;
163
190 virtual void PaintCell( ColPos const i_col,
191 bool i_hasControlFocus, bool _bSelected,
192 vcl::RenderContext& _rDevice, const tools::Rectangle& _rArea,
193 const StyleSettings& _rStyle ) = 0;
194
200 virtual void ShowCellCursor( vcl::Window& _rView, const tools::Rectangle& _rCursorRect) = 0;
201
207 virtual void HideCellCursor( vcl::Window& _rView ) = 0;
208
221 virtual bool FitsIntoCell(
222 css::uno::Any const & i_cellContent,
223 OutputDevice& i_targetDevice, tools::Rectangle const & i_targetArea
224 ) const = 0;
225
236 css::uno::Any const & i_cellValue,
237 OUString & o_cellString
238 ) const = 0;
239
241 virtual ~ITableRenderer() { }
242 };
243 typedef std::shared_ptr< ITableRenderer > PTableRenderer;
244
245
246} // namespace svt::table
247
248
249/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
interface to implement by components rendering a ->TableControl
virtual void PrepareRow(RowPos _nRow, bool i_hasControlFocus, bool _bSelected, vcl::RenderContext &_rDevice, const tools::Rectangle &_rRowArea, const StyleSettings &_rStyle)=0
prepares a row for painting
virtual void ShowCellCursor(vcl::Window &_rView, const tools::Rectangle &_rCursorRect)=0
draws a cell cursor in the given rectangle
virtual void PaintHeaderArea(vcl::RenderContext &_rDevice, const tools::Rectangle &_rArea, bool _bIsColHeaderArea, bool _bIsRowHeaderArea, const StyleSettings &_rStyle)=0
paints a (part of) header area
virtual void PaintRowHeader(vcl::RenderContext &_rDevice, tools::Rectangle const &_rArea, StyleSettings const &_rStyle)=0
paints the header of a row
virtual void PaintColumnHeader(ColPos _nCol, vcl::RenderContext &_rDevice, const tools::Rectangle &_rArea, const StyleSettings &_rStyle)=0
paints the header for a given column
virtual ~ITableRenderer()
deletes the renderer instance
virtual bool FitsIntoCell(css::uno::Any const &i_cellContent, OutputDevice &i_targetDevice, tools::Rectangle const &i_targetArea) const =0
checks whether a given cell content fits into a given target area on a given device.
virtual bool GetFormattedCellString(css::uno::Any const &i_cellValue, OUString &o_cellString) const =0
attempts to format the content of the given cell as string
virtual void HideCellCursor(vcl::Window &_rView)=0
hides the cell cursor previously drawn into the given rectangle
virtual void PaintCell(ColPos const i_col, bool i_hasControlFocus, bool _bSelected, vcl::RenderContext &_rDevice, const tools::Rectangle &_rArea, const StyleSettings &_rStyle)=0
paints a certain cell
sal_Int32 RowPos
a value denoting a row position within a table
Definition: tabletypes.hxx:34
std::shared_ptr< ITableRenderer > PTableRenderer
sal_Int32 ColPos
a value denoting a column position within a table
Definition: tabletypes.hxx:32
OutputDevice RenderContext
#define SAL_NO_VTABLE