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/.
10 #ifndef INCLUDED_VCL_INC_GENERIC_GENDATA_HXX
11 #define INCLUDED_VCL_INC_GENERIC_GENDATA_HXX
13 #include <osl/socket.hxx>
15 #include <saldatabasic.hxx>
17 class SalGenericDisplay
;
19 enum SalGenericDataType
{ SAL_DATA_GTK
, SAL_DATA_GTK3
,
20 SAL_DATA_TDE3
, SAL_DATA_KDE3
, SAL_DATA_KDE4
,
21 SAL_DATA_UNX
, SAL_DATA_SVP
,
22 SAL_DATA_ANDROID
, SAL_DATA_IOS
,
25 class VCL_DLLPUBLIC SalGenericData
: public SalData
28 SalGenericDataType m_eType
;
29 SalGenericDisplay
*m_pDisplay
;
30 // cached hostname to avoid slow lookup
32 // for transient storage of unicode strings eg. 'u123' by input methods
33 OUString m_aUnicodeEntry
;
35 SalGenericData( SalGenericDataType t
, SalInstance
*pInstance
) : SalData(), m_eType( t
), m_pDisplay( nullptr ) { m_pInstance
= pInstance
; SetSalData( this ); }
36 virtual void Dispose() {}
38 SalGenericDisplay
*GetDisplay() const { return m_pDisplay
; }
39 void SetDisplay( SalGenericDisplay
*pDisp
) { m_pDisplay
= pDisp
; }
41 const OUString
& GetHostname()
43 if (m_aHostname
.isEmpty())
44 osl_getLocalHostname( &m_aHostname
.pData
);
47 OUString
&GetUnicodeCommand()
49 return m_aUnicodeEntry
;
51 SalGenericDataType
GetType() const
56 // Mostly useful for remote protocol backends
57 virtual void ErrorTrapPush() = 0;
58 virtual bool ErrorTrapPop( bool bIgnoreError
= true ) = 0; // true on error
61 inline SalGenericData
* GetGenericData()
63 return static_cast<SalGenericData
*>(ImplGetSVData()->mpSalData
);
68 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */