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  virtual void Reparent(SalFrame* /*pFrame*/) {}
52 
53  virtual void SetForwardKey( bool /* bEnable */ ) {}
54 
55  virtual void SetLeaveEnterBackgrounds(const css::uno::Sequence<css::uno::Any>& /*rLeaveArgs*/, const css::uno::Sequence<css::uno::Any>& /*rEnterArgs*/) {}
56 
57  virtual const SystemEnvData* GetSystemData() const = 0;
58 
59  virtual Size GetOptimalSize() const { return Size(); }
60 
62  { m_pInst = pInst; m_pCallback = pProc; }
63  void CallCallback( SalObjEvent nEvent )
64  { if (m_pCallback) m_pCallback( m_pInst, nEvent ); }
65 
66  void SetMouseTransparent( bool bMouseTransparent )
67  { m_bMouseTransparent = bMouseTransparent; }
68  bool IsMouseTransparent() const
69  { return m_bMouseTransparent; }
70 
71  void EnableEraseBackground( bool bEnable )
72  { m_bEraseBackground = bEnable; }
74  { return m_bEraseBackground; }
75 };
76 
77 #endif // INCLUDED_VCL_INC_SALOBJ_HXX
78 
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SALOBJECTPROC m_pCallback
Definition: salobj.hxx:35
bool IsMouseTransparent() const
Definition: salobj.hxx:68
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:63
virtual void Enable(bool)
Definition: salobj.hxx:49
VclPtr< SystemChildWindow > m_pInst
Definition: salobj.hxx:34
SalObjEvent
Definition: salwtype.hxx:226
virtual Size GetOptimalSize() const
Definition: salobj.hxx:59
void SetMouseTransparent(bool bMouseTransparent)
Definition: salobj.hxx:66
#define VCL_PLUGIN_PUBLIC
Definition: dllapi.h:40
A SalFrame is a system window (e.g. an X11 window).
Definition: salframe.hxx:112
bool IsEraseBackgroundEnabled() const
Definition: salobj.hxx:73
virtual void Reparent(SalFrame *)
Definition: salobj.hxx:51
virtual void SetLeaveEnterBackgrounds(const css::uno::Sequence< css::uno::Any > &, const css::uno::Sequence< css::uno::Any > &)
Definition: salobj.hxx:55
void SetCallback(SystemChildWindow *pInst, SALOBJECTPROC pProc)
Definition: salobj.hxx:61
virtual void SetForwardKey(bool)
Definition: salobj.hxx:53
void EnableEraseBackground(bool bEnable)
Definition: salobj.hxx:71
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo