update credits
[LibreOffice.git] / extensions / source / propctrlr / MasterDetailLinkDialog.cxx
blobdb14cb4b76dd93f01d85779697378230b559586e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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"
23 extern "C" void SAL_CALL createRegistryInfo_MasterDetailLinkDialog()
25 ::pcr::OAutoRegistration< ::pcr::MasterDetailLinkDialog > aAutoRegistration;
28 //............................................................................
29 namespace pcr
31 //............................................................................
33 using namespace ::com::sun::star::uno;
34 using namespace ::com::sun::star::lang;
35 using namespace ::com::sun::star::beans;
37 //====================================================================
38 //= MasterDetailLinkDialog
39 //====================================================================
40 //---------------------------------------------------------------------
41 MasterDetailLinkDialog::MasterDetailLinkDialog(const Reference< XComponentContext >& _rxContext )
42 :OGenericUnoDialog( _rxContext )
45 //---------------------------------------------------------------------
46 Sequence<sal_Int8> SAL_CALL MasterDetailLinkDialog::getImplementationId( ) throw(RuntimeException)
48 static ::cppu::OImplementationId aId;
49 return aId.getImplementationId();
52 //---------------------------------------------------------------------
53 Reference< XInterface > SAL_CALL MasterDetailLinkDialog::Create( const Reference< XComponentContext >& _rxContext )
55 return *( new MasterDetailLinkDialog( _rxContext ) );
58 //---------------------------------------------------------------------
59 OUString SAL_CALL MasterDetailLinkDialog::getImplementationName() throw(RuntimeException)
61 return getImplementationName_static();
64 //---------------------------------------------------------------------
65 OUString MasterDetailLinkDialog::getImplementationName_static() throw(RuntimeException)
67 return OUString("org.openoffice.comp.form.ui.MasterDetailLinkDialog");
70 //---------------------------------------------------------------------
71 ::comphelper::StringSequence SAL_CALL MasterDetailLinkDialog::getSupportedServiceNames() throw(RuntimeException)
73 return getSupportedServiceNames_static();
76 //---------------------------------------------------------------------
77 ::comphelper::StringSequence MasterDetailLinkDialog::getSupportedServiceNames_static() throw(RuntimeException)
79 ::comphelper::StringSequence aSupported(1);
80 aSupported.getArray()[0] = OUString("com.sun.star.form.MasterDetailLinkDialog");
81 return aSupported;
84 //---------------------------------------------------------------------
85 Reference<XPropertySetInfo> SAL_CALL MasterDetailLinkDialog::getPropertySetInfo() throw(RuntimeException)
87 Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
88 return xInfo;
91 //---------------------------------------------------------------------
92 ::cppu::IPropertyArrayHelper& MasterDetailLinkDialog::getInfoHelper()
94 return *const_cast<MasterDetailLinkDialog*>(this)->getArrayHelper();
97 //--------------------------------------------------------------------------
98 ::cppu::IPropertyArrayHelper* MasterDetailLinkDialog::createArrayHelper( ) const
100 Sequence< Property > aProps;
101 describeProperties(aProps);
102 return new ::cppu::OPropertyArrayHelper(aProps);
105 //--------------------------------------------------------------------------
106 Dialog* MasterDetailLinkDialog::createDialog(Window* _pParent)
108 return new FormLinkDialog(_pParent,m_xDetail,m_xMaster, m_aContext
109 ,m_sExplanation,m_sDetailLabel,m_sMasterLabel);
111 //---------------------------------------------------------------------
112 void MasterDetailLinkDialog::implInitialize(const Any& _rValue)
114 PropertyValue aProperty;
115 if (_rValue >>= aProperty)
117 if (0 == aProperty.Name.compareToAscii("Detail"))
119 OSL_VERIFY( aProperty.Value >>= m_xDetail );
120 return;
122 else if (0 == aProperty.Name.compareToAscii("Master"))
124 OSL_VERIFY( aProperty.Value >>= m_xMaster );
125 return;
127 else if (0 == aProperty.Name.compareToAscii("Explanation"))
129 OSL_VERIFY( aProperty.Value >>= m_sExplanation );
130 return;
132 else if (0 == aProperty.Name.compareToAscii("DetailLabel"))
134 OSL_VERIFY( aProperty.Value >>= m_sDetailLabel );
135 return;
137 else if (0 == aProperty.Name.compareToAscii("MasterLabel"))
139 OSL_VERIFY( aProperty.Value >>= m_sMasterLabel );
140 return;
143 MasterDetailLinkDialog_DBase::implInitialize(_rValue);
146 //............................................................................
147 } // namespace pcr
148 //............................................................................
150 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */