1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "MasterDetailLinkDialog.hxx"
21 #include "formlinkdialog.hxx"
22 #include "pcrservices.hxx"
24 extern "C" void SAL_CALL
createRegistryInfo_MasterDetailLinkDialog()
26 ::pcr::OAutoRegistration
< ::pcr::MasterDetailLinkDialog
> aAutoRegistration
;
34 using namespace ::com::sun::star::uno
;
35 using namespace ::com::sun::star::lang
;
36 using namespace ::com::sun::star::beans
;
38 MasterDetailLinkDialog::MasterDetailLinkDialog(const Reference
< XComponentContext
>& _rxContext
)
39 :OGenericUnoDialog( _rxContext
)
43 Sequence
<sal_Int8
> SAL_CALL
MasterDetailLinkDialog::getImplementationId( )
45 return css::uno::Sequence
<sal_Int8
>();
49 Reference
< XInterface
> SAL_CALL
MasterDetailLinkDialog::Create( const Reference
< XComponentContext
>& _rxContext
)
51 return *( new MasterDetailLinkDialog( _rxContext
) );
55 OUString SAL_CALL
MasterDetailLinkDialog::getImplementationName()
57 return getImplementationName_static();
61 OUString
MasterDetailLinkDialog::getImplementationName_static()
63 return OUString("org.openoffice.comp.form.ui.MasterDetailLinkDialog");
67 css::uno::Sequence
<OUString
> SAL_CALL
MasterDetailLinkDialog::getSupportedServiceNames()
69 return getSupportedServiceNames_static();
73 css::uno::Sequence
<OUString
> MasterDetailLinkDialog::getSupportedServiceNames_static()
75 css::uno::Sequence
<OUString
> aSupported
{ "com.sun.star.form.MasterDetailLinkDialog" };
80 Reference
<XPropertySetInfo
> SAL_CALL
MasterDetailLinkDialog::getPropertySetInfo()
82 Reference
<XPropertySetInfo
> xInfo( createPropertySetInfo( getInfoHelper() ) );
87 ::cppu::IPropertyArrayHelper
& MasterDetailLinkDialog::getInfoHelper()
89 return *getArrayHelper();
93 ::cppu::IPropertyArrayHelper
* MasterDetailLinkDialog::createArrayHelper( ) const
95 Sequence
< Property
> aProps
;
96 describeProperties(aProps
);
97 return new ::cppu::OPropertyArrayHelper(aProps
);
101 VclPtr
<Dialog
> MasterDetailLinkDialog::createDialog(vcl::Window
* _pParent
)
103 return VclPtr
<FormLinkDialog
>::Create(_pParent
,m_xDetail
,m_xMaster
, m_aContext
104 ,m_sExplanation
,m_sDetailLabel
,m_sMasterLabel
);
107 void MasterDetailLinkDialog::implInitialize(const Any
& _rValue
)
109 PropertyValue aProperty
;
110 if (_rValue
>>= aProperty
)
112 if (aProperty
.Name
== "Detail")
114 OSL_VERIFY( aProperty
.Value
>>= m_xDetail
);
117 else if (aProperty
.Name
== "Master")
119 OSL_VERIFY( aProperty
.Value
>>= m_xMaster
);
122 else if (aProperty
.Name
== "Explanation")
124 OSL_VERIFY( aProperty
.Value
>>= m_sExplanation
);
127 else if (aProperty
.Name
== "DetailLabel")
129 OSL_VERIFY( aProperty
.Value
>>= m_sDetailLabel
);
132 else if (aProperty
.Name
== "MasterLabel")
134 OSL_VERIFY( aProperty
.Value
>>= m_sMasterLabel
);
138 MasterDetailLinkDialog_DBase::implInitialize(_rValue
);
145 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */