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