1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: MasterDetailLinkDialog.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #include "precompiled_extensions.hxx"
32 #include "MasterDetailLinkDialog.hxx"
33 #include "formlinkdialog.hxx"
35 extern "C" void SAL_CALL
createRegistryInfo_MasterDetailLinkDialog()
37 ::pcr::OAutoRegistration
< ::pcr::MasterDetailLinkDialog
> aAutoRegistration
;
40 //............................................................................
43 //............................................................................
45 using namespace ::com::sun::star::uno
;
46 using namespace ::com::sun::star::lang
;
47 using namespace ::com::sun::star::beans
;
49 //====================================================================
50 //= MasterDetailLinkDialog
51 //====================================================================
52 //---------------------------------------------------------------------
53 MasterDetailLinkDialog::MasterDetailLinkDialog(const Reference
< XComponentContext
>& _rxContext
)
54 :OGenericUnoDialog( _rxContext
)
57 //---------------------------------------------------------------------
58 Sequence
<sal_Int8
> SAL_CALL
MasterDetailLinkDialog::getImplementationId( ) throw(RuntimeException
)
60 static ::cppu::OImplementationId aId
;
61 return aId
.getImplementationId();
64 //---------------------------------------------------------------------
65 Reference
< XInterface
> SAL_CALL
MasterDetailLinkDialog::Create( const Reference
< XComponentContext
>& _rxContext
)
67 return *( new MasterDetailLinkDialog( _rxContext
) );
70 //---------------------------------------------------------------------
71 ::rtl::OUString SAL_CALL
MasterDetailLinkDialog::getImplementationName() throw(RuntimeException
)
73 return getImplementationName_static();
76 //---------------------------------------------------------------------
77 ::rtl::OUString
MasterDetailLinkDialog::getImplementationName_static() throw(RuntimeException
)
79 return ::rtl::OUString::createFromAscii("org.openoffice.comp.form.ui.MasterDetailLinkDialog");
82 //---------------------------------------------------------------------
83 ::comphelper::StringSequence SAL_CALL
MasterDetailLinkDialog::getSupportedServiceNames() throw(RuntimeException
)
85 return getSupportedServiceNames_static();
88 //---------------------------------------------------------------------
89 ::comphelper::StringSequence
MasterDetailLinkDialog::getSupportedServiceNames_static() throw(RuntimeException
)
91 ::comphelper::StringSequence
aSupported(1);
92 aSupported
.getArray()[0] = ::rtl::OUString::createFromAscii("com.sun.star.form.MasterDetailLinkDialog");
96 //---------------------------------------------------------------------
97 Reference
<XPropertySetInfo
> SAL_CALL
MasterDetailLinkDialog::getPropertySetInfo() throw(RuntimeException
)
99 Reference
<XPropertySetInfo
> xInfo( createPropertySetInfo( getInfoHelper() ) );
103 //---------------------------------------------------------------------
104 ::cppu::IPropertyArrayHelper
& MasterDetailLinkDialog::getInfoHelper()
106 return *const_cast<MasterDetailLinkDialog
*>(this)->getArrayHelper();
109 //--------------------------------------------------------------------------
110 ::cppu::IPropertyArrayHelper
* MasterDetailLinkDialog::createArrayHelper( ) const
112 Sequence
< Property
> aProps
;
113 describeProperties(aProps
);
114 return new ::cppu::OPropertyArrayHelper(aProps
);
117 //--------------------------------------------------------------------------
118 Dialog
* MasterDetailLinkDialog::createDialog(Window
* _pParent
)
120 return new FormLinkDialog(_pParent
,m_xDetail
,m_xMaster
,m_aContext
.getLegacyServiceFactory()
121 ,m_sExplanation
,m_sDetailLabel
,m_sMasterLabel
);
123 //---------------------------------------------------------------------
124 void MasterDetailLinkDialog::implInitialize(const Any
& _rValue
)
126 PropertyValue aProperty
;
127 if (_rValue
>>= aProperty
)
129 if (0 == aProperty
.Name
.compareToAscii("Detail"))
131 OSL_VERIFY( aProperty
.Value
>>= m_xDetail
);
134 else if (0 == aProperty
.Name
.compareToAscii("Master"))
136 OSL_VERIFY( aProperty
.Value
>>= m_xMaster
);
139 else if (0 == aProperty
.Name
.compareToAscii("Explanation"))
141 OSL_VERIFY( aProperty
.Value
>>= m_sExplanation
);
144 else if (0 == aProperty
.Name
.compareToAscii("DetailLabel"))
146 OSL_VERIFY( aProperty
.Value
>>= m_sDetailLabel
);
149 else if (0 == aProperty
.Name
.compareToAscii("MasterLabel"))
151 OSL_VERIFY( aProperty
.Value
>>= m_sMasterLabel
);
155 MasterDetailLinkDialog_DBase::implInitialize(_rValue
);
158 //............................................................................
160 //............................................................................