106bcd5d2SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 306bcd5d2SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 406bcd5d2SAndrew Rist * or more contributor license agreements. See the NOTICE file 506bcd5d2SAndrew Rist * distributed with this work for additional information 606bcd5d2SAndrew Rist * regarding copyright ownership. The ASF licenses this file 706bcd5d2SAndrew Rist * to you under the Apache License, Version 2.0 (the 806bcd5d2SAndrew Rist * "License"); you may not use this file except in compliance 906bcd5d2SAndrew Rist * with the License. You may obtain a copy of the License at 1006bcd5d2SAndrew Rist * 1106bcd5d2SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 1206bcd5d2SAndrew Rist * 1306bcd5d2SAndrew Rist * Unless required by applicable law or agreed to in writing, 1406bcd5d2SAndrew Rist * software distributed under the License is distributed on an 1506bcd5d2SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 1606bcd5d2SAndrew Rist * KIND, either express or implied. See the License for the 1706bcd5d2SAndrew Rist * specific language governing permissions and limitations 1806bcd5d2SAndrew Rist * under the License. 1906bcd5d2SAndrew Rist * 2006bcd5d2SAndrew Rist *************************************************************/ 2106bcd5d2SAndrew Rist 2206bcd5d2SAndrew 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 #include <com/sun/star/lang/XMultiServiceFactory.hpp> 30cdf0e10cSrcweir #include <com/sun/star/container/XIndexContainer.hpp> 31cdf0e10cSrcweir #include <com/sun/star/frame/XController.hpp> 32cdf0e10cSrcweir #include <com/sun/star/frame/XFrame.hpp> 33cdf0e10cSrcweir #include <com/sun/star/script/XInvocation.hpp> 34cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp> 35cdf0e10cSrcweir #include <com/sun/star/beans/XMultiPropertySet.hpp> 36cdf0e10cSrcweir #include <com/sun/star/awt/XControl.hpp> 37cdf0e10cSrcweir #include <com/sun/star/awt/XControlModel.hpp> 38cdf0e10cSrcweir #include <com/sun/star/container/XNameContainer.hpp> 39cdf0e10cSrcweir #include <com/sun/star/container/XNameAccess.hpp> 40cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp> 41cdf0e10cSrcweir #include <com/sun/star/awt/XActionListener.hpp> 42cdf0e10cSrcweir #include <com/sun/star/awt/XTextListener.hpp> 43cdf0e10cSrcweir #include <com/sun/star/awt/XButton.hpp> 44cdf0e10cSrcweir #include <com/sun/star/awt/XCheckBox.hpp> 45cdf0e10cSrcweir #include <com/sun/star/awt/XComboBox.hpp> 46cdf0e10cSrcweir #include <com/sun/star/awt/XTextComponent.hpp> 47cdf0e10cSrcweir #include <com/sun/star/awt/XRadioButton.hpp> 48cdf0e10cSrcweir #include <com/sun/star/awt/XListBox.hpp> 49cdf0e10cSrcweir #include <com/sun/star/awt/XFixedText.hpp> 50cdf0e10cSrcweir #include <com/sun/star/awt/XControlContainer.hpp> 51cdf0e10cSrcweir #include <com/sun/star/awt/XReschedule.hpp> 52cdf0e10cSrcweir #include <com/sun/star/awt/XDialog.hpp> 53cdf0e10cSrcweir #include <com/sun/star/awt/Size.hpp> 54cdf0e10cSrcweir 55cdf0e10cSrcweir // ------------- 56cdf0e10cSrcweir // - UnoDialog - 57cdf0e10cSrcweir // ------------- 58cdf0e10cSrcweir 59cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////// 60cdf0e10cSrcweir 61cdf0e10cSrcweir class UnoDialog 62cdf0e10cSrcweir { 63cdf0e10cSrcweir public : 64cdf0e10cSrcweir 65*597a4c59SAriel Constenla-Haile UnoDialog( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, 66*597a4c59SAriel Constenla-Haile const com::sun::star::uno::Reference< com::sun::star::awt::XWindowPeer >& rxParent); 67*597a4c59SAriel Constenla-Haile virtual ~UnoDialog(); 68*597a4c59SAriel Constenla-Haile void execute(); 69*597a4c59SAriel Constenla-Haile void endExecute( sal_Bool bStatus ); 70*597a4c59SAriel Constenla-Haile void setTitle( const rtl::OUString &rTitle); 71cdf0e10cSrcweir 72*597a4c59SAriel Constenla-Haile protected: 73*597a4c59SAriel Constenla-Haile void setVisible( const rtl::OUString& rName, sal_Bool bVisible ); 74*597a4c59SAriel Constenla-Haile sal_Int32 getMapsFromPixels( sal_Int32 nPixels ) const; 75*597a4c59SAriel Constenla-Haile sal_Bool isHighContrast(); 76*597a4c59SAriel Constenla-Haile void centerDialog(); 77cdf0e10cSrcweir 78*597a4c59SAriel Constenla-Haile com::sun::star::uno::Reference< com::sun::star::awt::XWindowPeer > createWindowPeer() throw ( com::sun::star::uno::Exception ); 79cdf0e10cSrcweir 80cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::uno::XInterface > insertControlModel( const rtl::OUString& rServiceName, const rtl::OUString& rName, 81cdf0e10cSrcweir const com::sun::star::uno::Sequence< rtl::OUString >& rPropertyNames, const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& rPropertyValues ); 82cdf0e10cSrcweir 83cdf0e10cSrcweir 84cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::awt::XButton > insertButton( const rtl::OUString& rName, 85cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::awt::XActionListener > xActionListener, const com::sun::star::uno::Sequence< rtl::OUString >& rPropertyNames, 86cdf0e10cSrcweir const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& rPropertyValues ); 87cdf0e10cSrcweir 88cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::awt::XFixedText > insertFixedText( const rtl::OUString& rName, 89cdf0e10cSrcweir const com::sun::star::uno::Sequence< rtl::OUString > rPropertyNames, const com::sun::star::uno::Sequence< com::sun::star::uno::Any > rPropertyValues ); 90cdf0e10cSrcweir 91cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::awt::XCheckBox > insertCheckBox( const rtl::OUString& rName, 92cdf0e10cSrcweir const com::sun::star::uno::Sequence< rtl::OUString > rPropertyNames, const com::sun::star::uno::Sequence< com::sun::star::uno::Any > rPropertyValues ); 93cdf0e10cSrcweir 94cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::awt::XControl > insertFormattedField( const rtl::OUString& rName, 95cdf0e10cSrcweir const com::sun::star::uno::Sequence< rtl::OUString > rPropertyNames, const com::sun::star::uno::Sequence< com::sun::star::uno::Any > rPropertyValues ); 96cdf0e10cSrcweir 97cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::awt::XComboBox > insertComboBox( const rtl::OUString& rName, 98cdf0e10cSrcweir const com::sun::star::uno::Sequence< rtl::OUString > rPropertyNames, const com::sun::star::uno::Sequence< com::sun::star::uno::Any > rPropertyValues ); 99cdf0e10cSrcweir 100cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::awt::XRadioButton > insertRadioButton( const rtl::OUString& rName, 101cdf0e10cSrcweir const com::sun::star::uno::Sequence< rtl::OUString > rPropertyNames, const com::sun::star::uno::Sequence< com::sun::star::uno::Any > rPropertyValues ); 102cdf0e10cSrcweir 103cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::awt::XListBox > insertListBox( const rtl::OUString& rName, 104cdf0e10cSrcweir const com::sun::star::uno::Sequence< rtl::OUString > rPropertyNames, const com::sun::star::uno::Sequence< com::sun::star::uno::Any > rPropertyValues ); 105cdf0e10cSrcweir 106cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::awt::XControl > insertImage( const rtl::OUString& rName, 107cdf0e10cSrcweir const com::sun::star::uno::Sequence< rtl::OUString > rPropertyNames, const com::sun::star::uno::Sequence< com::sun::star::uno::Any > rPropertyValues ); 108cdf0e10cSrcweir 109cdf0e10cSrcweir void setControlProperty( const rtl::OUString& rControlName, const rtl::OUString& rPropertyName, const com::sun::star::uno::Any& rPropertyValue ); 110cdf0e10cSrcweir com::sun::star::uno::Any getControlProperty( const rtl::OUString& rControlName, const rtl::OUString& rPropertyName ); 111cdf0e10cSrcweir void enableControl( const rtl::OUString& rControlName ); 112cdf0e10cSrcweir void disableControl( const rtl::OUString& rControlName ); 113cdf0e10cSrcweir 114*597a4c59SAriel Constenla-Haile protected: 115*597a4c59SAriel Constenla-Haile 116*597a4c59SAriel Constenla-Haile com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxContext; 117*597a4c59SAriel Constenla-Haile com::sun::star::uno::Reference< com::sun::star::awt::XWindowPeer > mxParent; 118cdf0e10cSrcweir 119cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::uno::XInterface > mxDialogModel; 120cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::beans::XMultiPropertySet > mxDialogModelMultiPropertySet; 121cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > mxDialogModelPropertySet; 122cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > mxDialogModelMSF; 123cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::container::XNameContainer > mxDialogModelNameContainer; 124cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > mxDialogModelNameAccess; 125cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::awt::XControlModel > mxControlModel; 126cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::awt::XDialog > mxDialog; 127cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::awt::XControl > mxControl; 128*597a4c59SAriel Constenla-Haile sal_Bool mbStatus; 129cdf0e10cSrcweir 130cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::awt::XControlContainer > mxDialogControlContainer; 131cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::awt::XWindow > mxDialogWindow; 132*597a4c59SAriel Constenla-Haile com::sun::star::uno::Reference< com::sun::star::awt::XWindowPeer > mxDialogWindowPeer; 133cdf0e10cSrcweir 134*597a4c59SAriel Constenla-Haile com::sun::star::uno::Reference< com::sun::star::awt::XReschedule > mxReschedule; 135cdf0e10cSrcweir }; 136cdf0e10cSrcweir 137cdf0e10cSrcweir #endif // UNODIALOG_HXX 138