2012-07-05 13:54:17 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/*
|
2013-04-24 17:14:03 +01:00
|
|
|
* This file is part of the LibreOffice project.
|
2012-07-05 13:54:17 +01:00
|
|
|
*
|
|
|
|
* 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/.
|
|
|
|
*/
|
2020-08-04 21:07:00 +00:00
|
|
|
#pragma once
|
2012-07-05 13:54:17 +01:00
|
|
|
|
|
|
|
#include <sal/types.h>
|
2013-11-11 21:25:36 -06:00
|
|
|
#include <cppunit/TestFixture.h>
|
|
|
|
#include <cppunit/extensions/HelperMacros.h>
|
|
|
|
#include <cppunit/plugin/TestPlugIn.h>
|
2012-07-05 13:54:17 +01:00
|
|
|
#include <test/bootstrapfixture.hxx>
|
2013-11-11 21:25:36 -06:00
|
|
|
#include <basic/sbstar.hxx>
|
|
|
|
#include <basic/basrdll.hxx>
|
|
|
|
#include <basic/sbmod.hxx>
|
|
|
|
#include <basic/sbmeth.hxx>
|
|
|
|
#include <basic/sbuno.hxx>
|
2012-07-05 13:54:17 +01:00
|
|
|
|
2013-03-06 21:14:08 +00:00
|
|
|
class MacroSnippet
|
|
|
|
{
|
2016-01-30 22:12:35 +01:00
|
|
|
private:
|
2013-03-06 21:14:08 +00:00
|
|
|
bool mbError;
|
2019-12-07 15:27:08 +01:00
|
|
|
ErrCode maErrCode;
|
2015-01-18 23:31:37 +01:00
|
|
|
BasicDLL maDll; // we need a dll instance for resource manager etc.
|
2013-03-06 21:14:08 +00:00
|
|
|
SbModuleRef mpMod;
|
|
|
|
StarBASICRef mpBasic;
|
|
|
|
|
2016-01-30 22:12:35 +01:00
|
|
|
void InitSnippet();
|
2020-12-16 22:28:02 +00:00
|
|
|
void MakeModule(const OUString& sName, const OUString& sSource);
|
2013-03-06 21:14:08 +00:00
|
|
|
|
2016-01-30 22:12:35 +01:00
|
|
|
public:
|
|
|
|
explicit MacroSnippet(const OUString& sSource);
|
|
|
|
MacroSnippet();
|
2013-03-06 21:14:08 +00:00
|
|
|
|
2020-12-16 22:28:02 +00:00
|
|
|
void LoadSourceFromFile(const OUString& sName, const OUString& sMacroFileURL);
|
2014-05-01 23:42:49 +10:00
|
|
|
|
2016-01-30 22:12:35 +01:00
|
|
|
SbxVariableRef Run(const css::uno::Sequence<css::uno::Any>& rArgs);
|
2013-03-06 21:14:08 +00:00
|
|
|
|
2016-01-30 22:12:35 +01:00
|
|
|
SbxVariableRef Run();
|
2013-03-06 21:14:08 +00:00
|
|
|
|
2016-01-30 22:12:35 +01:00
|
|
|
bool Compile();
|
2013-03-06 21:14:08 +00:00
|
|
|
|
2016-10-05 07:56:12 +02:00
|
|
|
DECL_LINK(BasicErrorHdl, StarBASIC*, bool);
|
2013-03-06 21:14:08 +00:00
|
|
|
|
2019-09-03 11:47:17 +02:00
|
|
|
bool HasError() const;
|
2019-12-07 15:27:08 +01:00
|
|
|
const ErrCode& getError() const;
|
2013-03-06 21:14:08 +00:00
|
|
|
};
|
|
|
|
|
2012-07-05 13:54:17 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|