1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_VCL_INC_SALOBJ_HXX
21 #define INCLUDED_VCL_INC_SALOBJ_HXX
23 #include <tools/solar.h>
24 #include <vcl/dllapi.h>
25 #include <vcl/salgtype.hxx>
26 #include <salwtype.hxx>
32 #define SAL_OBJECT_CLIP_INCLUDERECTS ((sal_uInt16)0x0001)
33 #define SAL_OBJECT_CLIP_EXCLUDERECTS ((sal_uInt16)0x0002)
34 #define SAL_OBJECT_CLIP_ABSOLUTE ((sal_uInt16)0x0004)
36 class VCL_PLUGIN_PUBLIC SalObject
39 SALOBJECTPROC m_pCallback
;
40 bool m_bMouseTransparent
:1,
43 SalObject() : m_pInst( NULL
), m_pCallback( NULL
), m_bMouseTransparent( false ), m_bEraseBackground( true ) {}
46 virtual void ResetClipRegion() = 0;
47 virtual sal_uInt16
GetClipRegionType() = 0;
48 virtual void BeginSetClipRegion( sal_uLong nRects
) = 0;
49 virtual void UnionClipRegion( long nX
, long nY
, long nWidth
, long nHeight
) = 0;
50 virtual void EndSetClipRegion() = 0;
52 virtual void SetPosSize( long nX
, long nY
, long nWidth
, long nHeight
) = 0;
53 virtual void Show( bool bVisible
) = 0;
54 virtual void Enable( bool /* nEnable */ ) {} // overridden by WinSalObject
55 virtual void GrabFocus() {}
57 virtual void SetForwardKey( bool /* bEnable */ ) {}
59 virtual const SystemEnvData
* GetSystemData() const = 0;
61 void SetCallback( void* pInst
, SALOBJECTPROC pProc
)
62 { m_pInst
= pInst
; m_pCallback
= pProc
; }
63 long CallCallback( sal_uInt16 nEvent
, const void* pEvent
)
64 { return m_pCallback
? m_pCallback( m_pInst
, this, nEvent
, pEvent
) : 0; }
66 void SetMouseTransparent( bool bMouseTransparent
)
67 { m_bMouseTransparent
= bMouseTransparent
; }
68 bool IsMouseTransparent()
69 { return m_bMouseTransparent
; }
71 void EnableEraseBackground( bool bEnable
)
72 { m_bEraseBackground
= bEnable
; }
73 bool IsEraseBackgroundEnabled()
74 { return m_bEraseBackground
; }
77 #endif // INCLUDED_VCL_INC_SALOBJ_HXX
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */