xref: /trunk/main/vcl/inc/unx/salinst.h (revision cdf0e10c)
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 // -=-= includes -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
29 #ifndef _SV_SALINST_H
30 #define _SV_SALINST_H
31 
32 #include <vcl/sv.h>
33 #ifndef _VOS_MUTEX_HXX
34 #include <vos/mutex.hxx>
35 #endif
36 #ifndef _VOS_THREAD_HXX
37 #include <vos/thread.hxx>
38 #endif
39 #include <vclpluginapi.h>
40 #include <salinst.hxx>
41 
42 class VCLPLUG_GEN_PUBLIC SalYieldMutex : public vos::OMutex
43 {
44 protected:
45 	sal_uIntPtr										mnCount;
46 	vos::OThread::TThreadIdentifier	mnThreadId;
47 
48 public:
49 												SalYieldMutex();
50 
51 	virtual void								acquire();
52 	virtual void								release();
53 	virtual sal_Bool 							tryToAcquire();
54 
55 	sal_uIntPtr										GetAcquireCount() const { return mnCount; }
56 	vos::OThread::TThreadIdentifier	GetThreadId() const { return mnThreadId; }
57 };
58 
59 // -=-= SalInstanceData =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
60 class VCLPLUG_GEN_PUBLIC X11SalInstance : public SalInstance
61 {
62 protected:
63 	SalYieldMutex*					mpSalYieldMutex;
64     bool							mbPrinterInit;
65 
66 public:
67     X11SalInstance( SalYieldMutex* pMutex )
68             : mpSalYieldMutex( pMutex ),
69               mbPrinterInit( false )
70     {}
71     virtual ~X11SalInstance();
72 
73     virtual SalFrame*      	CreateChildFrame( SystemParentData* pParent, sal_uIntPtr nStyle );
74     virtual SalFrame*      	CreateFrame( SalFrame* pParent, sal_uIntPtr nStyle );
75     virtual void				DestroyFrame( SalFrame* pFrame );
76 
77     virtual SalObject*			CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True );
78     virtual void				DestroyObject( SalObject* pObject );
79 
80     virtual SalVirtualDevice*	CreateVirtualDevice( SalGraphics* pGraphics,
81                                                      long nDX, long nDY,
82                                                      sal_uInt16 nBitCount, const SystemGraphicsData *pData = NULL );
83     virtual void				DestroyVirtualDevice( SalVirtualDevice* pDevice );
84 
85     virtual SalInfoPrinter*	CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
86                                                ImplJobSetup* pSetupData );
87     virtual void				DestroyInfoPrinter( SalInfoPrinter* pPrinter );
88     virtual SalPrinter*		CreatePrinter( SalInfoPrinter* pInfoPrinter );
89     virtual void				DestroyPrinter( SalPrinter* pPrinter );
90 
91     virtual void				GetPrinterQueueInfo( ImplPrnQueueList* pList );
92     virtual void				GetPrinterQueueState( SalPrinterQueueInfo* pInfo );
93     virtual void				DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo );
94     virtual String             GetDefaultPrinter();
95 
96     virtual SalTimer*			CreateSalTimer();
97     virtual SalI18NImeStatus*	CreateI18NImeStatus();
98     virtual SalSystem*			CreateSalSystem();
99     virtual SalBitmap*			CreateSalBitmap();
100     virtual SalSession*			CreateSalSession();
101 
102     virtual vos::IMutex*		GetYieldMutex();
103     virtual sal_uIntPtr				ReleaseYieldMutex();
104     virtual void				AcquireYieldMutex( sal_uIntPtr nCount );
105     virtual bool                CheckYieldMutex();
106 
107     virtual void				Yield( bool bWait, bool bHandleAllCurrentEvents );
108     virtual bool				AnyInput( sal_uInt16 nType );
109 
110     virtual void*			GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes );
111     void                    FillFontPathList( std::list< rtl::OString >& o_rFontPaths );
112 
113     // dtrans implementation
114     virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
115         CreateClipboard( const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& i_rArguments );
116     virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > CreateDragSource();
117     virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > CreateDropTarget();
118     virtual void            AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType);
119 
120 
121     bool isPrinterInit() const
122     {
123         return mbPrinterInit;
124     }
125 };
126 
127 #endif // _SV_SALINST_H
128 
129