Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / offapi / com / sun / star / script / provider / XScriptContext.idl
blob096c7f12eb4894df3ccaab2b58700265cea2c829
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #ifndef __com_sun_star_script_provider_XScriptContext_idl__
21 #define __com_sun_star_script_provider_XScriptContext_idl__
23 #include <com/sun/star/uno/XInterface.idl>
24 #include <com/sun/star/frame/XDesktop.idl>
25 #include <com/sun/star/frame/XModel.idl>
26 #include <com/sun/star/uno/XComponentContext.idl>
29 module com { module sun { module star { module document {
30 interface XScriptInvocationContext;
31 }; }; }; };
34 module com { module sun { module star { module script { module provider {
36 /**
37 This interface is provided to scripts, and provides a means of access to
38 the various interfaces which they might need to perform some action on
39 a document. It is required to be passed as the first argument for any
40 Java scripts.
42 interface XScriptContext : ::com::sun::star::uno::XInterface {
44 /**
45 Obtain the document reference on which the script can operate
47 @returns
48 com::sun::star::frame::XModel interface
50 ::com::sun::star::frame::XModel getDocument();
52 /** provides access to the context where the script was invoked
54 <p>In some cases, it is possible that scripts, embedded in a document,
55 are executed from within a context which is <em>not</em> the document
56 itself. In this case, the <code>getInvocationContext</code> member allows
57 to access this context.</p>
59 <p>Note that the returned context is allowed to be `NULL`, in this case,
60 the document as returned by <code>getDocument</code> is the invocation context.</p>
62 <p>If the returned context is not `NULL`, its <code>ScriptContainer</code> attribute
63 equals the document as returned by <code>XScriptContext::getDocument</code>.</p>
65 @since OOo 3.0
67 ::com::sun::star::document::XScriptInvocationContext getInvocationContext();
69 /**
70 Obtain the desktop reference on which the script can operate
72 @returns
73 com::sun::star::frame::XDesktop interface
75 ::com::sun::star::frame::XDesktop getDesktop();
77 /**
78 Obtain the component context which the script can use to create
79 other uno components
81 @returns
82 com::sun::star::uno::XComponentContext interface
84 ::com::sun::star::uno::XComponentContext getComponentContext();
89 }; }; }; }; }; // ::com::sun::star::script::provider
91 #endif
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */