Avoid potential negative array index access to cached text.
[LibreOffice.git] / vcl / inc / salobj.hxx
blobb5d9d64f82e4138b26f7a6df379820de5a77c96e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 <vcl/syschild.hxx>
25 #include <com/sun/star/uno/Sequence.hxx>
26 #include "salwtype.hxx"
28 struct SystemEnvData;
30 typedef void (*SALOBJECTPROC)(SystemChildWindow* pInst, SalObjEvent nEvent);
32 class VCL_PLUGIN_PUBLIC SalObject
34 VclPtr<SystemChildWindow> m_pInst;
35 SALOBJECTPROC m_pCallback;
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();
42 virtual void ResetClipRegion() = 0;
43 virtual void BeginSetClipRegion( sal_uInt32 nRects ) = 0;
44 virtual void UnionClipRegion( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight ) = 0;
45 virtual void EndSetClipRegion() = 0;
47 virtual void SetPosSize( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::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*/) {}
53 virtual void SetForwardKey( bool /* bEnable */ ) {}
55 virtual void SetLeaveEnterBackgrounds(const css::uno::Sequence<css::uno::Any>& /*rLeaveArgs*/, const css::uno::Sequence<css::uno::Any>& /*rEnterArgs*/) {}
57 virtual const SystemEnvData* GetSystemData() const = 0;
59 virtual Size GetOptimalSize() const { return Size(); }
61 void SetCallback( SystemChildWindow* pInst, SALOBJECTPROC pProc )
62 { m_pInst = pInst; m_pCallback = pProc; }
63 void CallCallback( SalObjEvent nEvent )
64 { if (m_pCallback) m_pCallback( m_pInst, nEvent ); }
66 void SetMouseTransparent( bool bMouseTransparent )
67 { m_bMouseTransparent = bMouseTransparent; }
68 bool IsMouseTransparent() const
69 { return m_bMouseTransparent; }
71 void EnableEraseBackground( bool bEnable )
72 { m_bEraseBackground = bEnable; }
73 bool IsEraseBackgroundEnabled() const
74 { return m_bEraseBackground; }
77 #endif // INCLUDED_VCL_INC_SALOBJ_HXX
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */