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