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