Branch libreoffice-5-0-4
[LibreOffice.git] / vcl / inc / unx / salinst.h
blob381ddda2e35f23590140cfd95f318bdaab70c704
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_UNX_SALINST_H
21 #define INCLUDED_VCL_INC_UNX_SALINST_H
23 #include <osl/thread.hxx>
24 #include <vclpluginapi.h>
25 #include <salinst.hxx>
26 #include "generic/geninst.h"
28 #include <prex.h>
29 #include <X11/Xlib.h>
30 #include <postx.h>
32 namespace com { namespace sun { namespace star { namespace datatransfer {
33 namespace clipboard { class XClipboard; }
34 } } } }
36 class SalXLib;
37 class X11SalGraphics;
39 class VCLPLUG_GEN_PUBLIC X11SalInstance : public SalGenericInstance
41 private:
42 std::unordered_map< Atom, com::sun::star::uno::Reference< com::sun::star::datatransfer::clipboard::XClipboard > > m_aInstances;
44 protected:
45 SalXLib *mpXLib;
47 public:
48 X11SalInstance( SalYieldMutex* pMutex ) : SalGenericInstance( pMutex ), mpXLib(NULL) {}
49 virtual ~X11SalInstance();
51 virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uIntPtr nStyle ) SAL_OVERRIDE;
52 virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uIntPtr nStyle ) SAL_OVERRIDE;
53 virtual void DestroyFrame( SalFrame* pFrame ) SAL_OVERRIDE;
55 virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, bool bShow = true ) SAL_OVERRIDE;
56 virtual void DestroyObject( SalObject* pObject ) SAL_OVERRIDE;
58 /// Gtk vclplug needs to pass GtkSalGraphics to X11SalVirtualDevice, so create it, and pass as pNewGraphics.
59 virtual SalVirtualDevice* CreateX11VirtualDevice(SalGraphics* pGraphics, long &nDX, long &nDY,
60 sal_uInt16 nBitCount, const SystemGraphicsData* pData, X11SalGraphics* pNewGraphics);
62 virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics,
63 long &nDX, long &nDY,
64 sal_uInt16 nBitCount, const SystemGraphicsData *pData = NULL ) SAL_OVERRIDE;
65 virtual void PostPrintersChanged() SAL_OVERRIDE;
66 virtual GenPspGraphics *CreatePrintGraphics() SAL_OVERRIDE;
68 virtual SalTimer* CreateSalTimer() SAL_OVERRIDE;
69 virtual SalI18NImeStatus* CreateI18NImeStatus() SAL_OVERRIDE;
70 virtual SalSystem* CreateSalSystem() SAL_OVERRIDE;
71 virtual SalBitmap* CreateSalBitmap() SAL_OVERRIDE;
72 virtual SalSession* CreateSalSession() SAL_OVERRIDE;
74 virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ) SAL_OVERRIDE;
75 virtual bool AnyInput( VclInputFlags nType ) SAL_OVERRIDE;
77 virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ) SAL_OVERRIDE;
78 virtual void FillFontPathList( std::list< OString >& o_rFontPaths ) SAL_OVERRIDE;
79 void SetLib( SalXLib *pXLib ) { mpXLib = pXLib; }
81 // dtrans implementation
82 virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
83 CreateClipboard( const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& i_rArguments ) SAL_OVERRIDE;
84 virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > CreateDragSource() SAL_OVERRIDE;
85 virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > CreateDropTarget() SAL_OVERRIDE;
86 virtual void AddToRecentDocumentList(const OUString& rFileUrl, const OUString& rMimeType, const OUString& rDocumentService) SAL_OVERRIDE;
89 #endif // INCLUDED_VCL_INC_UNX_SALINST_H
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */