Impress Remote 1.0.5, tag sdremote-1.0.5
[LibreOffice.git] / vcl / inc / headless / svpinst.hxx
blob5b7536392b372057283e9f9bd2ca75b823a6e2ca
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> // timeval
37 #define VIRTUAL_DESKTOP_WIDTH 1024
38 #define VIRTUAL_DESKTOP_HEIGHT 768
40 // ---------------
41 // - SalTimer -
42 // ---------------
43 class SvpSalInstance;
44 class SvpSalTimer : public SalTimer
46 SvpSalInstance* m_pInstance;
47 public:
48 SvpSalTimer( SvpSalInstance* pInstance ) : m_pInstance( pInstance ) {}
49 virtual ~SvpSalTimer();
51 // overload all pure virtual methods
52 virtual void Start( sal_uLong nMS );
53 virtual void Stop();
56 // ---------------
57 // - SalInstance -
58 // ---------------
59 class SvpSalFrame;
60 class GenPspGraphics;
61 class SvpSalInstance : public SalGenericInstance
63 timeval m_aTimeout;
64 sal_uLong m_nTimeoutMS;
65 int m_pTimeoutFDS[2];
67 // internal event queue
68 struct SalUserEvent
70 const SalFrame* m_pFrame;
71 void* m_pData;
72 sal_uInt16 m_nEvent;
74 SalUserEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent = SALEVENT_USEREVENT )
75 : m_pFrame( pFrame ),
76 m_pData( pData ),
77 m_nEvent( nEvent )
81 oslMutex m_aEventGuard;
82 std::list< SalUserEvent > m_aUserEvents;
84 std::list< SalFrame* > m_aFrames;
86 bool isFrameAlive( const SalFrame* pFrame ) const;
88 protected:
89 virtual void DoReleaseYield( int nTimeoutMS );
91 public:
92 static SvpSalInstance* s_pDefaultInstance;
94 SvpSalInstance( SalYieldMutex *pMutex );
95 virtual ~SvpSalInstance();
97 void PostEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent );
99 void StartTimer( sal_uLong nMS );
100 void StopTimer();
101 void Wakeup();
103 void registerFrame( SalFrame* pFrame ) { m_aFrames.push_back( pFrame ); }
104 void deregisterFrame( SalFrame* pFrame );
105 const std::list< SalFrame* >& getFrames() const { return m_aFrames; }
107 bool CheckTimeout( bool bExecuteTimers = true );
109 // Frame
110 virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle );
111 virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle );
112 virtual void DestroyFrame( SalFrame* pFrame );
114 // Object (System Child Window)
115 virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True );
116 virtual void DestroyObject( SalObject* pObject );
118 // VirtualDevice
119 // nDX and nDY in Pixel
120 // nBitCount: 0 == Default(=as window) / 1 == Mono
121 // pData allows for using a system dependent graphics or device context
122 virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics,
123 long nDX, long nDY,
124 sal_uInt16 nBitCount, const SystemGraphicsData *pData = NULL );
125 virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice );
127 // Printer
128 // pSetupData->mpDriverData can be 0
129 // pSetupData must be updatet with the current
130 // JobSetup
131 virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
132 ImplJobSetup* pSetupData );
133 virtual void DestroyInfoPrinter( SalInfoPrinter* pPrinter );
134 virtual SalPrinter* CreatePrinter( SalInfoPrinter* pInfoPrinter );
135 virtual void DestroyPrinter( SalPrinter* pPrinter );
137 virtual void GetPrinterQueueInfo( ImplPrnQueueList* pList );
138 virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo );
139 virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo );
140 virtual rtl::OUString GetDefaultPrinter();
141 virtual void PostPrintersChanged();
143 // SalTimer
144 virtual SalTimer* CreateSalTimer();
145 // SalI18NImeStatus
146 virtual SalI18NImeStatus* CreateI18NImeStatus();
147 // SalSystem
148 virtual SalSystem* CreateSalSystem();
149 // SalBitmap
150 virtual SalBitmap* CreateSalBitmap();
152 // wait next event and dispatch
153 // must returned by UserEvent (SalFrame::PostEvent)
154 // and timer
155 virtual void Yield( bool bWait, bool bHandleAllCurrentEvents );
156 virtual bool AnyInput( sal_uInt16 nType );
158 // may return NULL to disable session management
159 virtual SalSession* CreateSalSession();
161 virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes );
163 virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType);
165 virtual GenPspGraphics *CreatePrintGraphics();
168 #endif // _SV_SALINST_HXX
170 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */