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