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 .
19 #ifndef __com_sun_star_frame_XModel_idl__
20 #define __com_sun_star_frame_XModel_idl__
22 #include
<com
/sun
/star
/lang
/XComponent.idl
>
23 #include
<com
/sun
/star
/beans
/PropertyValue.idl
>
24 #include
<com
/sun
/star
/frame
/XController.idl
>
25 #include
<com
/sun
/star
/container
/NoSuchElementException.idl
>
26 #include
<com
/sun
/star
/uno
/XInterface.idl
>
30 module com
{ module sun
{ module star
{ module frame
{
32 /** represents a component which is created from an URL and arguments.
35 It is a representation of a resource in the sense that it was
36 created/loaded from the resource. The arguments are passed to the loader
37 to modify its behavior. An example for such an argument is "AsTemplate",
38 which loads the resource as a template for a new document.
39 (see com::sun::star::document::MediaDescriptor for further details)
43 Models can be controlled by controller components, which are usually
45 (see Controller for further details)
49 If there is at least one controller, there is by definition a
50 current controller. And if that controller supports the interface
51 com::sun::star::view::XSelectionSupplier, it has a current selection too.
54 @see com::sun::star::document::MediaDescriptor
56 @see com::sun::star::view::XSelectionSupplier
58 published
interface XModel
: com
::sun
::star
::lang
::XComponent
60 /** informs a model about its resource description.
63 specifies the resource
66 are optional arguments for that resource
67 (see com::sun::star::document::MediaDescriptor)
74 boolean attachResource
(
76 [in] sequence
<com
::sun
::star
::beans
::PropertyValue
> Arguments
);
78 /** provides information about the location of this model
81 the URL of the resource which is represented by this model.
83 @see XStorable::getLocation()
87 /** provides read access on currently representation of the
88 com::sun::star::document::MediaDescriptor
89 of this model which describes the model and his state
92 the arguments with which the model was originally created or
95 sequence
< com
::sun
::star
::beans
::PropertyValue
> getArgs
();
97 /** is called whenever a new controller is created for this model.
100 The com::sun::star::lang::XComponent interface
101 of the controller must be used to recognize when it is deleted.
105 a new controller for this model
107 @see XModel::disconnectController()
109 void connectController
( [in] XController Controller
);
111 /** is called whenever an existing controller should be deregistered at this model.
114 The com::sun::star::lang::XComponent interface
115 of the controller must be used to recognize when it is deleted.
119 the existing controller which should be deregistered
121 @see XModel::connectController()
123 void disconnectController
( [in] XController Controller
);
125 /** suspends some notifications to the controllers which are used
129 The calls to XModel::lockControllers() and
130 XModel::unlockControllers() may be
131 nested and even overlapping, but they must be in pairs. While
132 there is at least one lock remaining, some notifications
133 for display updates are not broadcasted.
136 void lockControllers
();
138 /** resumes the notifications which were suspended by
139 XModel::lockControllers().
142 The calls to XModel::lockControllers() and
143 XModel::unlockControllers() may be
144 nested and even overlapping, but they must be in pairs. While
145 there is at least one lock remaining, some notifications for
146 display updates are not broadcasted.
149 void unlockControllers
();
151 /** determines if there is at least one lock remaining.
154 While there is at least one lock remaining, some notifications
155 for display updates are not broadcasted to the controllers.
159 `TRUE` if any lock exist
163 boolean hasControllersLocked
();
165 /** provides access to the controller which currently controls this model
168 If the controller which is active is a controller of this model,
169 it will be returned. If not, the controller which was the last
170 active of this model is returned. If no controller of this model
171 ever was active, the controller first registered is returned. If no
172 controller is registered for this model, `NULL` is returned.
174 XController getCurrentController
();
176 /** sets a registered controller as the current controller.
179 reference to an already existing connected controller, which should be
182 @throws com::sun::star::container::NoSuchElementException
183 if <var>xController</var> isn't an already connected controller on this model
185 void setCurrentController
( [in] XController Controller
)
186 raises
( com
::sun
::star
::container
::NoSuchElementException
);
188 /** provides read access on current selection on controller
191 the current selection in the current controller.
192 If there is no current controller, it returns `NULL`.
194 com
::sun
::star
::uno
::XInterface getCurrentSelection
();
202 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */