1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef _SV_SALINST_H 29 #define _SV_SALINST_H 30 31 #include <salinst.hxx> 32 33 namespace vos { class OMutex; } 34 35 // ------------------- 36 // - SalInstanceData - 37 // ------------------- 38 39 class SalYieldMutex; 40 41 class WinSalInstance : public SalInstance 42 { 43 public: 44 HINSTANCE mhInst; // Instance Handle 45 HWND mhComWnd; // window, for communication (between threads and the main thread) 46 SalYieldMutex* mpSalYieldMutex; // Sal-Yield-Mutex 47 vos::OMutex* mpSalWaitMutex; // Sal-Wait-Mutex 48 sal_uInt16 mnYieldWaitCount; // Wait-Count 49 public: 50 WinSalInstance(); 51 virtual ~WinSalInstance(); 52 53 virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uIntPtr nStyle ); 54 virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uIntPtr nStyle ); 55 virtual void DestroyFrame( SalFrame* pFrame ); 56 virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True ); 57 virtual void DestroyObject( SalObject* pObject ); 58 virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics, 59 long nDX, long nDY, 60 sal_uInt16 nBitCount, const SystemGraphicsData *pData ); 61 virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice ); 62 63 virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo, 64 ImplJobSetup* pSetupData ); 65 virtual void DestroyInfoPrinter( SalInfoPrinter* pPrinter ); 66 virtual SalPrinter* CreatePrinter( SalInfoPrinter* pInfoPrinter ); 67 virtual void DestroyPrinter( SalPrinter* pPrinter ); 68 virtual void GetPrinterQueueInfo( ImplPrnQueueList* pList ); 69 virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo ); 70 virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo ); 71 virtual String GetDefaultPrinter(); 72 virtual SalTimer* CreateSalTimer(); 73 virtual SalI18NImeStatus* CreateI18NImeStatus(); 74 virtual SalSystem* CreateSalSystem(); 75 virtual SalBitmap* CreateSalBitmap(); 76 virtual vos::IMutex* GetYieldMutex(); 77 virtual sal_uIntPtr ReleaseYieldMutex(); 78 virtual void AcquireYieldMutex( sal_uIntPtr nCount ); 79 virtual bool CheckYieldMutex(); 80 81 virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ); 82 virtual bool AnyInput( sal_uInt16 nType ); 83 virtual SalMenu* CreateMenu( sal_Bool bMenuBar, Menu* ); 84 virtual void DestroyMenu( SalMenu* ); 85 virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData ); 86 virtual void DestroyMenuItem( SalMenuItem* ); 87 virtual SalSession* CreateSalSession(); 88 virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ); 89 virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType); 90 91 static int WorkaroundExceptionHandlingInUSER32Lib(int nExcept, LPEXCEPTION_POINTERS pExceptionInfo); 92 }; 93 94 // -------------- 95 // - Prototypen - 96 // -------------- 97 98 SalFrame* ImplSalCreateFrame( WinSalInstance* pInst, HWND hWndParent, sal_uIntPtr nSalFrameStyle ); 99 SalObject* ImplSalCreateObject( WinSalInstance* pInst, WinSalFrame* pParent ); 100 HWND ImplSalReCreateHWND( HWND hWndParent, HWND oldhWnd, sal_Bool bAsChild ); 101 void ImplSalStartTimer( sal_uIntPtr nMS, sal_Bool bMutex = sal_False ); 102 void ImplSalPrinterAbortJobAsync( HDC hPrnDC ); 103 104 #endif // _SV_SALINST_H 105