summaryrefslogtreecommitdiff
path: root/offapi/com/sun/star/frame/XModel2.idl
blob: 4221a527c38051e1c59d28fab1099ba9b9bf576f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * 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 .
 */
#ifndef __com_sun_star_frame_XModel2_idl__
#define __com_sun_star_frame_XModel2_idl__

#include <com/sun/star/frame/XController2.idl>
#include <com/sun/star/frame/XModel.idl>
#include <com/sun/star/container/XEnumeration.idl>
#include <com/sun/star/awt/XWindow.idl>
#include <com/sun/star/lang/IllegalArgumentException.idl>
#include <com/sun/star/util/InvalidStateException.idl>


 module com {  module sun {  module star {  module frame {

/** extends interface XModel.

    The following functions are added:

    - enumeration of all currently connected controller objects.
      (not getCurrentController() only, which depends on focus)

    - establish new view controller factory methods, which will make
      it possible to create new views for this model.
 */
interface XModel2 : com::sun::star::frame::XModel
{
    /** provides list of all currently connected controller objects.

        <p>
        Please note: Because this interface will might be used inside
        multi threaded environments those list can contain still disposed items
        or it new added controller will be missing (if they were added after this
        enumeration was created).
        </P>

        @returns
            list of controller objects.
            Enumeration can be empty but not NULL.
     */
    com::sun::star::container::XEnumeration getControllers();

    /** provides the available names of the factory to be used to create views.

        <p>The names are usually logical view names. The following names have
        a defined meaning, i.e. every concrete implementation which returns such
        a name must ensure it has the same meaning, and if a concrete implementation
        has a view with the given meaning, it must give it the name as defined here:
        <ul>
            <li><b>Default</b> specifies the default view of the document.</li>
            <li><b>Preview</b> specifies a preview of the document. A minimal implementation of such a view
                is a <em>Default</em> view which is read-only.</li>
            <li><b>PrintPreview</b> specifies a print preview of the document.</li>
        </ul>
        </p>

        <p>Implementations of this interface might decide to support additional
        view names, which then are documented in the respective service descriptions.</p>

        @see createView

        @returns
            a sequence of names of all supported views for this document.
     */
    sequence< string > getAvailableViewControllerNames();

    /** creates the default view instance for this model.

        <p>Effectively, this method is equivalent to calling createView() with
        the <code>ViewName</code> being <code>&quot;Default&quot;</code>.</p>

        @param Frame
               used to place the new created view there

        @return the new view controller instance

        @throws ::com::sun::star::lang::IllegalArgumentException
                if one of the given parameter was wrong

        @throws ::com::sun::star::uno::Exception
                if creation of a new view failed by other reasons
     */
    com::sun::star::frame::XController2 createDefaultViewController( [in]  com::sun::star::frame::XFrame Frame )
        raises (com::sun::star::lang::IllegalArgumentException,
                com::sun::star::uno::Exception                );

    /** creates a new view instance classified by the specified name and arguments.

        <p>The newly created controller must not be connected with the document and the
        frame. That is, you should neither call XFrame::setComponent(), nor
        XController::attachFrame(), nor XController::attachModel(),
        nor XModel::connectController(), not XModel::setCurrentController().
        All of this is the responsibility of the caller, which will do it in the proper order.</p>

        @param ViewName
               classified name of instance

        @param Arguments
               arguments used for creation

        @param Frame
               used to place the new created view there

        @return the new view controller instance

        @throws ::com::sun::star::lang::IllegalArgumentException
                if one of the given parameter was wrong

        @throws ::com::sun::star::uno::Exception
                if creation of a new view failed by other reasons
     */
    com::sun::star::frame::XController2 createViewController( [in]  string                                           ViewName       ,
                                                              [in]  sequence< com::sun::star::beans::PropertyValue > Arguments      ,
                                                              [in]  com::sun::star::frame::XFrame                    Frame          )
        raises (com::sun::star::lang::IllegalArgumentException,
                com::sun::star::uno::Exception                );

    /** Sets com::sun::star::document::MediaDescriptor properties
        of the current model during runtime.

        @since LibreOffice 6.3

        @param Arguments
            Properties which should be set
            Supported properties:
            <ul>
                <li>com::sun::star::document::MediaDescriptor::SuggestedSaveAsDir</li>
                <li>com::sun::star::document::MediaDescriptor::SuggestedSaveAsName</li>
                <li>com::sun::star::document::MediaDescriptor::LockContentExtraction</li>
                <li>com::sun::star::document::MediaDescriptor::LockExport</li>
                <li>com::sun::star::document::MediaDescriptor::LockPrint</li>
                <li>com::sun::star::document::MediaDescriptor::LockSave</li>
                <li>com::sun::star::document::MediaDescriptor::LockEditDoc</li>
            </ul>

        @throws com::sun::star::lang::IllegalArgumentException When trying to set an unsupported property
        @throws com::sun::star::util::InvalidStateException When the document model can not be retrieved
     */
    void setArgs([in] sequence< com::sun::star::beans::PropertyValue > Arguments)
        raises(com::sun::star::lang::IllegalArgumentException,
               com::sun::star::util::InvalidStateException);
};


}; }; }; };

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */