tdf#124953: Use rangelist's combined range top-left address...
[LibreOffice.git] / include / svx / swframeexample.hxx
blob0437831781ca7c53f4ed84a57395b2b7b55ce17d
1 /*
2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_SVX_SWFRAMEEXAMPLE_HXX
20 #define INCLUDED_SVX_SWFRAMEEXAMPLE_HXX
22 #include <tools/color.hxx>
23 #include <tools/gen.hxx>
24 #include <svx/svxdllapi.h>
25 #include <svx/swframetypes.hxx>
26 #include <vcl/customweld.hxx>
27 #include <vcl/window.hxx>
28 #include <com/sun/star/text/WrapTextMode.hpp>
30 class SVX_DLLPUBLIC SwFrameExample : public weld::CustomWidgetController
32 Color m_aTransColor; ///< transparency
33 Color m_aBgCol; ///< background
34 Color m_aFrameColor; ///< graphic frame
35 Color m_aAlignColor; ///< align anchor
36 Color m_aBorderCol; ///< frame of doc
37 Color m_aPrintAreaCol; ///< frame of printable area of doc
38 Color m_aTxtCol; ///< symbolised text
39 Color m_aBlankCol; ///< area of symbol for blank
40 Color m_aBlankFrameCol; ///< frame of symbol for blank
42 tools::Rectangle aPage;
43 tools::Rectangle aPagePrtArea;
44 tools::Rectangle aTextLine;
45 tools::Rectangle aPara;
46 tools::Rectangle aParaPrtArea;
47 tools::Rectangle aFrameAtFrame;
48 tools::Rectangle aDrawObj;
49 tools::Rectangle aAutoCharFrame;
50 Size aFrmSize;
52 short nHAlign;
53 short nHRel;
55 short nVAlign;
56 short nVRel;
58 css::text::WrapTextMode nWrap;
59 RndStdIds nAnchor;
60 bool bTrans;
62 Point aRelPos;
64 void InitColors_Impl();
65 void InitAllRects_Impl(vcl::RenderContext& rRenderContext);
66 void CalcBoundRect_Impl(const vcl::RenderContext& rRenderContext, tools::Rectangle &rRect);
67 tools::Rectangle DrawInnerFrame_Impl(vcl::RenderContext& rRenderContext, const tools::Rectangle &rRect, const Color &rFillColor, const Color &rBorderColor);
69 virtual void StyleUpdated() override;
70 virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) override;
71 public:
73 SwFrameExample();
75 virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
77 void SetWrap(css::text::WrapTextMode nW) { nWrap = nW; }
79 void SetHAlign(short nH) { nHAlign = nH; }
80 void SetHoriRel(short nR) { nHRel = nR; }
82 void SetVAlign(short nV) { nVAlign = nV; }
83 void SetVertRel(short nR) { nVRel = nR; }
85 void SetTransparent(bool bT) { bTrans = bT; }
86 void SetAnchor(RndStdIds nA) { nAnchor = nA; }
88 void SetRelPos(const Point& rP);
93 #endif // INCLUDED_SVX_SWFRAMEEXAMPLE_HXX
95 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */