fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / vcl / inc / headless / svpinst.hxx
blobaf0c68051008d1cccfcab4c71af55132f59b8885
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 _SVP_SALINST_HXX
21 #define _SVP_SALINST_HXX
23 #include <vcl/solarmutex.hxx>
25 #include <osl/mutex.hxx>
26 #include <osl/thread.hxx>
27 #include <salinst.hxx>
28 #include <salwtype.hxx>
29 #include <saltimer.hxx>
30 #include <generic/geninst.h>
31 #include <generic/genprn.h>
33 #include <list>
35 #include <time.h>
37 #define VIRTUAL_DESKTOP_WIDTH 1024
38 #define VIRTUAL_DESKTOP_HEIGHT 768
40 class SvpSalInstance;
41 class SvpSalTimer : public SalTimer
43 SvpSalInstance* m_pInstance;
44 public:
45 SvpSalTimer( SvpSalInstance* pInstance ) : m_pInstance( pInstance ) {}
46 virtual ~SvpSalTimer();
48 // overload all pure virtual methods
49 virtual void Start( sal_uLong nMS );
50 virtual void Stop();
53 class SvpSalFrame;
54 class GenPspGraphics;
56 class SvpSalInstance : public SalGenericInstance
58 timeval m_aTimeout;
59 sal_uLong m_nTimeoutMS;
60 int m_pTimeoutFDS[2];
62 // internal event queue
63 struct SalUserEvent
65 const SalFrame* m_pFrame;
66 void* m_pData;
67 sal_uInt16 m_nEvent;
69 SalUserEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent = SALEVENT_USEREVENT )
70 : m_pFrame( pFrame ),
71 m_pData( pData ),
72 m_nEvent( nEvent )
76 oslMutex m_aEventGuard;
77 std::list< SalUserEvent > m_aUserEvents;
79 std::list< SalFrame* > m_aFrames;
81 bool isFrameAlive( const SalFrame* pFrame ) const;
83 protected:
84 virtual void DoReleaseYield( int nTimeoutMS );
86 public:
87 static SvpSalInstance* s_pDefaultInstance;
89 SvpSalInstance( SalYieldMutex *pMutex );
90 virtual ~SvpSalInstance();
92 void PostEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent );
94 bool PostedEventsInQueue();
96 void StartTimer( sal_uLong nMS );
97 void StopTimer();
98 void Wakeup();
100 void registerFrame( SalFrame* pFrame ) { m_aFrames.push_back( pFrame ); }
101 void deregisterFrame( SalFrame* pFrame );
102 const std::list< SalFrame* >&
103 getFrames() const { return m_aFrames; }
105 bool CheckTimeout( bool bExecuteTimers = true );
107 // Frame
108 virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle );
109 virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle );
110 virtual void DestroyFrame( SalFrame* pFrame );
112 // Object (System Child Window)
113 virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True );
114 virtual void DestroyObject( SalObject* pObject );
116 // VirtualDevice
117 // nDX and nDY in Pixel
118 // nBitCount: 0 == Default(=as window) / 1 == Mono
119 // pData allows for using a system dependent graphics or device context
120 virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics,
121 long nDX, long nDY,
122 sal_uInt16 nBitCount, const SystemGraphicsData *pData = NULL );
123 virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice );
125 // Printer
126 // pSetupData->mpDriverData can be 0
127 // pSetupData must be updatet with the current
128 // JobSetup
129 virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
130 ImplJobSetup* pSetupData );
131 virtual void DestroyInfoPrinter( SalInfoPrinter* pPrinter );
132 virtual SalPrinter* CreatePrinter( SalInfoPrinter* pInfoPrinter );
133 virtual void DestroyPrinter( SalPrinter* pPrinter );
135 virtual void GetPrinterQueueInfo( ImplPrnQueueList* pList );
136 virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo );
137 virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo );
138 virtual OUString GetDefaultPrinter();
139 virtual void PostPrintersChanged();
141 // SalTimer
142 virtual SalTimer* CreateSalTimer();
143 // SalI18NImeStatus
144 virtual SalI18NImeStatus* CreateI18NImeStatus();
145 // SalSystem
146 virtual SalSystem* CreateSalSystem();
147 // SalBitmap
148 virtual SalBitmap* CreateSalBitmap();
150 // wait next event and dispatch
151 // must returned by UserEvent (SalFrame::PostEvent)
152 // and timer
153 virtual void Yield( bool bWait, bool bHandleAllCurrentEvents );
154 virtual bool AnyInput( sal_uInt16 nType );
156 // may return NULL to disable session management
157 virtual SalSession* CreateSalSession();
159 virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes );
161 virtual void AddToRecentDocumentList(const OUString& rFileUrl, const OUString& rMimeType, const OUString& rDocumentService);
163 virtual GenPspGraphics *CreatePrintGraphics();
166 #endif // _SV_SALINST_HXX
168 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */