Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
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.
15 : : *
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).
21 : : *
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.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include "MasterDetailLinkDialog.hxx"
30 : : #include "formlinkdialog.hxx"
31 : :
32 : 0 : extern "C" void SAL_CALL createRegistryInfo_MasterDetailLinkDialog()
33 : : {
34 : 0 : ::pcr::OAutoRegistration< ::pcr::MasterDetailLinkDialog > aAutoRegistration;
35 : 0 : }
36 : :
37 : : //............................................................................
38 : : namespace pcr
39 : : {
40 : : //............................................................................
41 : :
42 : : using namespace ::com::sun::star::uno;
43 : : using namespace ::com::sun::star::lang;
44 : : using namespace ::com::sun::star::beans;
45 : :
46 : : //====================================================================
47 : : //= MasterDetailLinkDialog
48 : : //====================================================================
49 : : //---------------------------------------------------------------------
50 : 0 : MasterDetailLinkDialog::MasterDetailLinkDialog(const Reference< XComponentContext >& _rxContext )
51 : 0 : :OGenericUnoDialog( _rxContext )
52 : : {
53 : 0 : }
54 : : //---------------------------------------------------------------------
55 : 0 : Sequence<sal_Int8> SAL_CALL MasterDetailLinkDialog::getImplementationId( ) throw(RuntimeException)
56 : : {
57 : 0 : static ::cppu::OImplementationId aId;
58 : 0 : return aId.getImplementationId();
59 : : }
60 : :
61 : : //---------------------------------------------------------------------
62 : 0 : Reference< XInterface > SAL_CALL MasterDetailLinkDialog::Create( const Reference< XComponentContext >& _rxContext )
63 : : {
64 : 0 : return *( new MasterDetailLinkDialog( _rxContext ) );
65 : : }
66 : :
67 : : //---------------------------------------------------------------------
68 : 0 : ::rtl::OUString SAL_CALL MasterDetailLinkDialog::getImplementationName() throw(RuntimeException)
69 : : {
70 : 0 : return getImplementationName_static();
71 : : }
72 : :
73 : : //---------------------------------------------------------------------
74 : 0 : ::rtl::OUString MasterDetailLinkDialog::getImplementationName_static() throw(RuntimeException)
75 : : {
76 : 0 : return ::rtl::OUString("org.openoffice.comp.form.ui.MasterDetailLinkDialog");
77 : : }
78 : :
79 : : //---------------------------------------------------------------------
80 : 0 : ::comphelper::StringSequence SAL_CALL MasterDetailLinkDialog::getSupportedServiceNames() throw(RuntimeException)
81 : : {
82 : 0 : return getSupportedServiceNames_static();
83 : : }
84 : :
85 : : //---------------------------------------------------------------------
86 : 0 : ::comphelper::StringSequence MasterDetailLinkDialog::getSupportedServiceNames_static() throw(RuntimeException)
87 : : {
88 : 0 : ::comphelper::StringSequence aSupported(1);
89 : 0 : aSupported.getArray()[0] = ::rtl::OUString("com.sun.star.form.MasterDetailLinkDialog");
90 : 0 : return aSupported;
91 : : }
92 : :
93 : : //---------------------------------------------------------------------
94 : 0 : Reference<XPropertySetInfo> SAL_CALL MasterDetailLinkDialog::getPropertySetInfo() throw(RuntimeException)
95 : : {
96 : 0 : Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
97 : 0 : return xInfo;
98 : : }
99 : :
100 : : //---------------------------------------------------------------------
101 : 0 : ::cppu::IPropertyArrayHelper& MasterDetailLinkDialog::getInfoHelper()
102 : : {
103 : 0 : return *const_cast<MasterDetailLinkDialog*>(this)->getArrayHelper();
104 : : }
105 : :
106 : : //--------------------------------------------------------------------------
107 : 0 : ::cppu::IPropertyArrayHelper* MasterDetailLinkDialog::createArrayHelper( ) const
108 : : {
109 : 0 : Sequence< Property > aProps;
110 : 0 : describeProperties(aProps);
111 : 0 : return new ::cppu::OPropertyArrayHelper(aProps);
112 : : }
113 : :
114 : : //--------------------------------------------------------------------------
115 : 0 : Dialog* MasterDetailLinkDialog::createDialog(Window* _pParent)
116 : : {
117 : : return new FormLinkDialog(_pParent,m_xDetail,m_xMaster,m_aContext.getLegacyServiceFactory()
118 : 0 : ,m_sExplanation,m_sDetailLabel,m_sMasterLabel);
119 : : }
120 : : //---------------------------------------------------------------------
121 : 0 : void MasterDetailLinkDialog::implInitialize(const Any& _rValue)
122 : : {
123 : 0 : PropertyValue aProperty;
124 : 0 : if (_rValue >>= aProperty)
125 : : {
126 : 0 : if (0 == aProperty.Name.compareToAscii("Detail"))
127 : : {
128 : 0 : OSL_VERIFY( aProperty.Value >>= m_xDetail );
129 : : return;
130 : : }
131 : 0 : else if (0 == aProperty.Name.compareToAscii("Master"))
132 : : {
133 : 0 : OSL_VERIFY( aProperty.Value >>= m_xMaster );
134 : : return;
135 : : }
136 : 0 : else if (0 == aProperty.Name.compareToAscii("Explanation"))
137 : : {
138 : 0 : OSL_VERIFY( aProperty.Value >>= m_sExplanation );
139 : : return;
140 : : }
141 : 0 : else if (0 == aProperty.Name.compareToAscii("DetailLabel"))
142 : : {
143 : 0 : OSL_VERIFY( aProperty.Value >>= m_sDetailLabel );
144 : : return;
145 : : }
146 : 0 : else if (0 == aProperty.Name.compareToAscii("MasterLabel"))
147 : : {
148 : 0 : OSL_VERIFY( aProperty.Value >>= m_sMasterLabel );
149 : : return;
150 : : }
151 : : }
152 : 0 : MasterDetailLinkDialog_DBase::implInitialize(_rValue);
153 : : }
154 : :
155 : : //............................................................................
156 : : } // namespace pcr
157 : : //............................................................................
158 : :
159 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|