20#include <com/sun/star/task/XStatusIndicatorSupplier.hpp>
21#include <com/sun/star/task/XStatusIndicator.hpp>
22#include <com/sun/star/util/thePathSettings.hpp>
23#include <com/sun/star/awt/XDevice.hpp>
29#include <osl/file.hxx>
41#include <ooo/vba/XConnectionPoint.hpp>
42#include <ooo/vba/word/WdEnableCancelKey.hpp>
43#include <ooo/vba/word/WdWindowState.hpp>
44#include <ooo/vba/word/XApplicationOutgoing.hpp>
45#include <ooo/vba/word/XBookmarks.hpp>
61class SwVbaApplicationOutgoingConnectionPoint :
public cppu::WeakImplHelper<XConnectionPoint>
70 sal_uInt32 SAL_CALL Advise(
const uno::Reference< XSink >& Sink )
override;
71 void SAL_CALL Unadvise( sal_uInt32 Cookie )
override;
93 SW_MOD()->RegisterAutomationApplicationEventsCaller( uno::Reference< XSinkCaller >(
this) );
101 if (nNumber < 1 || nNumber >
mvSinks.size())
104 mvSinks[nNumber-1] = uno::Reference< XSink >();
110 return "Microsoft Word";
113uno::Reference< word::XDocument > SAL_CALL
124 uno::Reference< frame::XController >
xController(
xModel->getCurrentController(), uno::UNO_SET_THROW );
128uno::Reference< css::uno::XComponentContext >
const &
134uno::Reference< word::XWindow > SAL_CALL
140uno::Reference<word::XSystem > SAL_CALL
146uno::Reference<word::XOptions > SAL_CALL
159 catch (
const uno::RuntimeException&)
165uno::Reference< word::XSelection > SAL_CALL
171uno::Reference< word::XWordBasic > SAL_CALL
174 uno::Reference< word::XWordBasic > xWB(
new SwWordBasic(
this ) );
182 if (
index.hasValue() )
191 if (
index.hasValue() )
200 if (
index.hasValue() )
201 return xCol->Item(
index );
208 uno::Reference< text::XTextDocument > xTextDoc(
getCurrentDocument(), uno::UNO_QUERY_THROW );
210 if (
index.hasValue() )
228 return word::WdEnableCancelKey::wdCancelInterrupt;
241 uno::Any aState = xWindow->getWindowState();
247 return word::WdWindowState::wdWindowStateNormal;
258 aState <<= _windowstate;
259 xWindow->setWindowState( aState );
262 catch (
const uno::RuntimeException&)
270 return pWindow->getWidth();
276 pWindow->setWidth( _width );
282 return pWindow->getHeight();
288 pWindow->setHeight( _height );
294 return pWindow->getLeft();
300 pWindow->setLeft( _left );
306 return pWindow->getTop();
312 pWindow->setTop( _top );
336 uno::Reference< task::XStatusIndicatorSupplier > xStatusIndicatorSupplier(
xModel->getCurrentController(), uno::UNO_QUERY );
337 if (xStatusIndicatorSupplier.is())
339 uno::Reference< task::XStatusIndicator > xStatusIndicator = xStatusIndicatorSupplier->getStatusIndicator();
340 if (xStatusIndicator.is())
341 xStatusIndicator->start( _statusbar, 100 );
352 SAL_INFO(
"extensions.olebridge",
"Client debug output: " << _statusbar);
369 uno::Reference< frame::XController >
xController(
xModel->getCurrentController(), uno::UNO_SET_THROW );
370 uno::Reference< frame::XFrame >
xFrame(
xController->getFrame(), uno::UNO_SET_THROW );
371 uno::Reference< awt::XWindow > xWindow(
xFrame->getContainerWindow(), uno::UNO_SET_THROW );
372 css::uno::Reference< css::awt::XDevice > xDevice( xWindow, css::uno::UNO_QUERY );
380 uno::Reference< frame::XController >
xController(
xModel->getCurrentController(), uno::UNO_SET_THROW );
381 uno::Reference< frame::XFrame >
xFrame(
xController->getFrame(), uno::UNO_SET_THROW );
382 uno::Reference< awt::XWindow > xWindow(
xFrame->getContainerWindow(), uno::UNO_SET_THROW );
383 css::uno::Reference< css::awt::XDevice > xDevice( xWindow, css::uno::UNO_QUERY );
429 pWindow->setWidth(
Width );
430 pWindow->setHeight(
Height );
437 pWindow->setLeft(
Left );
438 pWindow->setTop(
Top );
446 return "{82154421-0FBF-11d4-8313-005004526AB4}";
454 return "{82154423-0FBF-11D4-8313-005004526AB4}";
462 "{82154422-0FBF-11D4-8313-005004526AB4}"
468uno::Reference<XConnectionPoint> SAL_CALL
471 uno::Reference<XConnectionPoint> xCP(
new SwVbaApplicationOutgoingConnectionPoint(
this));
478 return "SwVbaApplication";
481uno::Sequence< OUString >
486 "ooo.vba.word.Application"
491uno::Reference< frame::XModel >
511SwVbaApplicationOutgoingConnectionPoint::SwVbaApplicationOutgoingConnectionPoint(
SwVbaApplication* pApp ) :
518SwVbaApplicationOutgoingConnectionPoint::Advise(
const uno::Reference< XSink >& Sink )
520 return mpApp->AddSink(Sink);
524SwVbaApplicationOutgoingConnectionPoint::Unadvise( sal_uInt32 Cookie )
526 mpApp->RemoveSink( Cookie );
static SvxAutoCorrCfg & Get()
bool IsAutoTextTip() const
void SetAutoTextTip(bool bSet)
virtual void SAL_CALL setHeight(sal_Int32 _height) override
virtual OUString SAL_CALL getName() override
virtual css::uno::Any SAL_CALL ListGalleries(const css::uno::Any &aIndex) override
virtual OUString getServiceImplName() override
virtual css::uno::Sequence< OUString > getServiceNames() override
virtual sal_Int32 SAL_CALL getHeight() override
virtual void SAL_CALL CallSinks(const OUString &Method, css::uno::Sequence< css::uno::Any > &Arguments) override
virtual css::uno::Reference< ooo::vba::word::XSystem > SAL_CALL getSystem() override
virtual sal_Int32 SAL_CALL getLeft() override
virtual css::uno::Any SAL_CALL Addins(const css::uno::Any &aIndex) override
virtual float SAL_CALL CentimetersToPoints(float Centimeters) override
virtual void SAL_CALL setEnableCancelKey(sal_Int32 _enableCancelKey) override
sal_uInt32 AddSink(const css::uno::Reference< ooo::vba::XSink > &xSink)
virtual sal_Int32 SAL_CALL getTop() override
virtual sal_Bool SAL_CALL getDisplayAutoCompleteTips() override
virtual css::uno::Reference< ov::word::XWindow > SAL_CALL getActiveWindow() override
virtual sal_Int32 SAL_CALL getEnableCancelKey() override
std::vector< css::uno::Reference< ooo::vba::XSink > > mvSinks
virtual OUString SAL_CALL GetIIDForClassItselfNotCoclass() override
virtual css::uno::Reference< ooo::vba::word::XOptions > SAL_CALL getOptions() override
virtual float SAL_CALL PointsToPixels(float Pixels, ::sal_Bool fVertical) override
virtual css::uno::Any SAL_CALL Documents(const css::uno::Any &aIndex) override
virtual OUString SAL_CALL getStatusBar() override
virtual void SAL_CALL setLeft(sal_Int32 _left) override
void RemoveSink(sal_uInt32 nNumber)
virtual sal_Int32 SAL_CALL getWindowState() override
virtual OUString SAL_CALL getIID() override
virtual float SAL_CALL PointsToMillimeters(float Points) override
virtual void SAL_CALL Resize(sal_Int32 Width, sal_Int32 Height) override
virtual void SAL_CALL ShowMe() override
virtual css::uno::Reference< ooo::vba::word::XSelection > SAL_CALL getSelection() override
css::uno::Reference< css::uno::XComponentContext > const & getContext() const
virtual float SAL_CALL InchesToPoints(float Inches) override
virtual float SAL_CALL PointsToInches(float Points) override
virtual float SAL_CALL PointsToCentimeters(float Points) override
virtual void SAL_CALL setCustomizationContext(const css::uno::Any &_customizationcontext) override
virtual css::uno::Reference< ov::XConnectionPoint > SAL_CALL FindConnectionPoint() override
virtual void SAL_CALL Move(sal_Int32 Left, sal_Int32 Top) override
virtual float SAL_CALL PointsToPicas(float Points) override
virtual void SAL_CALL setDisplayAutoCompleteTips(sal_Bool _displayAutoCompleteTips) override
virtual float SAL_CALL MillimetersToPoints(float Millimeters) override
virtual ov::TypeAndIID SAL_CALL GetConnectionPoint() override
virtual css::uno::Any SAL_CALL Dialogs(const css::uno::Any &aIndex) override
virtual ~SwVbaApplication() override
rtl::Reference< SwVbaWindow > getActiveSwVbaWindow()
virtual sal_Int32 SAL_CALL getWidth() override
virtual float SAL_CALL PixelsToPoints(float Pixels, ::sal_Bool fVertical) override
virtual css::uno::Any SAL_CALL CommandBars(const css::uno::Any &aIndex) override
virtual css::uno::Reference< css::frame::XModel > getCurrentDocument() override
SwVbaApplication(css::uno::Reference< css::uno::XComponentContext > &xContext)
virtual css::uno::Reference< ooo::vba::word::XWordBasic > SAL_CALL getWordBasic() override
virtual void SAL_CALL setTop(sal_Int32 _top) override
virtual float SAL_CALL PicasToPoints(float Picas) override
virtual css::uno::Reference< ov::word::XDocument > SAL_CALL getActiveDocument() override
virtual void SAL_CALL setStatusBar(const OUString &_statusbar) override
virtual css::uno::Any SAL_CALL getCustomizationContext() override
virtual void SAL_CALL setWidth(sal_Int32 _width) override
virtual void SAL_CALL setWindowState(sal_Int32 _windowstate) override
This is a representation of the WordBasic statements and functions that were available in Word versio...
virtual css::uno::Any SAL_CALL CommandBars(const css::uno::Any &aIndex) override
css::uno::Type const & get()
std::deque< AttacherIndex_Impl > aIndex
Sequence< OUString > aServiceNames
tools::SvRef< SvBaseLink > xSink
#define SAL_INFO(area, stream)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
double PixelsToPoints(const css::uno::Reference< css::awt::XDevice > &xDevice, double fPixels, bool bVertical)
VBAHELPER_DLLPUBLIC css::uno::Reference< css::frame::XModel > getCurrentWordDoc(const css::uno::Reference< css::uno::XComponentContext > &xContext)
double PointsToPixels(const css::uno::Reference< css::awt::XDevice > &xDevice, double fPoints, bool bVertical)
std::vector< Point > Points
Reference< XController > xController
Reference< XFrame > xFrame
Reference< XModel > xModel
cppu::ImplInheritanceHelper< VbaApplicationBase, ooo::vba::word::XApplication, ooo::vba::XSinkCaller > SwVbaApplication_BASE