1*b1cdbd2cSJim Jagielski /**************************************************************
2*b1cdbd2cSJim Jagielski  *
3*b1cdbd2cSJim Jagielski  * Licensed to the Apache Software Foundation (ASF) under one
4*b1cdbd2cSJim Jagielski  * or more contributor license agreements.  See the NOTICE file
5*b1cdbd2cSJim Jagielski  * distributed with this work for additional information
6*b1cdbd2cSJim Jagielski  * regarding copyright ownership.  The ASF licenses this file
7*b1cdbd2cSJim Jagielski  * to you under the Apache License, Version 2.0 (the
8*b1cdbd2cSJim Jagielski  * "License"); you may not use this file except in compliance
9*b1cdbd2cSJim Jagielski  * with the License.  You may obtain a copy of the License at
10*b1cdbd2cSJim Jagielski  *
11*b1cdbd2cSJim Jagielski  *   http://www.apache.org/licenses/LICENSE-2.0
12*b1cdbd2cSJim Jagielski  *
13*b1cdbd2cSJim Jagielski  * Unless required by applicable law or agreed to in writing,
14*b1cdbd2cSJim Jagielski  * software distributed under the License is distributed on an
15*b1cdbd2cSJim Jagielski  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b1cdbd2cSJim Jagielski  * KIND, either express or implied.  See the License for the
17*b1cdbd2cSJim Jagielski  * specific language governing permissions and limitations
18*b1cdbd2cSJim Jagielski  * under the License.
19*b1cdbd2cSJim Jagielski  *
20*b1cdbd2cSJim Jagielski  *************************************************************/
21*b1cdbd2cSJim Jagielski 
22*b1cdbd2cSJim Jagielski 
23*b1cdbd2cSJim Jagielski 
24*b1cdbd2cSJim Jagielski #ifndef TOOLKIT_DIALOG_CONTROL_HXX
25*b1cdbd2cSJim Jagielski #define TOOLKIT_DIALOG_CONTROL_HXX
26*b1cdbd2cSJim Jagielski 
27*b1cdbd2cSJim Jagielski #include <toolkit/controls/controlmodelcontainerbase.hxx>
28*b1cdbd2cSJim Jagielski #include <com/sun/star/awt/XTopWindow.hpp>
29*b1cdbd2cSJim Jagielski #include <com/sun/star/awt/XDialog2.hpp>
30*b1cdbd2cSJim Jagielski #include <com/sun/star/resource/XStringResourceResolver.hpp>
31*b1cdbd2cSJim Jagielski #include "toolkit/helper/servicenames.hxx"
32*b1cdbd2cSJim Jagielski #include "toolkit/helper/macros.hxx"
33*b1cdbd2cSJim Jagielski #include <toolkit/controls/unocontrolcontainer.hxx>
34*b1cdbd2cSJim Jagielski #include <cppuhelper/basemutex.hxx>
35*b1cdbd2cSJim Jagielski #include <cppuhelper/implbase3.hxx>
36*b1cdbd2cSJim Jagielski #include <list>
37*b1cdbd2cSJim Jagielski 
38*b1cdbd2cSJim Jagielski //	----------------------------------------------------
39*b1cdbd2cSJim Jagielski //	class UnoControlDialogModel
40*b1cdbd2cSJim Jagielski //	----------------------------------------------------
41*b1cdbd2cSJim Jagielski 
42*b1cdbd2cSJim Jagielski class UnoControlDialogModel :	public ControlModelContainerBase
43*b1cdbd2cSJim Jagielski {
44*b1cdbd2cSJim Jagielski protected:
45*b1cdbd2cSJim Jagielski 	::com::sun::star::uno::Any			ImplGetDefaultValue( sal_uInt16 nPropId ) const;
46*b1cdbd2cSJim Jagielski 	::cppu::IPropertyArrayHelper&		SAL_CALL getInfoHelper();
47*b1cdbd2cSJim Jagielski public:
48*b1cdbd2cSJim Jagielski 						UnoControlDialogModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
49*b1cdbd2cSJim Jagielski 						UnoControlDialogModel( const UnoControlDialogModel& rModel );
50*b1cdbd2cSJim Jagielski 						~UnoControlDialogModel();
51*b1cdbd2cSJim Jagielski 
52*b1cdbd2cSJim Jagielski     UnoControlModel*	Clone() const;
53*b1cdbd2cSJim Jagielski 	// ::com::sun::star::beans::XMultiPropertySet
54*b1cdbd2cSJim Jagielski 	::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException);
55*b1cdbd2cSJim Jagielski 
56*b1cdbd2cSJim Jagielski 	// ::com::sun::star::io::XPersistObject
57*b1cdbd2cSJim Jagielski     ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
58*b1cdbd2cSJim Jagielski 
59*b1cdbd2cSJim Jagielski 	// XServiceInfo
60*b1cdbd2cSJim Jagielski 	DECLIMPL_SERVICEINFO_DERIVED( UnoControlDialogModel, ControlModelContainerBase, szServiceName2_UnoControlDialogModel )
61*b1cdbd2cSJim Jagielski 
62*b1cdbd2cSJim Jagielski };
63*b1cdbd2cSJim Jagielski 
64*b1cdbd2cSJim Jagielski typedef ::cppu::AggImplInheritanceHelper3   <   ControlContainerBase
65*b1cdbd2cSJim Jagielski                                             ,   ::com::sun::star::awt::XTopWindow
66*b1cdbd2cSJim Jagielski                                             ,   ::com::sun::star::awt::XDialog2
67*b1cdbd2cSJim Jagielski                                             ,   ::com::sun::star::awt::XWindowListener
68*b1cdbd2cSJim Jagielski                                             >   UnoDialogControl_Base;
69*b1cdbd2cSJim Jagielski class UnoDialogControl : public UnoDialogControl_Base
70*b1cdbd2cSJim Jagielski {
71*b1cdbd2cSJim Jagielski private:
72*b1cdbd2cSJim Jagielski     ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMenuBar >			mxMenuBar;
73*b1cdbd2cSJim Jagielski 	TopWindowListenerMultiplexer	                                            maTopWindowListeners;
74*b1cdbd2cSJim Jagielski     bool                                                                        mbWindowListener;
75*b1cdbd2cSJim Jagielski 
76*b1cdbd2cSJim Jagielski public:
77*b1cdbd2cSJim Jagielski 
78*b1cdbd2cSJim Jagielski 								UnoDialogControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
79*b1cdbd2cSJim Jagielski 								~UnoDialogControl();
80*b1cdbd2cSJim Jagielski 	::rtl::OUString				GetComponentServiceName();
81*b1cdbd2cSJim Jagielski 
82*b1cdbd2cSJim Jagielski     void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
83*b1cdbd2cSJim Jagielski     void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
84*b1cdbd2cSJim Jagielski     void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
85*b1cdbd2cSJim Jagielski 
86*b1cdbd2cSJim Jagielski     // ::com::sun::star::awt::XTopWindow
87*b1cdbd2cSJim Jagielski     void SAL_CALL addTopWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTopWindowListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
88*b1cdbd2cSJim Jagielski     void SAL_CALL removeTopWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTopWindowListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
89*b1cdbd2cSJim Jagielski     void SAL_CALL toFront(  ) throw (::com::sun::star::uno::RuntimeException);
90*b1cdbd2cSJim Jagielski     void SAL_CALL toBack(  ) throw (::com::sun::star::uno::RuntimeException);
91*b1cdbd2cSJim Jagielski     void SAL_CALL setMenuBar( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMenuBar >& xMenu ) throw (::com::sun::star::uno::RuntimeException);
92*b1cdbd2cSJim Jagielski 
93*b1cdbd2cSJim Jagielski     // ::com::sun::star::awt::XWindowListener
94*b1cdbd2cSJim Jagielski     virtual void SAL_CALL windowResized( const ::com::sun::star::awt::WindowEvent& e ) throw (::com::sun::star::uno::RuntimeException);
95*b1cdbd2cSJim Jagielski     virtual void SAL_CALL windowMoved( const ::com::sun::star::awt::WindowEvent& e ) throw (::com::sun::star::uno::RuntimeException);
96*b1cdbd2cSJim Jagielski     virtual void SAL_CALL windowShown( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
97*b1cdbd2cSJim Jagielski     virtual void SAL_CALL windowHidden( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
98*b1cdbd2cSJim Jagielski 
99*b1cdbd2cSJim Jagielski     // ::com::sun::star::awt::XDialog2
100*b1cdbd2cSJim Jagielski     virtual void SAL_CALL endDialog( ::sal_Int32 Result ) throw (::com::sun::star::uno::RuntimeException);
101*b1cdbd2cSJim Jagielski     virtual void SAL_CALL setHelpId( const rtl::OUString& Id ) throw (::com::sun::star::uno::RuntimeException);
102*b1cdbd2cSJim Jagielski 
103*b1cdbd2cSJim Jagielski 	// ::com::sun::star::awt::XDialog
104*b1cdbd2cSJim Jagielski     void SAL_CALL setTitle( const ::rtl::OUString& Title ) throw(::com::sun::star::uno::RuntimeException);
105*b1cdbd2cSJim Jagielski 	::rtl::OUString SAL_CALL getTitle() throw(::com::sun::star::uno::RuntimeException);
106*b1cdbd2cSJim Jagielski 	sal_Int16 SAL_CALL execute() throw(::com::sun::star::uno::RuntimeException);
107*b1cdbd2cSJim Jagielski 	void SAL_CALL endExecute() throw(::com::sun::star::uno::RuntimeException);
108*b1cdbd2cSJim Jagielski 
109*b1cdbd2cSJim Jagielski 	// ::com::sun::star::awt::XControl
110*b1cdbd2cSJim Jagielski     sal_Bool SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model ) throw(::com::sun::star::uno::RuntimeException);
111*b1cdbd2cSJim Jagielski 
112*b1cdbd2cSJim Jagielski     // XModifyListener
113*b1cdbd2cSJim Jagielski     virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
114*b1cdbd2cSJim Jagielski 
115*b1cdbd2cSJim Jagielski     // ::com::sun::star::lang::XServiceInfo
116*b1cdbd2cSJim Jagielski 	DECLIMPL_SERVICEINFO( UnoDialogControl, szServiceName2_UnoControlDialog )
117*b1cdbd2cSJim Jagielski 
118*b1cdbd2cSJim Jagielski protected:
119*b1cdbd2cSJim Jagielski    // virtual void ImplModelPropertiesChanged( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent >& rEvents ) throw(::com::sun::star::uno::RuntimeException);
120*b1cdbd2cSJim Jagielski 	virtual void PrepareWindowDescriptor( ::com::sun::star::awt::WindowDescriptor& rDesc );
121*b1cdbd2cSJim Jagielski     virtual void ImplModelPropertiesChanged( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent >& rEvents ) throw(::com::sun::star::uno::RuntimeException);
122*b1cdbd2cSJim Jagielski protected:
123*b1cdbd2cSJim Jagielski };
124*b1cdbd2cSJim Jagielski 
125*b1cdbd2cSJim Jagielski #endif // TOOLKIT_DIALOG_CONTROL_HXX
126