Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / include / sfx2 / StylePreviewRenderer.hxx
blob971ce01b0d8b7d0af620b8d919eee837f6d121aa
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/.
8 */
10 #ifndef INCLUDED_SFX2_STYLEPREVIEWRENDERER_HXX
11 #define INCLUDED_SFX2_STYLEPREVIEWRENDERER_HXX
13 #include <sfx2/dllapi.h>
14 #include <vcl/outdev.hxx>
15 #include <rsc/rscsfx.hxx>
16 #include <svl/style.hxx>
17 #include <sfx2/objsh.hxx>
19 namespace sfx2
22 class SFX2_DLLPUBLIC StylePreviewRenderer
24 protected:
25 const SfxObjectShell& mrShell;
26 OutputDevice& mrOutputDev;
27 SfxStyleSheetBase* mpStyle;
28 long mnMaxHeight;
29 OUString msRenderText;
31 public:
32 enum class RenderAlign
34 TOP, CENTER, BOTTOM
37 StylePreviewRenderer(const SfxObjectShell& rShell,
38 OutputDevice& rOutputDev,
39 SfxStyleSheetBase* pStyle,
40 long nMaxHeight = 32)
41 : mrShell(rShell)
42 , mrOutputDev(rOutputDev)
43 , mpStyle(pStyle)
44 , mnMaxHeight(nMaxHeight)
45 , msRenderText()
48 virtual ~StylePreviewRenderer()
51 virtual bool recalculate() = 0;
52 virtual Size getRenderSize() = 0;
53 virtual bool render(const Rectangle& aRectangle, RenderAlign eRenderAlign = RenderAlign::CENTER) = 0;
56 } // end namespace sfx2
58 #endif // INCLUDED_SVX_STYLEPREVIEWRENDERER_HXX
60 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */