1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef _SV_SALINST_H 25 #define _SV_SALINST_H 26 27 #include <salinst.hxx> 28 29 namespace vos { class OMutex; } 30 31 // ------------------- 32 // - SalInstanceData - 33 // ------------------- 34 35 class SalYieldMutex; 36 37 class WinSalInstance : public SalInstance 38 { 39 public: 40 HINSTANCE mhInst; // Instance Handle 41 HWND mhComWnd; // window, for communication (between threads and the main thread) 42 SalYieldMutex* mpSalYieldMutex; // Sal-Yield-Mutex 43 vos::OMutex* mpSalWaitMutex; // Sal-Wait-Mutex 44 sal_uInt16 mnYieldWaitCount; // Wait-Count 45 public: 46 WinSalInstance(); 47 virtual ~WinSalInstance(); 48 49 virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uIntPtr nStyle ); 50 virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uIntPtr nStyle ); 51 virtual void DestroyFrame( SalFrame* pFrame ); 52 virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True ); 53 virtual void DestroyObject( SalObject* pObject ); 54 virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics, 55 long nDX, long nDY, 56 sal_uInt16 nBitCount, const SystemGraphicsData *pData ); 57 virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice ); 58 59 virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo, 60 ImplJobSetup* pSetupData ); 61 virtual void DestroyInfoPrinter( SalInfoPrinter* pPrinter ); 62 virtual SalPrinter* CreatePrinter( SalInfoPrinter* pInfoPrinter ); 63 virtual void DestroyPrinter( SalPrinter* pPrinter ); 64 virtual void GetPrinterQueueInfo( ImplPrnQueueList* pList ); 65 virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo ); 66 virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo ); 67 virtual String GetDefaultPrinter(); 68 virtual SalTimer* CreateSalTimer(); 69 virtual SalI18NImeStatus* CreateI18NImeStatus(); 70 virtual SalSystem* CreateSalSystem(); 71 virtual SalBitmap* CreateSalBitmap(); 72 virtual vos::IMutex* GetYieldMutex(); 73 virtual sal_uIntPtr ReleaseYieldMutex(); 74 virtual void AcquireYieldMutex( sal_uIntPtr nCount ); 75 virtual bool CheckYieldMutex(); 76 77 virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ); 78 virtual bool AnyInput( sal_uInt16 nType ); 79 virtual SalMenu* CreateMenu( sal_Bool bMenuBar, Menu* ); 80 virtual void DestroyMenu( SalMenu* ); 81 virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData ); 82 virtual void DestroyMenuItem( SalMenuItem* ); 83 virtual SalSession* CreateSalSession(); 84 virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ); 85 virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType); 86 87 static int WorkaroundExceptionHandlingInUSER32Lib(int nExcept, LPEXCEPTION_POINTERS pExceptionInfo); 88 }; 89 90 // -------------- 91 // - Prototypen - 92 // -------------- 93 94 SalFrame* ImplSalCreateFrame( WinSalInstance* pInst, HWND hWndParent, sal_uIntPtr nSalFrameStyle ); 95 SalObject* ImplSalCreateObject( WinSalInstance* pInst, WinSalFrame* pParent ); 96 HWND ImplSalReCreateHWND( HWND hWndParent, HWND oldhWnd, sal_Bool bAsChild ); 97 void ImplSalStartTimer( sal_uIntPtr nMS, sal_Bool bMutex = sal_False ); 98 void ImplSalPrinterAbortJobAsync( HDC hPrnDC ); 99 100 #endif // _SV_SALINST_H 101