LibreOffice Module vcl (master)  1
salobj.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_VCL_INC_SALOBJ_HXX
21 #define INCLUDED_VCL_INC_SALOBJ_HXX
22 
23 #include <vcl/dllapi.h>
24 #include <vcl/syschild.hxx>
25 #include <com/sun/star/uno/Sequence.hxx>
26 #include "salwtype.hxx"
27 
28 struct SystemEnvData;
29 
30 typedef void (*SALOBJECTPROC)(SystemChildWindow* pInst, SalObjEvent nEvent);
31 
33 {
36  bool m_bMouseTransparent:1,
37  m_bEraseBackground:1;
38 public:
39  SalObject() : m_pInst( nullptr ), m_pCallback( nullptr ), m_bMouseTransparent( false ), m_bEraseBackground( true ) {}
40  virtual ~SalObject();
41 
42  virtual void ResetClipRegion() = 0;
43  virtual void BeginSetClipRegion( sal_uInt32 nRects ) = 0;
44  virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ) = 0;
45  virtual void EndSetClipRegion() = 0;
46 
47  virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight ) = 0;
48  virtual void Show( bool bVisible ) = 0;
49  virtual void Enable( bool /* nEnable */ ) {} // overridden by WinSalObject
50  virtual void GrabFocus() {}
51 
52  virtual void SetForwardKey( bool /* bEnable */ ) {}
53 
54  virtual void SetLeaveEnterBackgrounds(const css::uno::Sequence<css::uno::Any>& /*rLeaveArgs*/, const css::uno::Sequence<css::uno::Any>& /*rEnterArgs*/) {}
55 
56  virtual const SystemEnvData* GetSystemData() const = 0;
57 
59  { m_pInst = pInst; m_pCallback = pProc; }
60  void CallCallback( SalObjEvent nEvent )
61  { if (m_pCallback) m_pCallback( m_pInst, nEvent ); }
62 
63  void SetMouseTransparent( bool bMouseTransparent )
64  { m_bMouseTransparent = bMouseTransparent; }
65  bool IsMouseTransparent() const
66  { return m_bMouseTransparent; }
67 
68  void EnableEraseBackground( bool bEnable )
69  { m_bEraseBackground = bEnable; }
71  { return m_bEraseBackground; }
72 };
73 
74 #endif // INCLUDED_VCL_INC_SALOBJ_HXX
75 
76 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SALOBJECTPROC m_pCallback
Definition: salobj.hxx:35
bool IsMouseTransparent() const
Definition: salobj.hxx:65
SalObject()
Definition: salobj.hxx:39
virtual void GrabFocus()
Definition: salobj.hxx:50
void(* SALOBJECTPROC)(SystemChildWindow *pInst, SalObjEvent nEvent)
Definition: salobj.hxx:30
void CallCallback(SalObjEvent nEvent)
Definition: salobj.hxx:60
virtual void Enable(bool)
Definition: salobj.hxx:49
VclPtr< SystemChildWindow > m_pInst
Definition: salobj.hxx:34
SalObjEvent
Definition: salwtype.hxx:221
void SetMouseTransparent(bool bMouseTransparent)
Definition: salobj.hxx:63
#define VCL_PLUGIN_PUBLIC
Definition: dllapi.h:40
bool IsEraseBackgroundEnabled() const
Definition: salobj.hxx:70
virtual void SetLeaveEnterBackgrounds(const css::uno::Sequence< css::uno::Any > &, const css::uno::Sequence< css::uno::Any > &)
Definition: salobj.hxx:54
void SetCallback(SystemChildWindow *pInst, SALOBJECTPROC pProc)
Definition: salobj.hxx:58
virtual void SetForwardKey(bool)
Definition: salobj.hxx:52
void EnableEraseBackground(bool bEnable)
Definition: salobj.hxx:68
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo