xref: /AOO41X/main/sdext/source/minimizer/unodialog.hxx (revision 06bcd5d2ad5bea957b02aca5287e5203820c7f8c)
1*06bcd5d2SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*06bcd5d2SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*06bcd5d2SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*06bcd5d2SAndrew Rist  * distributed with this work for additional information
6*06bcd5d2SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*06bcd5d2SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*06bcd5d2SAndrew Rist  * "License"); you may not use this file except in compliance
9*06bcd5d2SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*06bcd5d2SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*06bcd5d2SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*06bcd5d2SAndrew Rist  * software distributed under the License is distributed on an
15*06bcd5d2SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*06bcd5d2SAndrew Rist  * KIND, either express or implied.  See the License for the
17*06bcd5d2SAndrew Rist  * specific language governing permissions and limitations
18*06bcd5d2SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*06bcd5d2SAndrew Rist  *************************************************************/
21*06bcd5d2SAndrew Rist 
22*06bcd5d2SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef UNODIALOG_HXX
25cdf0e10cSrcweir #define UNODIALOG_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.h>
28cdf0e10cSrcweir #include <com/sun/star/lang/XSingleServiceFactory.hpp>
29cdf0e10cSrcweir #ifndef _COM_SUN_STAR_LANG_XMULTI_COMPONENT_FACTORY_HPP_
30cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp>
31cdf0e10cSrcweir #endif
32cdf0e10cSrcweir #include <com/sun/star/container/XIndexContainer.hpp>
33cdf0e10cSrcweir #include <com/sun/star/frame/XController.hpp>
34cdf0e10cSrcweir #include <com/sun/star/frame/XFrame.hpp>
35cdf0e10cSrcweir #include <com/sun/star/script/XInvocation.hpp>
36cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp>
37cdf0e10cSrcweir #include <com/sun/star/beans/XMultiPropertySet.hpp>
38cdf0e10cSrcweir #include <com/sun/star/awt/XControl.hpp>
39cdf0e10cSrcweir #include <com/sun/star/awt/XControlModel.hpp>
40cdf0e10cSrcweir #include <com/sun/star/container/XNameContainer.hpp>
41cdf0e10cSrcweir #include <com/sun/star/container/XNameAccess.hpp>
42cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp>
43cdf0e10cSrcweir #include <com/sun/star/awt/XActionListener.hpp>
44cdf0e10cSrcweir #include <com/sun/star/awt/XTextListener.hpp>
45cdf0e10cSrcweir #include <com/sun/star/awt/XButton.hpp>
46cdf0e10cSrcweir #include <com/sun/star/awt/XCheckBox.hpp>
47cdf0e10cSrcweir #include <com/sun/star/awt/XComboBox.hpp>
48cdf0e10cSrcweir #include <com/sun/star/awt/XTextComponent.hpp>
49cdf0e10cSrcweir #include <com/sun/star/awt/XRadioButton.hpp>
50cdf0e10cSrcweir #include <com/sun/star/awt/XListBox.hpp>
51cdf0e10cSrcweir #include <com/sun/star/awt/XFixedText.hpp>
52cdf0e10cSrcweir #include <com/sun/star/awt/XControlContainer.hpp>
53cdf0e10cSrcweir #include <com/sun/star/awt/XReschedule.hpp>
54cdf0e10cSrcweir #include <com/sun/star/awt/XDialog.hpp>
55cdf0e10cSrcweir #include <com/sun/star/awt/Size.hpp>
56cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx>
57cdf0e10cSrcweir #include <cppuhelper/implbase2.hxx>
58cdf0e10cSrcweir #include <cppuhelper/implbase3.hxx>
59cdf0e10cSrcweir 
60cdf0e10cSrcweir // -------------
61cdf0e10cSrcweir // - UnoDialog -
62cdf0e10cSrcweir // -------------
63cdf0e10cSrcweir 
64cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////
65cdf0e10cSrcweir 
66cdf0e10cSrcweir class UnoDialog
67cdf0e10cSrcweir {
68cdf0e10cSrcweir public :
69cdf0e10cSrcweir 
70cdf0e10cSrcweir 	UnoDialog( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxMSF, com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rxFrame );
71cdf0e10cSrcweir     ~UnoDialog();
72cdf0e10cSrcweir 
73cdf0e10cSrcweir 	void execute();
74cdf0e10cSrcweir 	void endExecute( sal_Bool bStatus );
75cdf0e10cSrcweir 
76cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::awt::XWindowPeer > createWindowPeer( com::sun::star::uno::Reference< com::sun::star::awt::XWindowPeer > xParentPeer )
77cdf0e10cSrcweir 		throw ( com::sun::star::uno::Exception );
78cdf0e10cSrcweir 
79cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::uno::XInterface > insertControlModel( const rtl::OUString& rServiceName, const rtl::OUString& rName,
80cdf0e10cSrcweir 		const com::sun::star::uno::Sequence< rtl::OUString >& rPropertyNames, const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& rPropertyValues );
81cdf0e10cSrcweir 
82cdf0e10cSrcweir 	void setVisible( const rtl::OUString& rName, sal_Bool bVisible );
83cdf0e10cSrcweir 
84cdf0e10cSrcweir 	sal_Bool isHighContrast();
85cdf0e10cSrcweir 
86cdf0e10cSrcweir 	sal_Int32 getMapsFromPixels( sal_Int32 nPixels ) const;
87cdf0e10cSrcweir 
88cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::awt::XButton > insertButton( const rtl::OUString& rName,
89cdf0e10cSrcweir 		com::sun::star::uno::Reference< com::sun::star::awt::XActionListener > xActionListener, const com::sun::star::uno::Sequence< rtl::OUString >& rPropertyNames,
90cdf0e10cSrcweir 			const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& rPropertyValues );
91cdf0e10cSrcweir 
92cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::awt::XFixedText > insertFixedText( const rtl::OUString& rName,
93cdf0e10cSrcweir 		const com::sun::star::uno::Sequence< rtl::OUString > rPropertyNames, const com::sun::star::uno::Sequence< com::sun::star::uno::Any > rPropertyValues );
94cdf0e10cSrcweir 
95cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::awt::XCheckBox > insertCheckBox( const rtl::OUString& rName,
96cdf0e10cSrcweir 		const com::sun::star::uno::Sequence< rtl::OUString > rPropertyNames, const com::sun::star::uno::Sequence< com::sun::star::uno::Any > rPropertyValues );
97cdf0e10cSrcweir 
98cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::awt::XControl > insertFormattedField( const rtl::OUString& rName,
99cdf0e10cSrcweir 		const com::sun::star::uno::Sequence< rtl::OUString > rPropertyNames, const com::sun::star::uno::Sequence< com::sun::star::uno::Any > rPropertyValues );
100cdf0e10cSrcweir 
101cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::awt::XComboBox > insertComboBox( const rtl::OUString& rName,
102cdf0e10cSrcweir 		const com::sun::star::uno::Sequence< rtl::OUString > rPropertyNames, const com::sun::star::uno::Sequence< com::sun::star::uno::Any > rPropertyValues );
103cdf0e10cSrcweir 
104cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::awt::XRadioButton > insertRadioButton( const rtl::OUString& rName,
105cdf0e10cSrcweir 		const com::sun::star::uno::Sequence< rtl::OUString > rPropertyNames, const com::sun::star::uno::Sequence< com::sun::star::uno::Any > rPropertyValues );
106cdf0e10cSrcweir 
107cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::awt::XListBox > insertListBox( const rtl::OUString& rName,
108cdf0e10cSrcweir 		const com::sun::star::uno::Sequence< rtl::OUString > rPropertyNames, const com::sun::star::uno::Sequence< com::sun::star::uno::Any > rPropertyValues );
109cdf0e10cSrcweir 
110cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::awt::XControl > insertImage( const rtl::OUString& rName,
111cdf0e10cSrcweir 		const com::sun::star::uno::Sequence< rtl::OUString > rPropertyNames, const com::sun::star::uno::Sequence< com::sun::star::uno::Any > rPropertyValues );
112cdf0e10cSrcweir 
113cdf0e10cSrcweir 	void setControlProperty( const rtl::OUString& rControlName, const rtl::OUString& rPropertyName, const com::sun::star::uno::Any& rPropertyValue );
114cdf0e10cSrcweir 	com::sun::star::uno::Any getControlProperty( const rtl::OUString& rControlName, const rtl::OUString& rPropertyName );
115cdf0e10cSrcweir #if 0
116cdf0e10cSrcweir 	void showMessageBox( const rtl::OUString& rTitle, const rtl::OUString& rMessage, sal_Bool bErrorBox ) const;
117cdf0e10cSrcweir #endif
118cdf0e10cSrcweir 	void enableControl( const rtl::OUString& rControlName );
119cdf0e10cSrcweir 	void disableControl( const rtl::OUString& rControlName );
120cdf0e10cSrcweir 
121cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >		mxMSF;
122cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::frame::XController >			mxController;
123cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::awt::XReschedule >				mxReschedule;
124cdf0e10cSrcweir 
125cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::uno::XInterface >				mxDialogModel;
126cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::beans::XMultiPropertySet >		mxDialogModelMultiPropertySet;
127cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >			mxDialogModelPropertySet;
128cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >	mxDialogModelMSF;
129cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::container::XNameContainer >		mxDialogModelNameContainer;
130cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >		mxDialogModelNameAccess;
131cdf0e10cSrcweir 
132cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::awt::XControlModel >			mxControlModel;
133cdf0e10cSrcweir 
134cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::awt::XDialog >					mxDialog;
135cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::awt::XControl >					mxControl;
136cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::awt::XWindowPeer >				mxWindowPeer;
137cdf0e10cSrcweir 
138cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::awt::XControlContainer >		mxDialogControlContainer;
139cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::lang::XComponent >				mxDialogComponent;
140cdf0e10cSrcweir 	com::sun::star::uno::Reference< com::sun::star::awt::XWindow >					mxDialogWindow;
141cdf0e10cSrcweir 
142cdf0e10cSrcweir 	sal_Bool																		mbStatus;
143cdf0e10cSrcweir };
144cdf0e10cSrcweir 
145cdf0e10cSrcweir #endif // UNODIALOG_HXX
146