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 <vcl/dllapi.h>
24 #include <com/sun/star/uno/Sequence.hxx>
25 #include "salwtype.hxx"
29 class VCL_PLUGIN_PUBLIC SalObject
32 SALOBJECTPROC m_pCallback
;
33 bool m_bMouseTransparent
:1,
36 SalObject() : m_pInst( nullptr ), m_pCallback( nullptr ), m_bMouseTransparent( false ), m_bEraseBackground( true ) {}
39 virtual void ResetClipRegion() = 0;
40 virtual void BeginSetClipRegion( sal_uLong nRects
) = 0;
41 virtual void UnionClipRegion( long nX
, long nY
, long nWidth
, long nHeight
) = 0;
42 virtual void EndSetClipRegion() = 0;
44 virtual void SetPosSize( long nX
, long nY
, long nWidth
, long nHeight
) = 0;
45 virtual void Show( bool bVisible
) = 0;
46 virtual void Enable( bool /* nEnable */ ) {} // overridden by WinSalObject
47 virtual void GrabFocus() {}
49 virtual void SetForwardKey( bool /* bEnable */ ) {}
51 virtual void SetLeaveEnterBackgrounds(const css::uno::Sequence
<css::uno::Any
>& /*rLeaveArgs*/, const css::uno::Sequence
<css::uno::Any
>& /*rEnterArgs*/) {}
53 virtual const SystemEnvData
* GetSystemData() const = 0;
55 void SetCallback( void* pInst
, SALOBJECTPROC pProc
)
56 { m_pInst
= pInst
; m_pCallback
= pProc
; }
57 void CallCallback( SalObjEvent nEvent
)
58 { if (m_pCallback
) m_pCallback( m_pInst
, nEvent
); }
60 void SetMouseTransparent( bool bMouseTransparent
)
61 { m_bMouseTransparent
= bMouseTransparent
; }
62 bool IsMouseTransparent()
63 { return m_bMouseTransparent
; }
65 void EnableEraseBackground( bool bEnable
)
66 { m_bEraseBackground
= bEnable
; }
67 bool IsEraseBackgroundEnabled()
68 { return m_bEraseBackground
; }
71 #endif // INCLUDED_VCL_INC_SALOBJ_HXX
73 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */