Carbide.c++

com.nokia.carbide.cpp.epoc.engine.model
Interface IOwnedModel<View>

All Superinterfaces:
IModel<View>
All Known Subinterfaces:
IBldInfOwnedModel, IImageMakefileOwnedModel, IMakefileOwnedModel, IMMPOwnedModel

public interface IOwnedModel<View>
extends IModel<View>

This manages a single file's contents and provides "views" onto its contents and resolves changes to such views to rewrite the contents.

This model may be modified by the owner.


Method Summary
 void dispose()
          Dispose the model.
 IDocument getDocument()
          Get the document representing the main file text.
 IDocument getDocument(IPath path)
          Look up a document by full/absolute path.
 java.util.Map<IPath,IDocument> getDocumentMap()
          Get the map of used documents.
 IModelLoadResults parse()
          Parse the model from its document to create the preprocessor DOM.
 void setDocument(IDocument document)
          Set the model's main document.
 void setDocument(IPath path, IDocument document)
          Look up a document by full/absolute path.
 void setModelProvider(IModelProvider<IOwnedModel<View>,IModel<View>> modelProvider)
          Set the model provider.
 
Methods inherited from interface com.nokia.carbide.cpp.epoc.engine.model.IModel
addListener, createView, getModelProvider, getPath, getViews, removeListener
 

Method Detail

getDocument

IDocument getDocument()
Get the document representing the main file text. A model is initially created with an empty document.

Returns:
main document

setDocument

void setDocument(IDocument document)
Set the model's main document. This is only allowed when no views are attached.


getDocument

IDocument getDocument(IPath path)
Look up a document by full/absolute path.

Parameters:
IPath - the absolute path to the file as used in the DOM or IModel#getPath()
Returns:
IDocument or null for unknown file

setDocument

void setDocument(IPath path,
                 IDocument document)
Look up a document by full/absolute path. This is only allowed to change existing documents when no views are attached.

Parameters:
IPath - the absolute path to the file as used in the DOM or IModel#getPath()
document - the document for the path

getDocumentMap

java.util.Map<IPath,IDocument> getDocumentMap()
Get the map of used documents.

Returns:
map of absolute path (IPath) to document (IDocument)

parse

IModelLoadResults parse()
Parse the model from its document to create the preprocessor DOM.

This is only valid when the document is set.

If any changes are detected and any views are open, they are all marked unsynchronized.

Returns:
load results (never null)

setModelProvider

void setModelProvider(IModelProvider<IOwnedModel<View>,IModel<View>> modelProvider)
Set the model provider. Called by a model provider only.

Parameters:
modelProvider - the provider that owns the model.

dispose

void dispose()
Dispose the model.

Throws IllegalStateException unless views are disposed.


Carbide.c++