1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include <iderdll.hxx>
23 #include <com/sun/star/io/IOException.hpp>
24 #include <comphelper/sequence.hxx>
25 #include <cppuhelper/queryinterface.hxx>
26 #include <cppuhelper/supportsservice.hxx>
27 #include <sfx2/objsh.hxx>
28 #include <vcl/svapp.hxx>
30 #include "unomodel.hxx"
35 using namespace ::cppu
;
36 using namespace ::std
;
37 using namespace ::com::sun::star
;
38 using namespace ::com::sun::star::uno
;
39 using namespace ::com::sun::star::lang
;
41 SIDEModel::SIDEModel( SfxObjectShell
*pObjSh
)
42 : SfxBaseModel(pObjSh
)
46 SIDEModel::~SIDEModel()
50 uno::Any SAL_CALL
SIDEModel::queryInterface( const uno::Type
& rType
)
52 uno::Any aRet
= ::cppu::queryInterface ( rType
,
53 // OWeakObject interfaces
54 static_cast< XInterface
* >( static_cast< OWeakObject
* >( this ) ),
55 static_cast< XWeak
* > ( this ),
56 static_cast< XServiceInfo
* > ( this ) );
58 aRet
= SfxBaseModel::queryInterface ( rType
);
62 void SAL_CALL
SIDEModel::acquire() noexcept
64 SolarMutexGuard aGuard
;
65 OWeakObject::acquire();
68 void SAL_CALL
SIDEModel::release() noexcept
70 SolarMutexGuard aGuard
;
71 OWeakObject::release();
74 uno::Sequence
< uno::Type
> SAL_CALL
SIDEModel::getTypes( )
76 return comphelper::concatSequences(
77 SfxBaseModel::getTypes(),
78 uno::Sequence
{ cppu::UnoType
<XServiceInfo
>::get() });
81 OUString
SIDEModel::getImplementationName()
83 return "com.sun.star.comp.basic.BasicIDE";
86 sal_Bool
SIDEModel::supportsService(const OUString
& rServiceName
)
88 return cppu::supportsService(this, rServiceName
);
91 uno::Sequence
< OUString
> SIDEModel::getSupportedServiceNames()
93 return { "com.sun.star.script.BasicIDE" };
97 void SAL_CALL
SIDEModel::store()
102 void SAL_CALL
SIDEModel::storeAsURL( const OUString
&, const uno::Sequence
< beans::PropertyValue
>& )
107 void SAL_CALL
SIDEModel::storeToURL( const OUString
&,
108 const uno::Sequence
< beans::PropertyValue
>& )
113 void SIDEModel::notImplemented()
115 throw io::IOException("Can't store IDE model" );
118 } // namespace basctl
120 extern "C" SAL_DLLPUBLIC_EXPORT
css::uno::XInterface
*
121 com_sun_star_comp_basic_BasicID_get_implementation(
122 css::uno::XComponentContext
* , css::uno::Sequence
<css::uno::Any
> const&)
124 SolarMutexGuard aGuard
;
126 SfxObjectShell
* pShell
= new basctl::DocShell();
127 auto pModel
= pShell
->GetModel();
132 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */