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