merged tag LIBREOFFICE_3_2_99_3
[LibreOffice.git] / extensions / source / propctrlr / MasterDetailLinkDialog.cxx
blobb84319c47ad322fab2940373d413b035ad198b1c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #include "precompiled_extensions.hxx"
30 #include "MasterDetailLinkDialog.hxx"
31 #include "formlinkdialog.hxx"
33 extern "C" void SAL_CALL createRegistryInfo_MasterDetailLinkDialog()
35 ::pcr::OAutoRegistration< ::pcr::MasterDetailLinkDialog > aAutoRegistration;
38 //............................................................................
39 namespace pcr
41 //............................................................................
43 using namespace ::com::sun::star::uno;
44 using namespace ::com::sun::star::lang;
45 using namespace ::com::sun::star::beans;
47 //====================================================================
48 //= MasterDetailLinkDialog
49 //====================================================================
50 //---------------------------------------------------------------------
51 MasterDetailLinkDialog::MasterDetailLinkDialog(const Reference< XComponentContext >& _rxContext )
52 :OGenericUnoDialog( _rxContext )
55 //---------------------------------------------------------------------
56 Sequence<sal_Int8> SAL_CALL MasterDetailLinkDialog::getImplementationId( ) throw(RuntimeException)
58 static ::cppu::OImplementationId aId;
59 return aId.getImplementationId();
62 //---------------------------------------------------------------------
63 Reference< XInterface > SAL_CALL MasterDetailLinkDialog::Create( const Reference< XComponentContext >& _rxContext )
65 return *( new MasterDetailLinkDialog( _rxContext ) );
68 //---------------------------------------------------------------------
69 ::rtl::OUString SAL_CALL MasterDetailLinkDialog::getImplementationName() throw(RuntimeException)
71 return getImplementationName_static();
74 //---------------------------------------------------------------------
75 ::rtl::OUString MasterDetailLinkDialog::getImplementationName_static() throw(RuntimeException)
77 return ::rtl::OUString::createFromAscii("org.openoffice.comp.form.ui.MasterDetailLinkDialog");
80 //---------------------------------------------------------------------
81 ::comphelper::StringSequence SAL_CALL MasterDetailLinkDialog::getSupportedServiceNames() throw(RuntimeException)
83 return getSupportedServiceNames_static();
86 //---------------------------------------------------------------------
87 ::comphelper::StringSequence MasterDetailLinkDialog::getSupportedServiceNames_static() throw(RuntimeException)
89 ::comphelper::StringSequence aSupported(1);
90 aSupported.getArray()[0] = ::rtl::OUString::createFromAscii("com.sun.star.form.MasterDetailLinkDialog");
91 return aSupported;
94 //---------------------------------------------------------------------
95 Reference<XPropertySetInfo> SAL_CALL MasterDetailLinkDialog::getPropertySetInfo() throw(RuntimeException)
97 Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
98 return xInfo;
101 //---------------------------------------------------------------------
102 ::cppu::IPropertyArrayHelper& MasterDetailLinkDialog::getInfoHelper()
104 return *const_cast<MasterDetailLinkDialog*>(this)->getArrayHelper();
107 //--------------------------------------------------------------------------
108 ::cppu::IPropertyArrayHelper* MasterDetailLinkDialog::createArrayHelper( ) const
110 Sequence< Property > aProps;
111 describeProperties(aProps);
112 return new ::cppu::OPropertyArrayHelper(aProps);
115 //--------------------------------------------------------------------------
116 Dialog* MasterDetailLinkDialog::createDialog(Window* _pParent)
118 return new FormLinkDialog(_pParent,m_xDetail,m_xMaster,m_aContext.getLegacyServiceFactory()
119 ,m_sExplanation,m_sDetailLabel,m_sMasterLabel);
121 //---------------------------------------------------------------------
122 void MasterDetailLinkDialog::implInitialize(const Any& _rValue)
124 PropertyValue aProperty;
125 if (_rValue >>= aProperty)
127 if (0 == aProperty.Name.compareToAscii("Detail"))
129 OSL_VERIFY( aProperty.Value >>= m_xDetail );
130 return;
132 else if (0 == aProperty.Name.compareToAscii("Master"))
134 OSL_VERIFY( aProperty.Value >>= m_xMaster );
135 return;
137 else if (0 == aProperty.Name.compareToAscii("Explanation"))
139 OSL_VERIFY( aProperty.Value >>= m_sExplanation );
140 return;
142 else if (0 == aProperty.Name.compareToAscii("DetailLabel"))
144 OSL_VERIFY( aProperty.Value >>= m_sDetailLabel );
145 return;
147 else if (0 == aProperty.Name.compareToAscii("MasterLabel"))
149 OSL_VERIFY( aProperty.Value >>= m_sMasterLabel );
150 return;
153 MasterDetailLinkDialog_DBase::implInitialize(_rValue);
156 //............................................................................
157 } // namespace pcr
158 //............................................................................
160 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */