1*2a97ec55SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*2a97ec55SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*2a97ec55SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*2a97ec55SAndrew Rist  * distributed with this work for additional information
6*2a97ec55SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*2a97ec55SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*2a97ec55SAndrew Rist  * "License"); you may not use this file except in compliance
9*2a97ec55SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*2a97ec55SAndrew Rist  *
11*2a97ec55SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*2a97ec55SAndrew Rist  *
13*2a97ec55SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*2a97ec55SAndrew Rist  * software distributed under the License is distributed on an
15*2a97ec55SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*2a97ec55SAndrew Rist  * KIND, either express or implied.  See the License for the
17*2a97ec55SAndrew Rist  * specific language governing permissions and limitations
18*2a97ec55SAndrew Rist  * under the License.
19*2a97ec55SAndrew Rist  *
20*2a97ec55SAndrew Rist  *************************************************************/
21*2a97ec55SAndrew Rist 
22*2a97ec55SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir  #include "precompiled_extensions.hxx"
25cdf0e10cSrcweir  #include "MasterDetailLinkDialog.hxx"
26cdf0e10cSrcweir  #include "formlinkdialog.hxx"
27cdf0e10cSrcweir 
createRegistryInfo_MasterDetailLinkDialog()28cdf0e10cSrcweir  extern "C" void SAL_CALL createRegistryInfo_MasterDetailLinkDialog()
29cdf0e10cSrcweir {
30cdf0e10cSrcweir 	::pcr::OAutoRegistration< ::pcr::MasterDetailLinkDialog > aAutoRegistration;
31cdf0e10cSrcweir }
32cdf0e10cSrcweir 
33cdf0e10cSrcweir //............................................................................
34cdf0e10cSrcweir namespace pcr
35cdf0e10cSrcweir {
36cdf0e10cSrcweir //............................................................................
37cdf0e10cSrcweir 
38cdf0e10cSrcweir     using namespace ::com::sun::star::uno;
39cdf0e10cSrcweir     using namespace ::com::sun::star::lang;
40cdf0e10cSrcweir     using namespace ::com::sun::star::beans;
41cdf0e10cSrcweir 
42cdf0e10cSrcweir     //====================================================================
43cdf0e10cSrcweir 	//= MasterDetailLinkDialog
44cdf0e10cSrcweir 	//====================================================================
45cdf0e10cSrcweir 	//---------------------------------------------------------------------
MasterDetailLinkDialog(const Reference<XComponentContext> & _rxContext)46cdf0e10cSrcweir 	MasterDetailLinkDialog::MasterDetailLinkDialog(const Reference< XComponentContext >& _rxContext )
47cdf0e10cSrcweir 		:OGenericUnoDialog( _rxContext )
48cdf0e10cSrcweir 	{
49cdf0e10cSrcweir 	}
50cdf0e10cSrcweir //---------------------------------------------------------------------
getImplementationId()51cdf0e10cSrcweir 	Sequence<sal_Int8> SAL_CALL MasterDetailLinkDialog::getImplementationId(  ) throw(RuntimeException)
52cdf0e10cSrcweir 	{
53cdf0e10cSrcweir 		static ::cppu::OImplementationId aId;
54cdf0e10cSrcweir 		return aId.getImplementationId();
55cdf0e10cSrcweir 	}
56cdf0e10cSrcweir 
57cdf0e10cSrcweir 	//---------------------------------------------------------------------
Create(const Reference<XComponentContext> & _rxContext)58cdf0e10cSrcweir 	Reference< XInterface > SAL_CALL MasterDetailLinkDialog::Create( const Reference< XComponentContext >& _rxContext )
59cdf0e10cSrcweir 	{
60cdf0e10cSrcweir 		return *( new MasterDetailLinkDialog( _rxContext ) );
61cdf0e10cSrcweir 	}
62cdf0e10cSrcweir 
63cdf0e10cSrcweir 	//---------------------------------------------------------------------
getImplementationName()64cdf0e10cSrcweir 	::rtl::OUString SAL_CALL MasterDetailLinkDialog::getImplementationName() throw(RuntimeException)
65cdf0e10cSrcweir 	{
66cdf0e10cSrcweir 		return getImplementationName_static();
67cdf0e10cSrcweir 	}
68cdf0e10cSrcweir 
69cdf0e10cSrcweir 	//---------------------------------------------------------------------
getImplementationName_static()70cdf0e10cSrcweir 	::rtl::OUString MasterDetailLinkDialog::getImplementationName_static() throw(RuntimeException)
71cdf0e10cSrcweir 	{
72cdf0e10cSrcweir 		return ::rtl::OUString::createFromAscii("org.openoffice.comp.form.ui.MasterDetailLinkDialog");
73cdf0e10cSrcweir 	}
74cdf0e10cSrcweir 
75cdf0e10cSrcweir 	//---------------------------------------------------------------------
getSupportedServiceNames()76cdf0e10cSrcweir 	::comphelper::StringSequence SAL_CALL MasterDetailLinkDialog::getSupportedServiceNames() throw(RuntimeException)
77cdf0e10cSrcweir 	{
78cdf0e10cSrcweir 		return getSupportedServiceNames_static();
79cdf0e10cSrcweir 	}
80cdf0e10cSrcweir 
81cdf0e10cSrcweir 	//---------------------------------------------------------------------
getSupportedServiceNames_static()82cdf0e10cSrcweir 	::comphelper::StringSequence MasterDetailLinkDialog::getSupportedServiceNames_static() throw(RuntimeException)
83cdf0e10cSrcweir 	{
84cdf0e10cSrcweir 		::comphelper::StringSequence aSupported(1);
85cdf0e10cSrcweir 		aSupported.getArray()[0] = ::rtl::OUString::createFromAscii("com.sun.star.form.MasterDetailLinkDialog");
86cdf0e10cSrcweir 		return aSupported;
87cdf0e10cSrcweir 	}
88cdf0e10cSrcweir 
89cdf0e10cSrcweir 	//---------------------------------------------------------------------
getPropertySetInfo()90cdf0e10cSrcweir 	Reference<XPropertySetInfo>  SAL_CALL MasterDetailLinkDialog::getPropertySetInfo() throw(RuntimeException)
91cdf0e10cSrcweir 	{
92cdf0e10cSrcweir 		Reference<XPropertySetInfo>  xInfo( createPropertySetInfo( getInfoHelper() ) );
93cdf0e10cSrcweir 		return xInfo;
94cdf0e10cSrcweir 	}
95cdf0e10cSrcweir 
96cdf0e10cSrcweir 	//---------------------------------------------------------------------
getInfoHelper()97cdf0e10cSrcweir 	::cppu::IPropertyArrayHelper& MasterDetailLinkDialog::getInfoHelper()
98cdf0e10cSrcweir 	{
99cdf0e10cSrcweir 		return *const_cast<MasterDetailLinkDialog*>(this)->getArrayHelper();
100cdf0e10cSrcweir 	}
101cdf0e10cSrcweir 
102cdf0e10cSrcweir 	//--------------------------------------------------------------------------
createArrayHelper() const103cdf0e10cSrcweir 	::cppu::IPropertyArrayHelper* MasterDetailLinkDialog::createArrayHelper( ) const
104cdf0e10cSrcweir 	{
105cdf0e10cSrcweir 		Sequence< Property > aProps;
106cdf0e10cSrcweir 		describeProperties(aProps);
107cdf0e10cSrcweir 		return new ::cppu::OPropertyArrayHelper(aProps);
108cdf0e10cSrcweir 	}
109cdf0e10cSrcweir 
110cdf0e10cSrcweir 	//--------------------------------------------------------------------------
createDialog(Window * _pParent)111cdf0e10cSrcweir 	Dialog*	MasterDetailLinkDialog::createDialog(Window* _pParent)
112cdf0e10cSrcweir 	{
113cdf0e10cSrcweir         return new FormLinkDialog(_pParent,m_xDetail,m_xMaster,m_aContext.getLegacyServiceFactory()
114cdf0e10cSrcweir             ,m_sExplanation,m_sDetailLabel,m_sMasterLabel);
115cdf0e10cSrcweir 	}
116cdf0e10cSrcweir     //---------------------------------------------------------------------
implInitialize(const Any & _rValue)117cdf0e10cSrcweir 	void MasterDetailLinkDialog::implInitialize(const Any& _rValue)
118cdf0e10cSrcweir 	{
119cdf0e10cSrcweir 		PropertyValue aProperty;
120cdf0e10cSrcweir 		if (_rValue >>= aProperty)
121cdf0e10cSrcweir 		{
122cdf0e10cSrcweir 			if (0 == aProperty.Name.compareToAscii("Detail"))
123cdf0e10cSrcweir 			{
124cdf0e10cSrcweir 				OSL_VERIFY( aProperty.Value >>= m_xDetail );
125cdf0e10cSrcweir                 return;
126cdf0e10cSrcweir 			}
127cdf0e10cSrcweir             else if (0 == aProperty.Name.compareToAscii("Master"))
128cdf0e10cSrcweir 			{
129cdf0e10cSrcweir 				OSL_VERIFY( aProperty.Value >>= m_xMaster );
130cdf0e10cSrcweir                 return;
131cdf0e10cSrcweir 			}
132cdf0e10cSrcweir             else if (0 == aProperty.Name.compareToAscii("Explanation"))
133cdf0e10cSrcweir 			{
134cdf0e10cSrcweir 				OSL_VERIFY( aProperty.Value >>= m_sExplanation );
135cdf0e10cSrcweir                 return;
136cdf0e10cSrcweir 			}
137cdf0e10cSrcweir             else if (0 == aProperty.Name.compareToAscii("DetailLabel"))
138cdf0e10cSrcweir 			{
139cdf0e10cSrcweir 				OSL_VERIFY( aProperty.Value >>= m_sDetailLabel );
140cdf0e10cSrcweir                 return;
141cdf0e10cSrcweir 			}
142cdf0e10cSrcweir             else if (0 == aProperty.Name.compareToAscii("MasterLabel"))
143cdf0e10cSrcweir 			{
144cdf0e10cSrcweir 				OSL_VERIFY( aProperty.Value >>= m_sMasterLabel );
145cdf0e10cSrcweir                 return;
146cdf0e10cSrcweir 			}
147cdf0e10cSrcweir 		}
148cdf0e10cSrcweir 		MasterDetailLinkDialog_DBase::implInitialize(_rValue);
149cdf0e10cSrcweir 	}
150cdf0e10cSrcweir 
151cdf0e10cSrcweir //............................................................................
152cdf0e10cSrcweir }   // namespace pcr
153cdf0e10cSrcweir //............................................................................
154