The interface <idl>com.sun.star.frame.XModel</idl> inherits from <idl>com.sun.star.lang.XComponent</idl> and introduces the following methods, which handle the model's resource description, manage its controllers and retrieves the current selection.

The interface <idl>com.sun.star.frame.XModel</idl> inherits from <idl>com.sun.star.lang.XComponent</idl> and introduces the following methods, which handle the model's resource description, manage its controllers and retrieves the current selection.

−

+

<source lang="idl">

string getURL ()

string getURL ()

sequence < com::sun::star::beans::PropertyValue > getArgs ()

sequence < com::sun::star::beans::PropertyValue > getArgs ()

Line 30:

Line 30:

com::sun::star::uno::XInterface getCurrentSelection ()

com::sun::star::uno::XInterface getCurrentSelection ()

−

+

</source>

The method <code>getURL()</code> provides the URL where a document was loaded from or last stored using <code>storeAsURL()</code>. As long as a new document has not been saved, the URL is an empty string. The method <code>getArgs()</code> returns a sequence of property values that report the resource description according to <idl>com.sun.star.document.MediaDescriptor</idl>, specified on loading or saving with s<code>toreAsURL</code>. The method <code>attachResource()</code> is used by the frame loader implementations to inform the model about its URL and <code>MediaDescriptor</code>.

The method <code>getURL()</code> provides the URL where a document was loaded from or last stored using <code>storeAsURL()</code>. As long as a new document has not been saved, the URL is an empty string. The method <code>getArgs()</code> returns a sequence of property values that report the resource description according to <idl>com.sun.star.document.MediaDescriptor</idl>, specified on loading or saving with s<code>toreAsURL</code>. The method <code>attachResource()</code> is used by the frame loader implementations to inform the model about its URL and <code>MediaDescriptor</code>.

Line 41:

Line 41:

<!--<idltopic>com.sun.star.util.XModifiable</idltopic>-->

<!--<idltopic>com.sun.star.util.XModifiable</idltopic>-->

The interface <idl>com.sun.star.util.XModifiable</idl> traces the modified status of a document:

The interface <idl>com.sun.star.util.XModifiable</idl> traces the modified status of a document:

The interface <idl>com.sun.star.view.XPrintable</idl> is used to set and get the printer and its settings, and dispatch print jobs. These methods and special printing features for the various document types are described in the chapters [[Documentation/DevGuide/Text/Printing Text Documents|Printing Text Documents]], [[Documentation/DevGuide/Spreadsheets/Printing Spreadsheet Documents|Printing Spreadsheet Documents]], [[Documentation/DevGuide/Drawings/Printing Drawing Documents|Printing Drawing Documents]] and [[Documentation/DevGuide/Drawings/Printing Presentation Documents|Printing Presentation Documents]].

The interface <idl>com.sun.star.view.XPrintable</idl> is used to set and get the printer and its settings, and dispatch print jobs. These methods and special printing features for the various document types are described in the chapters [[Documentation/DevGuide/Text/Printing Text Documents|Printing Text Documents]], [[Documentation/DevGuide/Spreadsheets/Printing Spreadsheet Documents|Printing Spreadsheet Documents]], [[Documentation/DevGuide/Drawings/Printing Drawing Documents|Printing Drawing Documents]] and [[Documentation/DevGuide/Drawings/Printing Presentation Documents|Printing Presentation Documents]].

For versions later than 641, the optional interface <idl>com.sun.star.document.XEventBroadcaster</idl> at office documents enables developers to add listeners for events related to office documents in general, or for events specific for the individual document type.See [[Documentation/DevGuide/OfficeDev/Document Events|Document Events]]).

For versions later than 641, the optional interface <idl>com.sun.star.document.XEventBroadcaster</idl> at office documents enables developers to add listeners for events related to office documents in general, or for events specific for the individual document type.See [[Documentation/DevGuide/OfficeDev/Document Events|Document Events]]).

The struct <idl>com.sun.star.document.EventObject</idl> has a string member <code>EventName</code>, that assumes one of the values specified in <idl>com.sun.star.document.Events</idl>. These events are also on the '''Events''' tab of the '''Tools - Configure''' dialog.

The struct <idl>com.sun.star.document.EventObject</idl> has a string member <code>EventName</code>, that assumes one of the values specified in <idl>com.sun.star.document.Events</idl>. These events are also on the '''Events''' tab of the '''Tools - Configure''' dialog.

The view data are a <idl>com.sun.star.container.XIndexAccess</idl> to sequences of <idl>com.sun.star.beans.PropertyValue</idl> structs. Each sequence represents the settings of a view to the model that supplies the view data.

The view data are a <idl>com.sun.star.container.XIndexAccess</idl> to sequences of <idl>com.sun.star.beans.PropertyValue</idl> structs. Each sequence represents the settings of a view to the model that supplies the view data.

The method getURL() provides the URL where a document was loaded from or last stored using storeAsURL(). As long as a new document has not been saved, the URL is an empty string. The method getArgs() returns a sequence of property values that report the resource description according to com.sun.star.document.MediaDescriptor, specified on loading or saving with storeAsURL. The method attachResource() is used by the frame loader implementations to inform the model about its URL and MediaDescriptor.

The current or last active controller for a model is retrieved through getCurrentController(). The corresponding method setCurrentController() sets a different current controller at models where additional controllers are available. However, additional controllers can not be created at this time for OpenOffice.org components using the component API. The method connectController() is used by frame loader implementations and provides the model with a new controller that has been created for it, without making it the current controller. The disconnectController() tells the model that a controller may no longer be used. Finally, the model holds back screen updates using lockControllers() and unlockControllers(). For each call to lockControllers(), there must be a call to unlockControllers() to remove the lock. The method hasControllersLocked() tells if the controllers are locked.

The currently selected object is retrieved by a call to getCurrentSelection(). This method is an alternative to getSelection() at the com.sun.star.view.XSelectionSupplier interface supported by controller services.

XEventBroadcaster

For versions later than 641, the optional interface com.sun.star.document.XEventBroadcaster at office documents enables developers to add listeners for events related to office documents in general, or for events specific for the individual document type.See Document Events).

The general events are the same events as those provided at the XEventBroadcaster interface of the desktop. While the model is only concerned about its own events, the desktop broadcasts the events for all the loaded documents.

Document Specific Features

Every service specification for real model objects provides more interfaces that constitute the actual model functionality For example, a text document service com.sun.star.text.TextDocument provides text related interfaces. Having received a reference to a model, developers query for these interfaces. The com.sun.star.lang.XServiceInfo interface of a model can be used to ask for supported services. The OpenOffice.org document types support the following services: