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 .
21 module com
{ module sun
{ module star
{ module document
{
22 interface XScriptInvocationContext
;
26 module com
{ module sun
{ module star
{ module script
{ module provider
{
29 This interface is provided to scripts, and provides a means of access to
30 the various interfaces which they might need to perform some action on
31 a document. It is required to be passed as the first argument for any
34 interface XScriptContext
: ::com
::sun
::star
::uno
::XInterface
{
37 Obtain the document reference on which the script can operate
40 com::sun::star::frame::XModel interface
42 ::com
::sun
::star
::frame
::XModel getDocument
();
44 /** provides access to the context where the script was invoked
46 <p>In some cases, it is possible that scripts, embedded in a document,
47 are executed from within a context which is <em>not</em> the document
48 itself. In this case, the <code>getInvocationContext</code> member allows
49 to access this context.</p>
51 <p>Note that the returned context is allowed to be `NULL`, in this case,
52 the document as returned by <code>getDocument</code> is the invocation context.</p>
54 <p>If the returned context is not `NULL`, its <code>ScriptContainer</code> attribute
55 equals the document as returned by <code>XScriptContext::getDocument</code>.</p>
59 ::com
::sun
::star
::document
::XScriptInvocationContext getInvocationContext
();
62 Obtain the desktop reference on which the script can operate
65 com::sun::star::frame::XDesktop interface
67 ::com
::sun
::star
::frame
::XDesktop getDesktop
();
70 Obtain the component context which the script can use to create
74 com::sun::star::uno::XComponentContext interface
76 ::com
::sun
::star
::uno
::XComponentContext getComponentContext
();
81 }; }; }; }; }; // ::com::sun::star::script::provider
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */