xref: /AOO41X/main/vcl/inc/os2/salinst.h (revision b2937f997bda0a05141a2d862a64f7be893955b7)
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 #define SAL_COMMANDLINENOINIT   ((USHORT)0xFFFF)
42 #define SAL_MAXPARAM            40
43 
44 class Os2SalInstance : public SalInstance
45 {
46 public:
47     HAB                     mhAB;                   // anchor block handle
48     HMQ                     mhMQ;                   // handle of os2 message queue
49     HPOINTER                mhAppIcon;              // app icon
50     int                     mnArgc;                 // commandline param count
51     char**                  mpArgv;                 // commandline
52     HWND                    mhComWnd;               // window, for communication (between threads and the main thread)
53     SalYieldMutex*          mpSalYieldMutex;        // Sal-Yield-Mutex
54     vos::OMutex*            mpSalWaitMutex;         // Sal-Wait-Mutex
55     USHORT              mnYieldWaitCount;       // Wait-Count
56 
57 public:
58     Os2SalInstance();
59     virtual ~Os2SalInstance();
60 
61     virtual SalFrame*       CreateChildFrame( SystemParentData* pParent, ULONG nStyle );
62     virtual SalFrame*       CreateFrame( SalFrame* pParent, ULONG nStyle );
63     virtual void            DestroyFrame( SalFrame* pFrame );
64     virtual SalObject*      CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = TRUE );
65     virtual void            DestroyObject( SalObject* pObject );
66     virtual SalVirtualDevice*   CreateVirtualDevice( SalGraphics* pGraphics,
67                                                      long nDX, long nDY,
68                                                      USHORT nBitCount, const SystemGraphicsData *pData );
69     virtual void            DestroyVirtualDevice( SalVirtualDevice* pDevice );
70 
71     virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
72                                                ImplJobSetup* pSetupData );
73     virtual void            DestroyInfoPrinter( SalInfoPrinter* pPrinter );
74     virtual SalPrinter*     CreatePrinter( SalInfoPrinter* pInfoPrinter );
75     virtual void            DestroyPrinter( SalPrinter* pPrinter );
76     virtual void            GetPrinterQueueInfo( ImplPrnQueueList* pList );
77     virtual void            GetPrinterQueueState( SalPrinterQueueInfo* pInfo );
78     virtual void            DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo );
79     virtual String             GetDefaultPrinter();
80     virtual SalTimer*           CreateSalTimer();
81     virtual SalI18NImeStatus*   CreateI18NImeStatus();
82     virtual SalSystem*          CreateSalSystem();
83     virtual SalBitmap*          CreateSalBitmap();
84     virtual vos::IMutex*        GetYieldMutex();
85     virtual ULONG               ReleaseYieldMutex();
86     virtual void                AcquireYieldMutex( ULONG nCount );
87     virtual bool                CheckYieldMutex();
88 
89     virtual void                Yield( bool, bool );
90     virtual bool                AnyInput( USHORT nType );
91     virtual SalMenu*            CreateMenu( sal_Bool bMenuBar, Menu* );
92     virtual void                DestroyMenu( SalMenu* );
93     virtual SalMenuItem*            CreateMenuItem( const SalItemParams* pItemData );
94     virtual void                DestroyMenuItem( SalMenuItem* );
95     virtual SalSession*                         CreateSalSession();
96     virtual void*               GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes );
97     virtual void                AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType);
98 };
99 
100 SalFrame* ImplSalCreateFrame( Os2SalInstance* pInst, HWND hWndParent, ULONG nSalFrameStyle );
101 SalObject* ImplSalCreateObject( Os2SalInstance* pInst, Os2SalFrame* pParent );
102 void ImplSalStartTimer( ULONG nMS, sal_Bool bMutex = FALSE );
103 
104 #endif // _SV_SALINST_H
105