StyleManager is a new class responsible to handle document styles. The current implementation has only the responsibility to provide a implementation of StylePreviewReneder, but the idea is to move all style related functionallity to this class (and relieve the SfxObjectShell a bit). CommonStyleMAnager is the common impl. StylePreviewRenderer is responsible to render a preview of a style. As styles can be handled differently by each component it is possible to provide component specific StylePreviewRendered, but currently only the common one is implemented and used by sw. Change-Id: Id271485f571a777a3e94f855d3c614a2efc14628
46 lines
1.3 KiB
C++
46 lines
1.3 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/.
|
|
*/
|
|
|
|
#ifndef INCLUDED_SVX_COMMONSTYLEPREVIEWRENDERER_HXX
|
|
#define INCLUDED_SVX_COMMONSTYLEPREVIEWRENDERER_HXX
|
|
|
|
#include <vcl/outdev.hxx>
|
|
#include <rsc/rscsfx.hxx>
|
|
#include <editeng/svxfont.hxx>
|
|
#include <svx/svxdllapi.h>
|
|
|
|
#include <sfx2/StylePreviewRenderer.hxx>
|
|
|
|
namespace svx
|
|
{
|
|
|
|
class SVX_DLLPUBLIC CommonStylePreviewRenderer : public sfx2::StylePreviewRenderer
|
|
{
|
|
SvxFont maFont;
|
|
Color maFontColor;
|
|
Color maBackgroundColor;
|
|
Size maPixelSize;
|
|
OUString maStyleName;
|
|
|
|
public:
|
|
CommonStylePreviewRenderer(const SfxObjectShell& rShell, OutputDevice& rOutputDev,
|
|
SfxStyleSheetBase* pStyle, long nMaxHeight = 32);
|
|
virtual ~CommonStylePreviewRenderer();
|
|
|
|
virtual bool recalculate() SAL_OVERRIDE;
|
|
virtual Size getRenderSize() SAL_OVERRIDE;
|
|
virtual bool render(const Rectangle& aRectangle) SAL_OVERRIDE;
|
|
};
|
|
|
|
} // end namespace svx
|
|
|
|
#endif // INCLUDED_SVX_COMMONSTYLEPREVIEWRENDERER_HXX
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|