xref: /trunk/main/vcl/inc/salobj.hxx (revision ebfcd9af)
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 _SV_SALOBJ_HXX
25 #define _SV_SALOBJ_HXX
26 
27 #include <vcl/sv.h>
28 #include <vcl/dllapi.h>
29 #include <vcl/salgtype.hxx>
30 #include <salwtype.hxx>
31 
32 struct SystemEnvData;
33 
34 // -------------------
35 // - SalObject-Types -
36 // -------------------
37 
38 #define SAL_OBJECT_CLIP_INCLUDERECTS			((sal_uInt16)0x0001)
39 #define SAL_OBJECT_CLIP_EXCLUDERECTS			((sal_uInt16)0x0002)
40 #define SAL_OBJECT_CLIP_ABSOLUTE				((sal_uInt16)0x0004)
41 
42 // -------------
43 // - SalObject -
44 // -------------
45 
46 class VCL_PLUGIN_PUBLIC SalObject
47 {
48     void*				m_pInst;
49     SALOBJECTPROC		m_pCallback;
50     sal_Bool                m_bMouseTransparent:1,
51                         m_bEraseBackground:1;
52 public:
SalObject()53     SalObject() : m_pInst( NULL ), m_pCallback( NULL ), m_bMouseTransparent( sal_False ), m_bEraseBackground( sal_True ) {}
54     virtual ~SalObject();
55 
56 	virtual void					ResetClipRegion() = 0;
57 	virtual sal_uInt16					GetClipRegionType() = 0;
58 	virtual void					BeginSetClipRegion( sal_uLong nRects ) = 0;
59 	virtual void					UnionClipRegion( long nX, long nY, long nWidth, long nHeight ) = 0;
60 	virtual void					EndSetClipRegion() = 0;
61 
62 	virtual void					SetPosSize( long nX, long nY, long nWidth, long nHeight ) = 0;
63 	virtual void					Show( sal_Bool bVisible ) = 0;
64 	virtual void					Enable( sal_Bool nEnable ) = 0;
65 	virtual void					GrabFocus() = 0;
66 
67 	virtual void					SetBackground() = 0;
68 	virtual void					SetBackground( SalColor nSalColor ) = 0;
69 
70 	virtual const SystemEnvData*	GetSystemData() const = 0;
71 
72     virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept ) = 0;
73 
SetCallback(void * pInst,SALOBJECTPROC pProc)74 	void					SetCallback( void* pInst, SALOBJECTPROC pProc )
75     { m_pInst = pInst; m_pCallback = pProc; }
CallCallback(sal_uInt16 nEvent,const void * pEvent)76     long					CallCallback( sal_uInt16 nEvent, const void* pEvent )
77     { return m_pCallback ? m_pCallback( m_pInst, this, nEvent, pEvent ) : 0; }
SetMouseTransparent(sal_Bool bMouseTransparent)78     void                    SetMouseTransparent( sal_Bool bMouseTransparent )
79     { m_bMouseTransparent = bMouseTransparent; }
IsMouseTransparent()80     sal_Bool                    IsMouseTransparent()
81     { return m_bMouseTransparent; }
EnableEraseBackground(sal_Bool bEnable)82     void                    EnableEraseBackground( sal_Bool bEnable )
83     { m_bEraseBackground = bEnable; }
IsEraseBackgroundEnabled()84     sal_Bool                    IsEraseBackgroundEnabled()
85     { return m_bEraseBackground; }
86 };
87 
88 #endif // _SV_SALOBJ_HXX
89