Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _TOOLKIT_AWT_VCLXTOPWINDOW_HXX_
30 : : #define _TOOLKIT_AWT_VCLXTOPWINDOW_HXX_
31 : :
32 : : #include <com/sun/star/awt/XSystemDependentWindowPeer.hpp>
33 : : #include <com/sun/star/awt/XTopWindow2.hpp>
34 : : #include <com/sun/star/awt/XMenuBar.hpp>
35 : : #include <cppuhelper/weak.hxx>
36 : : #include <osl/mutex.hxx>
37 : :
38 : : #include <cppuhelper/implbase1.hxx>
39 : :
40 : : #include <toolkit/awt/vclxcontainer.hxx>
41 : :
42 : : typedef ::cppu::ImplHelper1 < ::com::sun::star::awt::XTopWindow2
43 : : > VCLXTopWindow_XBase;
44 : : typedef ::cppu::ImplHelper1 < ::com::sun::star::awt::XSystemDependentWindowPeer
45 : : > VCLXTopWindow_SBase;
46 : :
47 : : class TOOLKIT_DLLPUBLIC VCLXTopWindow_Base :public VCLXTopWindow_XBase
48 : : ,public VCLXTopWindow_SBase
49 : : {
50 : : private:
51 : : const bool m_bWHWND;
52 : :
53 : : protected:
54 : : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMenuBar> mxMenuBar;
55 : :
56 : 0 : bool isSystemDependentWindowPeer() const { return m_bWHWND; }
57 : :
58 : : virtual Window* GetWindowImpl() = 0;
59 : : virtual ::cppu::OInterfaceContainerHelper& GetTopWindowListenersImpl() = 0;
60 : :
61 : : VCLXTopWindow_Base( const bool _bSupportSystemWindowPeer );
62 : :
63 : : public:
64 : : virtual ~VCLXTopWindow_Base();
65 : :
66 : : // XInterface equivalents
67 : : ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
68 : : // XTypeProvider equivalents
69 : : ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
70 : :
71 : : // ::com::sun::star::awt::XSystemDependentWindowPeer
72 : : ::com::sun::star::uno::Any SAL_CALL getWindowHandle( const ::com::sun::star::uno::Sequence< sal_Int8 >& ProcessId, sal_Int16 SystemType ) throw(::com::sun::star::uno::RuntimeException);
73 : :
74 : : // ::com::sun::star::awt::XTopWindow
75 : : void SAL_CALL addTopWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTopWindowListener >& rxListener ) throw(::com::sun::star::uno::RuntimeException);
76 : : void SAL_CALL removeTopWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTopWindowListener >& rxListener ) throw(::com::sun::star::uno::RuntimeException);
77 : : void SAL_CALL toFront() throw(::com::sun::star::uno::RuntimeException);
78 : : void SAL_CALL toBack() throw(::com::sun::star::uno::RuntimeException);
79 : : void SAL_CALL setMenuBar( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMenuBar >& xMenu ) throw(::com::sun::star::uno::RuntimeException);
80 : :
81 : : // XTopWindow2
82 : : virtual ::sal_Bool SAL_CALL getIsMaximized() throw (::com::sun::star::uno::RuntimeException);
83 : : virtual void SAL_CALL setIsMaximized( ::sal_Bool _ismaximized ) throw (::com::sun::star::uno::RuntimeException);
84 : : virtual ::sal_Bool SAL_CALL getIsMinimized() throw (::com::sun::star::uno::RuntimeException);
85 : : virtual void SAL_CALL setIsMinimized( ::sal_Bool _isminimized ) throw (::com::sun::star::uno::RuntimeException);
86 : : virtual ::sal_Int32 SAL_CALL getDisplay() throw (::com::sun::star::uno::RuntimeException);
87 : : virtual void SAL_CALL setDisplay( ::sal_Int32 _display ) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException);
88 : : };
89 : :
90 : : // ----------------------------------------------------
91 : : // class VCLXTopWindow
92 : : // ----------------------------------------------------
93 : :
94 : : class TOOLKIT_DLLPUBLIC VCLXTopWindow: public VCLXTopWindow_Base,
95 : : public VCLXContainer
96 : : {
97 : : protected:
98 : : virtual Window* GetWindowImpl();
99 : : virtual ::cppu::OInterfaceContainerHelper& GetTopWindowListenersImpl();
100 : :
101 : : public:
102 : : VCLXTopWindow(bool bWHWND = false);
103 : : ~VCLXTopWindow();
104 : :
105 : : // ::com::sun::star::uno::XInterface
106 : : ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
107 : 1353798 : void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
108 : 1353074 : void SAL_CALL release() throw() { OWeakObject::release(); }
109 : :
110 : : // ::com::sun::star::lang::XTypeProvider
111 : : ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
112 : : ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
113 : :
114 : : static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
115 : 0 : virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
116 : : };
117 : :
118 : :
119 : :
120 : :
121 : : #endif // _TOOLKIT_AWT_VCLXTOPWINDOW_HXX_
122 : :
123 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|