Update ooo320-m1
[ooovba.git] / svx / inc / swframeexample.hxx
blob5cace0710e4e5326098e357e9b5e48f617403cb7
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: swframeexample.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SVXSWFRAMEEXAMPLE_HXX
32 #define _SVXSWFRAMEEXAMPLE_HXX
34 #include <vcl/window.hxx>
35 #include <tools/color.hxx>
36 #include <tools/gen.hxx>
37 #include "svx/svxdllapi.h"
39 // class SwFrmPagePreview -------------------------------------------------------
41 class SVX_DLLPUBLIC SvxSwFrameExample : public Window
43 Color m_aTransColor; // transparency
44 Color m_aBgCol; // background
45 Color m_aFrameColor; // graphic frame
46 Color m_aAlignColor; // align anchor
47 Color m_aBorderCol; // frame of doc
48 Color m_aPrintAreaCol; // frame of printable area of doc
49 Color m_aTxtCol; // symbolised text
50 Color m_aBlankCol; // area of symbol for blank
51 Color m_aBlankFrameCol; // frame of symbol for blank
53 Rectangle aPage;
54 Rectangle aPagePrtArea;
55 Rectangle aTextLine;
56 Rectangle aPara;
57 Rectangle aParaPrtArea;
58 Rectangle aFrameAtFrame;
59 Rectangle aDrawObj;
60 Rectangle aAutoCharFrame;
61 Size aFrmSize;
63 short nHAlign;
64 short nHRel;
66 short nVAlign;
67 short nVRel;
69 short nWrap;
70 short nAnchor;
71 BOOL bTrans;
73 Point aRelPos;
75 void InitColors_Impl( void );
76 void InitAllRects_Impl();
77 void CalcBoundRect_Impl(Rectangle &rRect);
78 Rectangle DrawInnerFrame_Impl(const Rectangle &rRect, const Color &rFillColor, const Color &rBorderColor);
80 void DrawRect_Impl(const Rectangle &rRect, const Color &rFillColor, const Color &rLineColor);
81 virtual void Paint(const Rectangle&);
82 protected:
83 virtual void DataChanged( const DataChangedEvent& rDCEvt );
84 public:
86 SvxSwFrameExample(Window* pParent, const ResId& rResID);
87 ~SvxSwFrameExample();
89 inline void SetWrap(USHORT nW) { nWrap = nW; }
91 inline void SetHAlign(short nH) { nHAlign = nH; }
92 inline void SetHoriRel(short nR) { nHRel = nR; }
94 inline void SetVAlign(short nV) { nVAlign = nV; }
95 inline void SetVertRel(short nR) { nVRel = nR; }
97 inline void SetTransparent(BOOL bT) { bTrans = bT; }
98 inline void SetAnchor(short nA) { nAnchor = nA; }
100 void SetRelPos(const Point& rP);
104 #endif // _SVXSWFRAMEEXAMPLE_HXX