xref: /aoo41x/main/svx/inc/svx/swframeexample.hxx (revision 3334a7e6)
1*3334a7e6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*3334a7e6SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*3334a7e6SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*3334a7e6SAndrew Rist  * distributed with this work for additional information
6*3334a7e6SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*3334a7e6SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*3334a7e6SAndrew Rist  * "License"); you may not use this file except in compliance
9*3334a7e6SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*3334a7e6SAndrew Rist  *
11*3334a7e6SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*3334a7e6SAndrew Rist  *
13*3334a7e6SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*3334a7e6SAndrew Rist  * software distributed under the License is distributed on an
15*3334a7e6SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*3334a7e6SAndrew Rist  * KIND, either express or implied.  See the License for the
17*3334a7e6SAndrew Rist  * specific language governing permissions and limitations
18*3334a7e6SAndrew Rist  * under the License.
19*3334a7e6SAndrew Rist  *
20*3334a7e6SAndrew Rist  *************************************************************/
21*3334a7e6SAndrew Rist 
22*3334a7e6SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SVXSWFRAMEEXAMPLE_HXX
25cdf0e10cSrcweir #define _SVXSWFRAMEEXAMPLE_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <vcl/window.hxx>
28cdf0e10cSrcweir #include <tools/color.hxx>
29cdf0e10cSrcweir #include <tools/gen.hxx>
30cdf0e10cSrcweir #include "svx/svxdllapi.h"
31cdf0e10cSrcweir 
32cdf0e10cSrcweir // class SwFrmPagePreview -------------------------------------------------------
33cdf0e10cSrcweir 
34cdf0e10cSrcweir class SVX_DLLPUBLIC SvxSwFrameExample : public Window
35cdf0e10cSrcweir {
36cdf0e10cSrcweir 	Color		m_aTransColor;		// transparency
37cdf0e10cSrcweir 	Color		m_aBgCol;			// background
38cdf0e10cSrcweir 	Color		m_aFrameColor;		// graphic frame
39cdf0e10cSrcweir 	Color     	m_aAlignColor;		// align anchor
40cdf0e10cSrcweir 	Color		m_aBorderCol;		// frame of doc
41cdf0e10cSrcweir 	Color		m_aPrintAreaCol;	// frame of printable area of doc
42cdf0e10cSrcweir 	Color		m_aTxtCol;			// symbolised text
43cdf0e10cSrcweir 	Color		m_aBlankCol;		// area of symbol for blank
44cdf0e10cSrcweir 	Color		m_aBlankFrameCol;	// frame of symbol for blank
45cdf0e10cSrcweir 
46cdf0e10cSrcweir 	Rectangle 	aPage;
47cdf0e10cSrcweir 	Rectangle 	aPagePrtArea;
48cdf0e10cSrcweir 	Rectangle 	aTextLine;
49cdf0e10cSrcweir 	Rectangle 	aPara;
50cdf0e10cSrcweir 	Rectangle 	aParaPrtArea;
51cdf0e10cSrcweir 	Rectangle 	aFrameAtFrame;
52cdf0e10cSrcweir 	Rectangle 	aDrawObj;
53cdf0e10cSrcweir 	Rectangle 	aAutoCharFrame;
54cdf0e10cSrcweir 	Size      	aFrmSize;
55cdf0e10cSrcweir 
56cdf0e10cSrcweir     short       nHAlign;
57cdf0e10cSrcweir     short       nHRel;
58cdf0e10cSrcweir 
59cdf0e10cSrcweir     short       nVAlign;
60cdf0e10cSrcweir     short       nVRel;
61cdf0e10cSrcweir 
62cdf0e10cSrcweir     short       nWrap;
63cdf0e10cSrcweir     short       nAnchor;
64cdf0e10cSrcweir 	sal_Bool 		bTrans;
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 	Point		aRelPos;
67cdf0e10cSrcweir 
68cdf0e10cSrcweir     void InitColors_Impl( void );
69cdf0e10cSrcweir     void InitAllRects_Impl();
70cdf0e10cSrcweir     void CalcBoundRect_Impl(Rectangle &rRect);
71cdf0e10cSrcweir     Rectangle DrawInnerFrame_Impl(const Rectangle &rRect, const Color &rFillColor, const Color &rBorderColor);
72cdf0e10cSrcweir 
73cdf0e10cSrcweir     void DrawRect_Impl(const Rectangle &rRect, const Color &rFillColor, const Color &rLineColor);
74cdf0e10cSrcweir     virtual void Paint(const Rectangle&);
75cdf0e10cSrcweir protected:
76cdf0e10cSrcweir 	virtual void DataChanged( const DataChangedEvent& rDCEvt );
77cdf0e10cSrcweir public:
78cdf0e10cSrcweir 
79cdf0e10cSrcweir     SvxSwFrameExample(Window* pParent, const ResId& rResID);
80cdf0e10cSrcweir     ~SvxSwFrameExample();
81cdf0e10cSrcweir 
SetWrap(sal_uInt16 nW)82cdf0e10cSrcweir 	inline void SetWrap(sal_uInt16 nW) 			{ nWrap 	= nW; }
83cdf0e10cSrcweir 
SetHAlign(short nH)84cdf0e10cSrcweir     inline void SetHAlign(short nH)      { nHAlign   = nH; }
SetHoriRel(short nR)85cdf0e10cSrcweir     inline void SetHoriRel(short nR)         { nHRel     = nR; }
86cdf0e10cSrcweir 
SetVAlign(short nV)87cdf0e10cSrcweir     inline void SetVAlign(short nV)      { nVAlign   = nV; }
SetVertRel(short nR)88cdf0e10cSrcweir     inline void SetVertRel(short nR)         { nVRel     = nR; }
89cdf0e10cSrcweir 
SetTransparent(sal_Bool bT)90cdf0e10cSrcweir 	inline void SetTransparent(sal_Bool bT)		{ bTrans 	= bT; }
SetAnchor(short nA)91cdf0e10cSrcweir     inline void SetAnchor(short nA)          { nAnchor   = nA; }
92cdf0e10cSrcweir 
93cdf0e10cSrcweir     void SetRelPos(const Point& rP);
94cdf0e10cSrcweir };
95cdf0e10cSrcweir 
96cdf0e10cSrcweir 
97cdf0e10cSrcweir #endif // _SVXSWFRAMEEXAMPLE_HXX
98