xref: /AOO41X/main/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx (revision cde9e8dc2218e857da4894ecba5c903312256674)
1*cde9e8dcSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*cde9e8dcSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*cde9e8dcSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*cde9e8dcSAndrew Rist  * distributed with this work for additional information
6*cde9e8dcSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*cde9e8dcSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*cde9e8dcSAndrew Rist  * "License"); you may not use this file except in compliance
9*cde9e8dcSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*cde9e8dcSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*cde9e8dcSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*cde9e8dcSAndrew Rist  * software distributed under the License is distributed on an
15*cde9e8dcSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*cde9e8dcSAndrew Rist  * KIND, either express or implied.  See the License for the
17*cde9e8dcSAndrew Rist  * specific language governing permissions and limitations
18*cde9e8dcSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*cde9e8dcSAndrew Rist  *************************************************************/
21*cde9e8dcSAndrew Rist 
22*cde9e8dcSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_chart2.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "dlg_CreationWizard_UNO.hxx"
28cdf0e10cSrcweir #include "dlg_CreationWizard.hxx"
29cdf0e10cSrcweir #include "macros.hxx"
30cdf0e10cSrcweir #include "servicenames.hxx"
31cdf0e10cSrcweir #include "ContainerHelper.hxx"
32cdf0e10cSrcweir #include "TimerTriggeredControllerLock.hxx"
33cdf0e10cSrcweir #include <osl/mutex.hxx>
34cdf0e10cSrcweir #include <vos/mutex.hxx>
35cdf0e10cSrcweir // header for class Application
36cdf0e10cSrcweir #include <vcl/svapp.hxx>
37cdf0e10cSrcweir #include <toolkit/awt/vclxwindow.hxx>
38cdf0e10cSrcweir // header for define RET_CANCEL
39cdf0e10cSrcweir #include <vcl/msgbox.hxx>
40cdf0e10cSrcweir // header for class OImplementationId
41cdf0e10cSrcweir #include <cppuhelper/typeprovider.hxx>
42cdf0e10cSrcweir #include <com/sun/star/awt/Point.hpp>
43cdf0e10cSrcweir #include <com/sun/star/awt/Size.hpp>
44cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp>
45cdf0e10cSrcweir #include <com/sun/star/frame/XDesktop.hpp>
46cdf0e10cSrcweir 
47cdf0e10cSrcweir //.............................................................................
48cdf0e10cSrcweir namespace chart
49cdf0e10cSrcweir {
50cdf0e10cSrcweir //.............................................................................
51cdf0e10cSrcweir using namespace ::com::sun::star;
52cdf0e10cSrcweir 
CreationWizardUnoDlg(const uno::Reference<uno::XComponentContext> & xContext)53cdf0e10cSrcweir CreationWizardUnoDlg::CreationWizardUnoDlg( const uno::Reference< uno::XComponentContext >& xContext )
54cdf0e10cSrcweir                     : OComponentHelper( m_aMutex )
55cdf0e10cSrcweir                     , m_xChartModel( 0 )
56cdf0e10cSrcweir                     , m_xCC( xContext )
57cdf0e10cSrcweir                     , m_xParentWindow( 0 )
58cdf0e10cSrcweir                     , m_pDialog( 0 )
59cdf0e10cSrcweir                     , m_bUnlockControllersOnExecute(false)
60cdf0e10cSrcweir {
61cdf0e10cSrcweir     uno::Reference< frame::XDesktop > xDesktop(
62cdf0e10cSrcweir         m_xCC->getServiceManager()->createInstanceWithContext(
63cdf0e10cSrcweir             C2U( "com.sun.star.frame.Desktop" ), m_xCC ), uno::UNO_QUERY );
64cdf0e10cSrcweir 	if( xDesktop.is() )
65cdf0e10cSrcweir 	{
66cdf0e10cSrcweir         uno::Reference< frame::XTerminateListener > xListener( this );
67cdf0e10cSrcweir 		xDesktop->addTerminateListener( xListener );
68cdf0e10cSrcweir 	}
69cdf0e10cSrcweir }
~CreationWizardUnoDlg()70cdf0e10cSrcweir CreationWizardUnoDlg::~CreationWizardUnoDlg()
71cdf0e10cSrcweir {
72cdf0e10cSrcweir     ::vos::OGuard aSolarGuard( Application::GetSolarMutex());
73cdf0e10cSrcweir 	if( m_pDialog )
74cdf0e10cSrcweir 	{
75cdf0e10cSrcweir 		delete m_pDialog;
76cdf0e10cSrcweir 		m_pDialog = 0;
77cdf0e10cSrcweir 	}
78cdf0e10cSrcweir }
79cdf0e10cSrcweir //-------------------------------------------------------------------------
80cdf0e10cSrcweir // lang::XServiceInfo
APPHELPER_XSERVICEINFO_IMPL(CreationWizardUnoDlg,CHART_WIZARD_DIALOG_SERVICE_IMPLEMENTATION_NAME)81cdf0e10cSrcweir APPHELPER_XSERVICEINFO_IMPL(CreationWizardUnoDlg,CHART_WIZARD_DIALOG_SERVICE_IMPLEMENTATION_NAME)
82cdf0e10cSrcweir 
83cdf0e10cSrcweir     uno::Sequence< rtl::OUString > CreationWizardUnoDlg
84cdf0e10cSrcweir ::getSupportedServiceNames_Static()
85cdf0e10cSrcweir {
86cdf0e10cSrcweir 	uno::Sequence< rtl::OUString > aSNS( 1 );
87cdf0e10cSrcweir 	aSNS.getArray()[ 0 ] = CHART_WIZARD_DIALOG_SERVICE_NAME;
88cdf0e10cSrcweir 	return aSNS;
89cdf0e10cSrcweir }
90cdf0e10cSrcweir 
91cdf0e10cSrcweir //-------------------------------------------------------------------------
92cdf0e10cSrcweir // XInterface
queryInterface(const uno::Type & aType)93cdf0e10cSrcweir uno::Any SAL_CALL CreationWizardUnoDlg::queryInterface( const uno::Type& aType ) throw (uno::RuntimeException)
94cdf0e10cSrcweir {
95cdf0e10cSrcweir 	return OComponentHelper::queryInterface( aType );
96cdf0e10cSrcweir }
acquire()97cdf0e10cSrcweir void SAL_CALL CreationWizardUnoDlg::acquire() throw ()
98cdf0e10cSrcweir {
99cdf0e10cSrcweir     OComponentHelper::acquire();
100cdf0e10cSrcweir }
release()101cdf0e10cSrcweir void SAL_CALL CreationWizardUnoDlg::release() throw ()
102cdf0e10cSrcweir {
103cdf0e10cSrcweir     OComponentHelper::release();
104cdf0e10cSrcweir }
queryAggregation(uno::Type const & rType)105cdf0e10cSrcweir uno::Any SAL_CALL CreationWizardUnoDlg::queryAggregation( uno::Type const & rType ) throw (uno::RuntimeException)
106cdf0e10cSrcweir {
107cdf0e10cSrcweir     if (rType == ::getCppuType( (uno::Reference< ui::dialogs::XExecutableDialog > const *)0 ))
108cdf0e10cSrcweir     {
109cdf0e10cSrcweir         void * p = static_cast< ui::dialogs::XExecutableDialog * >( this );
110cdf0e10cSrcweir         return uno::Any( &p, rType );
111cdf0e10cSrcweir     }
112cdf0e10cSrcweir     else if (rType == ::getCppuType( (uno::Reference< lang::XServiceInfo > const *)0 ))
113cdf0e10cSrcweir     {
114cdf0e10cSrcweir         void * p = static_cast< lang::XTypeProvider * >( this );
115cdf0e10cSrcweir         return uno::Any( &p, rType );
116cdf0e10cSrcweir     }
117cdf0e10cSrcweir     else if (rType == ::getCppuType( (uno::Reference< lang::XInitialization > const *)0 ))
118cdf0e10cSrcweir     {
119cdf0e10cSrcweir         void * p = static_cast< lang::XInitialization * >( this );
120cdf0e10cSrcweir         return uno::Any( &p, rType );
121cdf0e10cSrcweir     }
122cdf0e10cSrcweir 	else if (rType == ::getCppuType( (uno::Reference< frame::XTerminateListener > const *)0 ))
123cdf0e10cSrcweir 	{
124cdf0e10cSrcweir         void * p = static_cast< frame::XTerminateListener * >( this );
125cdf0e10cSrcweir         return uno::Any( &p, rType );
126cdf0e10cSrcweir 	}
127cdf0e10cSrcweir     else if (rType == ::getCppuType( (uno::Reference< beans::XPropertySet > const *)0 ))
128cdf0e10cSrcweir 	{
129cdf0e10cSrcweir         void * p = static_cast< beans::XPropertySet * >( this );
130cdf0e10cSrcweir         return uno::Any( &p, rType );
131cdf0e10cSrcweir 	}
132cdf0e10cSrcweir     return OComponentHelper::queryAggregation( rType );
133cdf0e10cSrcweir }
134cdf0e10cSrcweir 
135cdf0e10cSrcweir //-------------------------------------------------------------------------
136cdf0e10cSrcweir #define LCL_CPPUTYPE(t) (::getCppuType( reinterpret_cast< const uno::Reference<t> *>(0)))
137cdf0e10cSrcweir 
getTypes()138cdf0e10cSrcweir uno::Sequence< uno::Type > CreationWizardUnoDlg::getTypes() throw(uno::RuntimeException)
139cdf0e10cSrcweir {
140cdf0e10cSrcweir     static uno::Sequence< uno::Type > aTypeList;
141cdf0e10cSrcweir 
142cdf0e10cSrcweir     // /--
143cdf0e10cSrcweir     ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
144cdf0e10cSrcweir 	if( !aTypeList.getLength() )
145cdf0e10cSrcweir 	{
146cdf0e10cSrcweir         ::std::vector< uno::Type > aTypes;
147cdf0e10cSrcweir         aTypes.push_back( LCL_CPPUTYPE( lang::XComponent ));
148cdf0e10cSrcweir         aTypes.push_back( LCL_CPPUTYPE( lang::XTypeProvider ));
149cdf0e10cSrcweir         aTypes.push_back( LCL_CPPUTYPE( uno::XAggregation ));
150cdf0e10cSrcweir         aTypes.push_back( LCL_CPPUTYPE( uno::XWeak ));
151cdf0e10cSrcweir         aTypes.push_back( LCL_CPPUTYPE( lang::XServiceInfo ));
152cdf0e10cSrcweir         aTypes.push_back( LCL_CPPUTYPE( lang::XInitialization ));
153cdf0e10cSrcweir         aTypes.push_back( LCL_CPPUTYPE( frame::XTerminateListener ));
154cdf0e10cSrcweir         aTypes.push_back( LCL_CPPUTYPE( ui::dialogs::XExecutableDialog ));
155cdf0e10cSrcweir         aTypes.push_back( LCL_CPPUTYPE( beans::XPropertySet ));
156cdf0e10cSrcweir 		aTypeList = ::chart::ContainerHelper::ContainerToSequence( aTypes );
157cdf0e10cSrcweir 	}
158cdf0e10cSrcweir 
159cdf0e10cSrcweir 	return aTypeList;
160cdf0e10cSrcweir     // \--
161cdf0e10cSrcweir }
getImplementationId(void)162cdf0e10cSrcweir uno::Sequence< sal_Int8 > SAL_CALL CreationWizardUnoDlg::getImplementationId( void ) throw( uno::RuntimeException )
163cdf0e10cSrcweir {
164cdf0e10cSrcweir     static uno::Sequence< sal_Int8 > aId;
165cdf0e10cSrcweir 	if( aId.getLength() == 0 )
166cdf0e10cSrcweir 	{
167cdf0e10cSrcweir 		aId.realloc( 16 );
168cdf0e10cSrcweir 		rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True );
169cdf0e10cSrcweir 	}
170cdf0e10cSrcweir 	return aId;
171cdf0e10cSrcweir }
172cdf0e10cSrcweir 
173cdf0e10cSrcweir //-------------------------------------------------------------------------
174cdf0e10cSrcweir 
175cdf0e10cSrcweir // XTerminateListener
queryTermination(const lang::EventObject &)176cdf0e10cSrcweir void SAL_CALL CreationWizardUnoDlg::queryTermination( const lang::EventObject& /*Event*/ ) throw( frame::TerminationVetoException, uno::RuntimeException)
177cdf0e10cSrcweir {
178cdf0e10cSrcweir 	::vos::OGuard aSolarGuard( Application::GetSolarMutex());
179cdf0e10cSrcweir 
180cdf0e10cSrcweir 	// we will never give a veto here
181cdf0e10cSrcweir 	if( m_pDialog && !m_pDialog->isClosable() )
182cdf0e10cSrcweir 	{
183cdf0e10cSrcweir 		m_pDialog->ToTop();
184cdf0e10cSrcweir 		throw frame::TerminationVetoException();
185cdf0e10cSrcweir 	}
186cdf0e10cSrcweir }
187cdf0e10cSrcweir 
188cdf0e10cSrcweir //-------------------------------------------------------------------------
189cdf0e10cSrcweir 
notifyTermination(const lang::EventObject &)190cdf0e10cSrcweir void SAL_CALL CreationWizardUnoDlg::notifyTermination( const lang::EventObject& /*Event*/ ) throw (uno::RuntimeException)
191cdf0e10cSrcweir {
192cdf0e10cSrcweir 	// we are going down, so dispose us!
193cdf0e10cSrcweir 	dispose();
194cdf0e10cSrcweir }
195cdf0e10cSrcweir 
disposing(const lang::EventObject &)196cdf0e10cSrcweir void SAL_CALL CreationWizardUnoDlg::disposing( const lang::EventObject& /*Source*/ ) throw (uno::RuntimeException)
197cdf0e10cSrcweir {
198cdf0e10cSrcweir     //Listener should deregister himself and relaese all references to the closing object.
199cdf0e10cSrcweir }
200cdf0e10cSrcweir 
201cdf0e10cSrcweir //-------------------------------------------------------------------------
setTitle(const::rtl::OUString &)202cdf0e10cSrcweir void SAL_CALL CreationWizardUnoDlg::setTitle( const ::rtl::OUString& /*rTitle*/ ) throw(uno::RuntimeException)
203cdf0e10cSrcweir {
204cdf0e10cSrcweir }
205cdf0e10cSrcweir //-------------------------------------------------------------------------
createDialogOnDemand()206cdf0e10cSrcweir void CreationWizardUnoDlg::createDialogOnDemand()
207cdf0e10cSrcweir {
208cdf0e10cSrcweir     ::vos::OGuard aSolarGuard( Application::GetSolarMutex());
209cdf0e10cSrcweir 	if( !m_pDialog )
210cdf0e10cSrcweir 	{
211cdf0e10cSrcweir 		Window* pParent = NULL;
212cdf0e10cSrcweir         if( !m_xParentWindow.is() && m_xChartModel.is() )
213cdf0e10cSrcweir         {
214cdf0e10cSrcweir             uno::Reference< frame::XController > xController(
215cdf0e10cSrcweir                 m_xChartModel->getCurrentController() );
216cdf0e10cSrcweir             if( xController.is() )
217cdf0e10cSrcweir             {
218cdf0e10cSrcweir                 uno::Reference< frame::XFrame > xFrame(
219cdf0e10cSrcweir                     xController->getFrame() );
220cdf0e10cSrcweir                 if(xFrame.is())
221cdf0e10cSrcweir                     m_xParentWindow = xFrame->getContainerWindow();
222cdf0e10cSrcweir             }
223cdf0e10cSrcweir         }
224cdf0e10cSrcweir 		if( m_xParentWindow.is() )
225cdf0e10cSrcweir 		{
226cdf0e10cSrcweir 			VCLXWindow* pImplementation = VCLXWindow::GetImplementation(m_xParentWindow);
227cdf0e10cSrcweir 			if (pImplementation)
228cdf0e10cSrcweir 				pParent = pImplementation->GetWindow();
229cdf0e10cSrcweir 		}
230cdf0e10cSrcweir         uno::Reference< XComponent > xComp( this );
231cdf0e10cSrcweir         if( m_xChartModel.is() )
232cdf0e10cSrcweir         {
233cdf0e10cSrcweir 		    m_pDialog = new CreationWizard( pParent, m_xChartModel, m_xCC );
234cdf0e10cSrcweir             m_pDialog->AddEventListener( LINK( this, CreationWizardUnoDlg, DialogEventHdl ) );
235cdf0e10cSrcweir         }
236cdf0e10cSrcweir 	}
237cdf0e10cSrcweir }
238cdf0e10cSrcweir //-------------------------------------------------------------------------
IMPL_LINK(CreationWizardUnoDlg,DialogEventHdl,VclWindowEvent *,pEvent)239cdf0e10cSrcweir IMPL_LINK( CreationWizardUnoDlg, DialogEventHdl, VclWindowEvent*, pEvent )
240cdf0e10cSrcweir {
241cdf0e10cSrcweir     if(pEvent && (pEvent->GetId() == VCLEVENT_OBJECT_DYING) )
242cdf0e10cSrcweir         m_pDialog = 0;//avoid duplicate destruction of m_pDialog
243cdf0e10cSrcweir     return 0;
244cdf0e10cSrcweir }
245cdf0e10cSrcweir 
246cdf0e10cSrcweir //-------------------------------------------------------------------------
execute()247cdf0e10cSrcweir sal_Int16 SAL_CALL CreationWizardUnoDlg::execute(  ) throw(uno::RuntimeException)
248cdf0e10cSrcweir {
249cdf0e10cSrcweir     sal_Int16 nRet = RET_CANCEL;
250cdf0e10cSrcweir     {
251cdf0e10cSrcweir         ::vos::OGuard aSolarGuard( Application::GetSolarMutex());
252cdf0e10cSrcweir         createDialogOnDemand();
253cdf0e10cSrcweir         if( !m_pDialog )
254cdf0e10cSrcweir             return nRet;
255cdf0e10cSrcweir         TimerTriggeredControllerLock aTimerTriggeredControllerLock( m_xChartModel );
256cdf0e10cSrcweir         if( m_bUnlockControllersOnExecute && m_xChartModel.is() )
257cdf0e10cSrcweir             m_xChartModel->unlockControllers();
258cdf0e10cSrcweir         nRet = m_pDialog->Execute();
259cdf0e10cSrcweir     }
260cdf0e10cSrcweir     return nRet;
261cdf0e10cSrcweir }
262cdf0e10cSrcweir 
263cdf0e10cSrcweir //-------------------------------------------------------------------------
initialize(const uno::Sequence<uno::Any> & aArguments)264cdf0e10cSrcweir void SAL_CALL CreationWizardUnoDlg::initialize( const uno::Sequence< uno::Any >& aArguments ) throw(uno::Exception, uno::RuntimeException)
265cdf0e10cSrcweir {
266cdf0e10cSrcweir 	const uno::Any* pArguments = aArguments.getConstArray();
267cdf0e10cSrcweir 	for(sal_Int32 i=0; i<aArguments.getLength(); ++i, ++pArguments)
268cdf0e10cSrcweir 	{
269cdf0e10cSrcweir         beans::PropertyValue aProperty;
270cdf0e10cSrcweir 		if(*pArguments >>= aProperty)
271cdf0e10cSrcweir 		{
272cdf0e10cSrcweir 			if( aProperty.Name.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "ParentWindow" ) ) == 0 )
273cdf0e10cSrcweir 			{
274cdf0e10cSrcweir 				aProperty.Value >>= m_xParentWindow;
275cdf0e10cSrcweir 			}
276cdf0e10cSrcweir             else if( aProperty.Name.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "ChartModel" ) ) == 0 )
277cdf0e10cSrcweir 			{
278cdf0e10cSrcweir 				aProperty.Value >>= m_xChartModel;
279cdf0e10cSrcweir 			}
280cdf0e10cSrcweir 		}
281cdf0e10cSrcweir 	}
282cdf0e10cSrcweir }
283cdf0e10cSrcweir 
284cdf0e10cSrcweir //-------------------------------------------------------------------------
285cdf0e10cSrcweir // ____ OComponentHelper ____
286cdf0e10cSrcweir /// Called in dispose method after the listeners were notified.
disposing()287cdf0e10cSrcweir void SAL_CALL CreationWizardUnoDlg::disposing()
288cdf0e10cSrcweir {
289cdf0e10cSrcweir     m_xChartModel.clear();
290cdf0e10cSrcweir     m_xParentWindow.clear();
291cdf0e10cSrcweir 
292cdf0e10cSrcweir     // /--
293cdf0e10cSrcweir     ::vos::OGuard aSolarGuard( Application::GetSolarMutex());
294cdf0e10cSrcweir     if( m_pDialog )
295cdf0e10cSrcweir     {
296cdf0e10cSrcweir         delete m_pDialog;
297cdf0e10cSrcweir         m_pDialog = 0;
298cdf0e10cSrcweir     }
299cdf0e10cSrcweir 
300cdf0e10cSrcweir     try
301cdf0e10cSrcweir     {
302cdf0e10cSrcweir         uno::Reference< frame::XDesktop > xDesktop(
303cdf0e10cSrcweir             m_xCC->getServiceManager()->createInstanceWithContext(
304cdf0e10cSrcweir                 C2U( "com.sun.star.frame.Desktop" ), m_xCC ), uno::UNO_QUERY );
305cdf0e10cSrcweir         if( xDesktop.is() )
306cdf0e10cSrcweir         {
307cdf0e10cSrcweir             uno::Reference< frame::XTerminateListener > xListener( this );
308cdf0e10cSrcweir             xDesktop->removeTerminateListener( xListener );
309cdf0e10cSrcweir         }
310cdf0e10cSrcweir     }
311cdf0e10cSrcweir     catch( const uno::Exception & ex )
312cdf0e10cSrcweir     {
313cdf0e10cSrcweir         ASSERT_EXCEPTION( ex );
314cdf0e10cSrcweir     }
315cdf0e10cSrcweir     // \--
316cdf0e10cSrcweir }
317cdf0e10cSrcweir 
318cdf0e10cSrcweir //XPropertySet
getPropertySetInfo()319cdf0e10cSrcweir uno::Reference< beans::XPropertySetInfo > SAL_CALL CreationWizardUnoDlg::getPropertySetInfo()
320cdf0e10cSrcweir     throw (uno::RuntimeException)
321cdf0e10cSrcweir {
322cdf0e10cSrcweir     OSL_ENSURE(false,"not implemented");
323cdf0e10cSrcweir     return 0;
324cdf0e10cSrcweir }
325cdf0e10cSrcweir 
setPropertyValue(const::rtl::OUString & rPropertyName,const uno::Any & rValue)326cdf0e10cSrcweir void SAL_CALL CreationWizardUnoDlg::setPropertyValue( const ::rtl::OUString& rPropertyName
327cdf0e10cSrcweir                                                      , const uno::Any& rValue )
328cdf0e10cSrcweir     throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException
329cdf0e10cSrcweir           , lang::WrappedTargetException, uno::RuntimeException)
330cdf0e10cSrcweir {
331cdf0e10cSrcweir     if( rPropertyName.equals(C2U("Position")) )
332cdf0e10cSrcweir     {
333cdf0e10cSrcweir         awt::Point aPos;
334cdf0e10cSrcweir         if( ! (rValue >>= aPos) )
335cdf0e10cSrcweir             throw lang::IllegalArgumentException( C2U("Property 'Position' requires value of type awt::Point"), 0, 0 );
336cdf0e10cSrcweir 
337cdf0e10cSrcweir         //set left upper outer corner relative to screen
338cdf0e10cSrcweir         //pixels, screen position
339cdf0e10cSrcweir         ::vos::OGuard aSolarGuard( Application::GetSolarMutex());
340cdf0e10cSrcweir         createDialogOnDemand();
341cdf0e10cSrcweir         if( m_pDialog )
342cdf0e10cSrcweir         {
343cdf0e10cSrcweir             m_pDialog->SetPosPixel( Point(0,0) );
344cdf0e10cSrcweir             Rectangle aRect( m_pDialog->GetWindowExtentsRelative( 0 ) );
345cdf0e10cSrcweir 
346cdf0e10cSrcweir             Point aNewOuterPos = Point( aPos.X - aRect.Left(), aPos.Y - aRect.Top() );
347cdf0e10cSrcweir             m_pDialog->SetPosPixel( aNewOuterPos );
348cdf0e10cSrcweir         }
349cdf0e10cSrcweir     }
350cdf0e10cSrcweir     else if( rPropertyName.equals(C2U("Size")) )
351cdf0e10cSrcweir     {
352cdf0e10cSrcweir         //read only property, do nothing
353cdf0e10cSrcweir     }
354cdf0e10cSrcweir     else if( rPropertyName.equals(C2U("UnlockControllersOnExecute")) )
355cdf0e10cSrcweir     {
356cdf0e10cSrcweir         if( ! (rValue >>= m_bUnlockControllersOnExecute) )
357cdf0e10cSrcweir             throw lang::IllegalArgumentException( C2U("Property 'UnlockControllers' requires value of type boolean"), 0, 0 );
358cdf0e10cSrcweir     }
359cdf0e10cSrcweir     else
360cdf0e10cSrcweir         throw beans::UnknownPropertyException( C2U("unknown property was tried to set to chart wizard"), 0 );
361cdf0e10cSrcweir }
362cdf0e10cSrcweir 
getPropertyValue(const::rtl::OUString & rPropertyName)363cdf0e10cSrcweir uno::Any SAL_CALL CreationWizardUnoDlg::getPropertyValue( const ::rtl::OUString& rPropertyName )
364cdf0e10cSrcweir     throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
365cdf0e10cSrcweir {
366cdf0e10cSrcweir     uno::Any aRet;
367cdf0e10cSrcweir     if( rPropertyName.equals(C2U("Position")) )
368cdf0e10cSrcweir     {
369cdf0e10cSrcweir         //get left upper outer corner relative to screen
370cdf0e10cSrcweir         //pixels, screen position
371cdf0e10cSrcweir         ::vos::OGuard aSolarGuard( Application::GetSolarMutex());
372cdf0e10cSrcweir         createDialogOnDemand();
373cdf0e10cSrcweir         if( m_pDialog )
374cdf0e10cSrcweir         {
375cdf0e10cSrcweir             Rectangle aRect( m_pDialog->GetWindowExtentsRelative( 0 ) );
376cdf0e10cSrcweir             awt::Point aPoint(aRect.Left(),aRect.Top());
377cdf0e10cSrcweir             aRet = uno::makeAny( aPoint );
378cdf0e10cSrcweir         }
379cdf0e10cSrcweir     }
380cdf0e10cSrcweir     else if( rPropertyName.equals(C2U("Size")) )
381cdf0e10cSrcweir     {
382cdf0e10cSrcweir         //get outer size inclusive decoration
383cdf0e10cSrcweir         //pixels, screen position
384cdf0e10cSrcweir         ::vos::OGuard aSolarGuard( Application::GetSolarMutex());
385cdf0e10cSrcweir         createDialogOnDemand();
386cdf0e10cSrcweir         if( m_pDialog )
387cdf0e10cSrcweir         {
388cdf0e10cSrcweir             Rectangle aRect( m_pDialog->GetWindowExtentsRelative( 0 ) );
389cdf0e10cSrcweir             awt::Size aSize(aRect.GetWidth(),aRect.GetHeight());
390cdf0e10cSrcweir             aRet = uno::makeAny( aSize );
391cdf0e10cSrcweir         }
392cdf0e10cSrcweir     }
393cdf0e10cSrcweir     else if( rPropertyName.equals(C2U("UnlockControllersOnExecute")) )
394cdf0e10cSrcweir     {
395cdf0e10cSrcweir         aRet = uno::makeAny( m_bUnlockControllersOnExecute );
396cdf0e10cSrcweir     }
397cdf0e10cSrcweir     else
398cdf0e10cSrcweir         throw beans::UnknownPropertyException( C2U("unknown property was tried to get from chart wizard"), 0 );
399cdf0e10cSrcweir     return aRet;
400cdf0e10cSrcweir }
401cdf0e10cSrcweir 
addPropertyChangeListener(const::rtl::OUString &,const uno::Reference<beans::XPropertyChangeListener> &)402cdf0e10cSrcweir void SAL_CALL CreationWizardUnoDlg::addPropertyChangeListener(
403cdf0e10cSrcweir         const ::rtl::OUString& /* aPropertyName */, const uno::Reference< beans::XPropertyChangeListener >& /* xListener */ )
404cdf0e10cSrcweir         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
405cdf0e10cSrcweir {
406cdf0e10cSrcweir     OSL_ENSURE(false,"not implemented");
407cdf0e10cSrcweir }
removePropertyChangeListener(const::rtl::OUString &,const uno::Reference<beans::XPropertyChangeListener> &)408cdf0e10cSrcweir void SAL_CALL CreationWizardUnoDlg::removePropertyChangeListener(
409cdf0e10cSrcweir     const ::rtl::OUString& /* aPropertyName */, const uno::Reference< beans::XPropertyChangeListener >& /* aListener */ )
410cdf0e10cSrcweir     throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
411cdf0e10cSrcweir {
412cdf0e10cSrcweir     OSL_ENSURE(false,"not implemented");
413cdf0e10cSrcweir }
414cdf0e10cSrcweir 
addVetoableChangeListener(const::rtl::OUString &,const uno::Reference<beans::XVetoableChangeListener> &)415cdf0e10cSrcweir void SAL_CALL CreationWizardUnoDlg::addVetoableChangeListener( const ::rtl::OUString& /* PropertyName */, const uno::Reference< beans::XVetoableChangeListener >& /* aListener */ )
416cdf0e10cSrcweir     throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
417cdf0e10cSrcweir {
418cdf0e10cSrcweir     OSL_ENSURE(false,"not implemented");
419cdf0e10cSrcweir }
420cdf0e10cSrcweir 
removeVetoableChangeListener(const::rtl::OUString &,const uno::Reference<beans::XVetoableChangeListener> &)421cdf0e10cSrcweir void SAL_CALL CreationWizardUnoDlg::removeVetoableChangeListener( const ::rtl::OUString& /* PropertyName */, const uno::Reference< beans::XVetoableChangeListener >& /* aListener */ )
422cdf0e10cSrcweir     throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
423cdf0e10cSrcweir {
424cdf0e10cSrcweir     OSL_ENSURE(false,"not implemented");
425cdf0e10cSrcweir }
426cdf0e10cSrcweir 
427cdf0e10cSrcweir //.............................................................................
428cdf0e10cSrcweir } //namespace chart
429cdf0e10cSrcweir //.............................................................................
430