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 "dlg_ChartType_UNO.hxx"
21 : #include "dlg_ChartType.hxx"
22 : #include "servicenames.hxx"
23 : #include <osl/mutex.hxx>
24 :
25 : namespace chart
26 : {
27 : using namespace ::com::sun::star;
28 0 : ChartTypeUnoDlg::ChartTypeUnoDlg( const uno::Reference< uno::XComponentContext >& _xContext )
29 0 : : ChartTypeUnoDlg_BASE( _xContext )
30 : {
31 0 : }
32 0 : ChartTypeUnoDlg::~ChartTypeUnoDlg()
33 : {
34 : // we do this here cause the base class' call to destroyDialog won't reach us anymore : we're within an dtor,
35 : // so this virtual-method-call the base class does does not work, we're already dead then ...
36 0 : if (m_pDialog)
37 : {
38 0 : ::osl::MutexGuard aGuard(m_aMutex);
39 0 : if (m_pDialog)
40 0 : destroyDialog();
41 : }
42 0 : }
43 : // lang::XServiceInfo
44 0 : OUString SAL_CALL ChartTypeUnoDlg::getImplementationName() throw(uno::RuntimeException, std::exception)
45 : {
46 0 : return getImplementationName_Static();
47 : }
48 :
49 0 : OUString ChartTypeUnoDlg::getImplementationName_Static() throw(uno::RuntimeException)
50 : {
51 0 : return OUString(CHART_TYPE_DIALOG_SERVICE_IMPLEMENTATION_NAME);
52 : }
53 :
54 0 : ::comphelper::StringSequence SAL_CALL ChartTypeUnoDlg::getSupportedServiceNames() throw(uno::RuntimeException, std::exception)
55 : {
56 0 : return getSupportedServiceNames_Static();
57 : }
58 :
59 0 : uno::Sequence< OUString > ChartTypeUnoDlg::getSupportedServiceNames_Static()
60 : {
61 0 : uno::Sequence< OUString > aSNS( 1 );
62 0 : aSNS.getArray()[ 0 ] = CHART_TYPE_DIALOG_SERVICE_NAME;
63 0 : return aSNS;
64 : }
65 0 : uno::Sequence< sal_Int8 > SAL_CALL ChartTypeUnoDlg::getImplementationId() throw( uno::RuntimeException, std::exception )
66 : {
67 0 : return css::uno::Sequence<sal_Int8>();
68 : }
69 0 : void ChartTypeUnoDlg::implInitialize(const uno::Any& _rValue)
70 : {
71 0 : beans::PropertyValue aProperty;
72 0 : if (_rValue >>= aProperty)
73 : {
74 0 : if (aProperty.Name == "ChartModel")
75 0 : m_xChartModel.set(aProperty.Value,uno::UNO_QUERY);
76 : else
77 0 : ChartTypeUnoDlg_BASE::implInitialize(_rValue);
78 : }
79 : else
80 0 : ChartTypeUnoDlg_BASE::implInitialize(_rValue);
81 0 : }
82 0 : VclPtr<Dialog> ChartTypeUnoDlg::createDialog(vcl::Window* _pParent)
83 : {
84 0 : return VclPtr<ChartTypeDialog>::Create( _pParent, m_xChartModel, m_aContext );
85 : }
86 0 : uno::Reference<beans::XPropertySetInfo> SAL_CALL ChartTypeUnoDlg::getPropertySetInfo() throw(uno::RuntimeException, std::exception)
87 : {
88 0 : return createPropertySetInfo( getInfoHelper() );
89 : }
90 :
91 0 : ::cppu::IPropertyArrayHelper& ChartTypeUnoDlg::getInfoHelper()
92 : {
93 0 : return *getArrayHelper();
94 : }
95 :
96 0 : ::cppu::IPropertyArrayHelper* ChartTypeUnoDlg::createArrayHelper( ) const
97 : {
98 0 : uno::Sequence< beans::Property > aProps;
99 0 : describeProperties(aProps);
100 0 : return new ::cppu::OPropertyArrayHelper(aProps);
101 : }
102 :
103 : } //namespace chart
104 :
105 : extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
106 0 : com_sun_star_comp_chart2_ChartTypeDialog_get_implementation(css::uno::XComponentContext *context,
107 : css::uno::Sequence<css::uno::Any> const &)
108 : {
109 0 : return cppu::acquire(new chart::ChartTypeUnoDlg(context));
110 57 : }
111 :
112 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|