xref: /aoo42x/main/vcl/inc/salobj.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _SV_SALOBJ_HXX
29 #define _SV_SALOBJ_HXX
30 
31 #include <vcl/sv.h>
32 #include <vcl/dllapi.h>
33 #include <vcl/salgtype.hxx>
34 #include <salwtype.hxx>
35 
36 struct SystemEnvData;
37 
38 // -------------------
39 // - SalObject-Types -
40 // -------------------
41 
42 #define SAL_OBJECT_CLIP_INCLUDERECTS			((sal_uInt16)0x0001)
43 #define SAL_OBJECT_CLIP_EXCLUDERECTS			((sal_uInt16)0x0002)
44 #define SAL_OBJECT_CLIP_ABSOLUTE				((sal_uInt16)0x0004)
45 
46 // -------------
47 // - SalObject -
48 // -------------
49 
50 class VCL_PLUGIN_PUBLIC SalObject
51 {
52     void*				m_pInst;
53     SALOBJECTPROC		m_pCallback;
54     sal_Bool                m_bMouseTransparent:1,
55                         m_bEraseBackground:1;
56 public:
57     SalObject() : m_pInst( NULL ), m_pCallback( NULL ), m_bMouseTransparent( sal_False ), m_bEraseBackground( sal_True ) {}
58     virtual ~SalObject();
59 
60 	virtual void					ResetClipRegion() = 0;
61 	virtual sal_uInt16					GetClipRegionType() = 0;
62 	virtual void					BeginSetClipRegion( sal_uLong nRects ) = 0;
63 	virtual void					UnionClipRegion( long nX, long nY, long nWidth, long nHeight ) = 0;
64 	virtual void					EndSetClipRegion() = 0;
65 
66 	virtual void					SetPosSize( long nX, long nY, long nWidth, long nHeight ) = 0;
67 	virtual void					Show( sal_Bool bVisible ) = 0;
68 	virtual void					Enable( sal_Bool nEnable ) = 0;
69 	virtual void					GrabFocus() = 0;
70 
71 	virtual void					SetBackground() = 0;
72 	virtual void					SetBackground( SalColor nSalColor ) = 0;
73 
74 	virtual const SystemEnvData*	GetSystemData() const = 0;
75 
76     virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept ) = 0;
77 
78 	void					SetCallback( void* pInst, SALOBJECTPROC pProc )
79     { m_pInst = pInst; m_pCallback = pProc; }
80     long					CallCallback( sal_uInt16 nEvent, const void* pEvent )
81     { return m_pCallback ? m_pCallback( m_pInst, this, nEvent, pEvent ) : 0; }
82     void                    SetMouseTransparent( sal_Bool bMouseTransparent )
83     { m_bMouseTransparent = bMouseTransparent; }
84     sal_Bool                    IsMouseTransparent()
85     { return m_bMouseTransparent; }
86     void                    EnableEraseBackground( sal_Bool bEnable )
87     { m_bEraseBackground = bEnable; }
88     sal_Bool                    IsEraseBackgroundEnabled()
89     { return m_bEraseBackground; }
90 };
91 
92 #endif // _SV_SALOBJ_HXX
93