Files
loongoffice/include/svtools/table/gridtablerenderer.hxx
Bjoern Michaelsen b9337e22ce execute move of global headers
see https://gerrit.libreoffice.org/#/c/3367/
and Change-Id: I00c96fa77d04b33a6f8c8cd3490dfcd9bdc9e84a for details

Change-Id: I199a75bc4042af20817265d5ef85b1134a96ff5a
2013-04-23 22:20:31 +02:00

122 lines
5.2 KiB
C++

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef SVTOOLS_INC_TABLE_GRIDTABLERENDERER_HXX
#define SVTOOLS_INC_TABLE_GRIDTABLERENDERER_HXX
#include <svtools/table/tablemodel.hxx>
#include <boost/scoped_ptr.hpp>
//........................................................................
namespace svt { namespace table
{
//........................................................................
struct GridTableRenderer_Impl;
//====================================================================
//= GridTableRenderer
//====================================================================
/** a default implementation for the ->ITableRenderer interface
This class is able to paint a table grid, table headers, and cell
backgrounds according to the selected/active state of cells.
*/
class GridTableRenderer : public ITableRenderer
{
private:
::boost::scoped_ptr< GridTableRenderer_Impl > m_pImpl;
public:
/** creates a table renderer associated with the given model
@param _rModel
the model which should be rendered. The caller is responsible
for lifetime control, that is, the model instance must live
at least as long as the renderer instance lives
*/
GridTableRenderer( ITableModel& _rModel );
~GridTableRenderer();
/** determines whether or not to paint grid lines
*/
bool useGridLines() const;
/** controls whether or not to paint grid lines
*/
void useGridLines( bool const i_use );
public:
// ITableRenderer overridables
virtual void PaintHeaderArea(
OutputDevice& _rDevice, const Rectangle& _rArea,
bool _bIsColHeaderArea, bool _bIsRowHeaderArea,
const StyleSettings& _rStyle );
virtual void PaintColumnHeader( ColPos _nCol, bool _bActive, bool _bSelected,
OutputDevice& _rDevice, const Rectangle& _rArea,
const StyleSettings& _rStyle );
virtual void PrepareRow( RowPos _nRow, bool i_hasControlFocus, bool _bSelected,
OutputDevice& _rDevice, const Rectangle& _rRowArea,
const StyleSettings& _rStyle );
virtual void PaintRowHeader(
bool i_hasControlFocus, bool _bSelected,
OutputDevice& _rDevice, const Rectangle& _rArea,
const StyleSettings& _rStyle );
virtual void PaintCell( ColPos const i_col,
bool i_hasControlFocus, bool _bSelected,
OutputDevice& _rDevice, const Rectangle& _rArea,
const StyleSettings& _rStyle );
virtual void ShowCellCursor( Window& _rView, const Rectangle& _rCursorRect);
virtual void HideCellCursor( Window& _rView, const Rectangle& _rCursorRect);
virtual bool FitsIntoCell(
::com::sun::star::uno::Any const & i_cellContent,
ColPos const i_colPos, RowPos const i_rowPos,
bool const i_active, bool const i_selected,
OutputDevice& i_targetDevice, Rectangle const & i_targetArea
) const;
virtual bool GetFormattedCellString(
::com::sun::star::uno::Any const & i_cellValue,
ColPos const i_colPos, RowPos const i_rowPos,
OUString & o_cellString
) const;
private:
struct CellRenderContext;
void impl_paintCellContent(
CellRenderContext const & i_context
);
void impl_paintCellImage(
CellRenderContext const & i_context,
Image const & i_image
);
void impl_paintCellText(
CellRenderContext const & i_context,
OUString const & i_text
);
};
//........................................................................
} } // namespace svt::table
//........................................................................
#endif // SVTOOLS_INC_TABLE_GRIDTABLERENDERER_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */