2010-10-12 15:57:08 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-12 17:02:47 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2003-09-19 07:30:26 +00:00
|
|
|
|
2006-09-16 23:30:25 +00:00
|
|
|
|
2014-01-31 03:09:23 -02:00
|
|
|
#include <basdoc.hxx>
|
|
|
|
#include <iderdll.hxx>
|
2003-09-19 07:30:26 +00:00
|
|
|
#include <sfx2/objsh.hxx>
|
2014-01-31 03:09:23 -02:00
|
|
|
#include <vcl/svapp.hxx>
|
2003-09-19 07:30:26 +00:00
|
|
|
|
2014-01-31 03:09:23 -02:00
|
|
|
#include "unomodel.hxx"
|
2003-09-19 07:30:26 +00:00
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
namespace basctl
|
|
|
|
{
|
|
|
|
|
2003-09-19 07:30:26 +00:00
|
|
|
using namespace ::cppu;
|
|
|
|
using namespace ::std;
|
|
|
|
using namespace ::com::sun::star;
|
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
using namespace ::com::sun::star::lang;
|
|
|
|
|
|
|
|
SIDEModel::SIDEModel( SfxObjectShell *pObjSh )
|
|
|
|
: SfxBaseModel(pObjSh)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
SIDEModel::~SIDEModel()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
uno::Any SAL_CALL SIDEModel::queryInterface( const uno::Type& rType ) throw(uno::RuntimeException, std::exception)
|
2003-09-19 07:30:26 +00:00
|
|
|
{
|
|
|
|
uno::Any aRet = ::cppu::queryInterface ( rType,
|
|
|
|
// OWeakObject interfaces
|
2007-01-16 15:34:12 +00:00
|
|
|
static_cast< XInterface* >( static_cast< OWeakObject* >( this ) ),
|
2003-09-19 07:30:26 +00:00
|
|
|
static_cast< XWeak* > ( this ),
|
|
|
|
static_cast< XServiceInfo* > ( this ) );
|
|
|
|
if (!aRet.hasValue())
|
|
|
|
aRet = SfxBaseModel::queryInterface ( rType );
|
|
|
|
return aRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SAL_CALL SIDEModel::acquire() throw()
|
|
|
|
{
|
2010-10-13 04:35:41 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2003-09-19 07:30:26 +00:00
|
|
|
OWeakObject::acquire();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SAL_CALL SIDEModel::release() throw()
|
|
|
|
{
|
2010-10-13 04:35:41 -05:00
|
|
|
SolarMutexGuard aGuard;
|
2003-09-19 07:30:26 +00:00
|
|
|
OWeakObject::release();
|
|
|
|
}
|
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
uno::Sequence< uno::Type > SAL_CALL SIDEModel::getTypes( ) throw(uno::RuntimeException, std::exception)
|
2003-09-19 07:30:26 +00:00
|
|
|
{
|
|
|
|
uno::Sequence< uno::Type > aTypes = SfxBaseModel::getTypes();
|
|
|
|
sal_Int32 nLen = aTypes.getLength();
|
|
|
|
aTypes.realloc(nLen + 1);
|
|
|
|
uno::Type* pTypes = aTypes.getArray();
|
2014-05-22 23:19:05 +02:00
|
|
|
pTypes[nLen++] = cppu::UnoType<XServiceInfo>::get();
|
2003-09-19 07:30:26 +00:00
|
|
|
|
|
|
|
return aTypes;
|
|
|
|
}
|
|
|
|
|
2015-04-14 12:44:47 +02:00
|
|
|
OUString SIDEModel::getImplementationName() throw( uno::RuntimeException, std::exception )
|
2003-09-19 07:30:26 +00:00
|
|
|
{
|
|
|
|
return getImplementationName_Static();
|
|
|
|
}
|
|
|
|
|
2012-09-27 13:22:42 -03:00
|
|
|
OUString SIDEModel::getImplementationName_Static()
|
2003-09-19 07:30:26 +00:00
|
|
|
{
|
2012-09-27 13:22:42 -03:00
|
|
|
return OUString( "com.sun.star.comp.basic.BasicIDE" );
|
2003-09-19 07:30:26 +00:00
|
|
|
}
|
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
sal_Bool SIDEModel::supportsService(const OUString& rServiceName) throw( uno::RuntimeException, std::exception )
|
2003-09-19 07:30:26 +00:00
|
|
|
{
|
2014-01-31 03:09:23 -02:00
|
|
|
return cppu::supportsService(this, rServiceName);
|
2003-09-19 07:30:26 +00:00
|
|
|
}
|
2015-04-14 12:44:47 +02:00
|
|
|
uno::Sequence< OUString > SIDEModel::getSupportedServiceNames() throw( uno::RuntimeException, std::exception )
|
2003-09-19 07:30:26 +00:00
|
|
|
{
|
|
|
|
return getSupportedServiceNames_Static();
|
|
|
|
}
|
|
|
|
|
2015-04-14 12:44:47 +02:00
|
|
|
uno::Sequence< OUString > SIDEModel::getSupportedServiceNames_Static()
|
2003-09-19 07:30:26 +00:00
|
|
|
{
|
|
|
|
uno::Sequence< OUString > aRet(1);
|
|
|
|
OUString* pArray = aRet.getArray();
|
2012-09-27 13:22:42 -03:00
|
|
|
pArray[0] = "com.sun.star.script.BasicIDE" ;
|
2003-09-19 07:30:26 +00:00
|
|
|
return aRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
uno::Reference< uno::XInterface > SAL_CALL SIDEModel_createInstance(
|
2007-01-16 15:34:12 +00:00
|
|
|
const uno::Reference< lang::XMultiServiceFactory > & ) throw( uno::Exception )
|
2003-09-19 07:30:26 +00:00
|
|
|
{
|
2010-10-13 04:35:41 -05:00
|
|
|
SolarMutexGuard aGuard;
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
EnsureIde();
|
|
|
|
SfxObjectShell* pShell = new DocShell();
|
2003-09-19 07:30:26 +00:00
|
|
|
return uno::Reference< uno::XInterface >( pShell->GetModel() );
|
|
|
|
}
|
|
|
|
|
2012-12-04 10:53:56 +00:00
|
|
|
// XStorable
|
2014-02-25 21:31:58 +01:00
|
|
|
void SAL_CALL SIDEModel::store() throw (io::IOException, uno::RuntimeException, std::exception)
|
2012-12-04 10:53:56 +00:00
|
|
|
{
|
|
|
|
notImplemented();
|
|
|
|
}
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
void SAL_CALL SIDEModel::storeAsURL( const OUString&, const uno::Sequence< beans::PropertyValue >& )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw (io::IOException, uno::RuntimeException, std::exception)
|
2012-12-04 10:53:56 +00:00
|
|
|
{
|
|
|
|
notImplemented();
|
|
|
|
}
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
void SAL_CALL SIDEModel::storeToURL( const OUString&,
|
2013-04-01 19:01:52 +02:00
|
|
|
const uno::Sequence< beans::PropertyValue >& )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw (io::IOException, uno::RuntimeException, std::exception)
|
2012-12-04 10:53:56 +00:00
|
|
|
{
|
|
|
|
notImplemented();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SIDEModel::notImplemented() throw ( io::IOException )
|
|
|
|
{
|
2014-05-23 12:03:21 +02:00
|
|
|
throw io::IOException("Can't store IDE model" );
|
2012-12-04 10:53:56 +00:00
|
|
|
}
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
} // namespace basctl
|
|
|
|
|
2010-10-12 15:57:08 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|