1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #include "precompiled_extensions.hxx"
29 #include "MasterDetailLinkDialog.hxx"
30 #include "formlinkdialog.hxx"
32 extern "C" void SAL_CALL
createRegistryInfo_MasterDetailLinkDialog()
34 ::pcr::OAutoRegistration
< ::pcr::MasterDetailLinkDialog
> aAutoRegistration
;
37 //............................................................................
40 //............................................................................
42 using namespace ::com::sun::star::uno
;
43 using namespace ::com::sun::star::lang
;
44 using namespace ::com::sun::star::beans
;
46 //====================================================================
47 //= MasterDetailLinkDialog
48 //====================================================================
49 //---------------------------------------------------------------------
50 MasterDetailLinkDialog::MasterDetailLinkDialog(const Reference
< XComponentContext
>& _rxContext
)
51 :OGenericUnoDialog( _rxContext
)
54 //---------------------------------------------------------------------
55 Sequence
<sal_Int8
> SAL_CALL
MasterDetailLinkDialog::getImplementationId( ) throw(RuntimeException
)
57 static ::cppu::OImplementationId aId
;
58 return aId
.getImplementationId();
61 //---------------------------------------------------------------------
62 Reference
< XInterface
> SAL_CALL
MasterDetailLinkDialog::Create( const Reference
< XComponentContext
>& _rxContext
)
64 return *( new MasterDetailLinkDialog( _rxContext
) );
67 //---------------------------------------------------------------------
68 ::rtl::OUString SAL_CALL
MasterDetailLinkDialog::getImplementationName() throw(RuntimeException
)
70 return getImplementationName_static();
73 //---------------------------------------------------------------------
74 ::rtl::OUString
MasterDetailLinkDialog::getImplementationName_static() throw(RuntimeException
)
76 return ::rtl::OUString::createFromAscii("org.openoffice.comp.form.ui.MasterDetailLinkDialog");
79 //---------------------------------------------------------------------
80 ::comphelper::StringSequence SAL_CALL
MasterDetailLinkDialog::getSupportedServiceNames() throw(RuntimeException
)
82 return getSupportedServiceNames_static();
85 //---------------------------------------------------------------------
86 ::comphelper::StringSequence
MasterDetailLinkDialog::getSupportedServiceNames_static() throw(RuntimeException
)
88 ::comphelper::StringSequence
aSupported(1);
89 aSupported
.getArray()[0] = ::rtl::OUString::createFromAscii("com.sun.star.form.MasterDetailLinkDialog");
93 //---------------------------------------------------------------------
94 Reference
<XPropertySetInfo
> SAL_CALL
MasterDetailLinkDialog::getPropertySetInfo() throw(RuntimeException
)
96 Reference
<XPropertySetInfo
> xInfo( createPropertySetInfo( getInfoHelper() ) );
100 //---------------------------------------------------------------------
101 ::cppu::IPropertyArrayHelper
& MasterDetailLinkDialog::getInfoHelper()
103 return *const_cast<MasterDetailLinkDialog
*>(this)->getArrayHelper();
106 //--------------------------------------------------------------------------
107 ::cppu::IPropertyArrayHelper
* MasterDetailLinkDialog::createArrayHelper( ) const
109 Sequence
< Property
> aProps
;
110 describeProperties(aProps
);
111 return new ::cppu::OPropertyArrayHelper(aProps
);
114 //--------------------------------------------------------------------------
115 Dialog
* MasterDetailLinkDialog::createDialog(Window
* _pParent
)
117 return new FormLinkDialog(_pParent
,m_xDetail
,m_xMaster
,m_aContext
.getLegacyServiceFactory()
118 ,m_sExplanation
,m_sDetailLabel
,m_sMasterLabel
);
120 //---------------------------------------------------------------------
121 void MasterDetailLinkDialog::implInitialize(const Any
& _rValue
)
123 PropertyValue aProperty
;
124 if (_rValue
>>= aProperty
)
126 if (0 == aProperty
.Name
.compareToAscii("Detail"))
128 OSL_VERIFY( aProperty
.Value
>>= m_xDetail
);
131 else if (0 == aProperty
.Name
.compareToAscii("Master"))
133 OSL_VERIFY( aProperty
.Value
>>= m_xMaster
);
136 else if (0 == aProperty
.Name
.compareToAscii("Explanation"))
138 OSL_VERIFY( aProperty
.Value
>>= m_sExplanation
);
141 else if (0 == aProperty
.Name
.compareToAscii("DetailLabel"))
143 OSL_VERIFY( aProperty
.Value
>>= m_sDetailLabel
);
146 else if (0 == aProperty
.Name
.compareToAscii("MasterLabel"))
148 OSL_VERIFY( aProperty
.Value
>>= m_sMasterLabel
);
152 MasterDetailLinkDialog_DBase::implInitialize(_rValue
);
155 //............................................................................
157 //............................................................................