rwlogo
Rogue Wave Views 5.5.1

Rogue Wave Views
Application Framework Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvDvProjectDocument Class Reference

Application Framework document project class. More...

#include <ilviews/appframe/project/prjdoc.h>

Inheritance diagram for IlvDvProjectDocument:
IlvDvDocument IlvDvSerializable IlvDvInterface

List of all members.

Public Member Functions

virtual IlBoolean activateItem (IlvDvProjectItem *item)
 Activates the project item item.
IlBoolean activateItems (IlvDvProjectItem *const *items, IlUInt count)
 Activates the project items items by calling the activateItem method for each item. This method can be called by a project view if the multiple selection of tree gadget items has been activated.
virtual void clean ()
 Cleans the document data by deleting the project root item and all file information owned by the project document.
IlvDvFileInfogetFileInfo (IlUInt index) const
 Returns the file information object located at index index.
IlUInt getFileInfosCount () const
 Returns the number of files that are owned by the project document.
IlUInt getIndexOfFileInfo (const IlvDvFileInfo *fInfo) const
 Returns the index of the file information object fInfo from the list of file information stored by the document.
IlvDvDocumentProjectItemgetProjectRootItem () const
 Returns the project root item of the document.
virtual IlBoolean initializeDocument (IlAny data=0)
 Initializes a new project document.
IlBoolean insertFile (IlvDvProjectItem *parent, const IlPathName &filename)
 Inserts a file in the project.
IlBoolean insertFolder (IlvDvProjectItem *parent, const char *name, const char *extensions=0)
 Inserts a project folder item with the name name as a child of the project item parent.
.
IlBoolean insertItem (IlvDvProjectItem *item, IlvDvProjectItem *parent=0, IlUShort index=(IlUShort)-1)
 Inserts a project item as a child of the project item parent.
.
void removeTreeItems (IlvDvProjectItem *const *items, IlUInt count)
 Removes a list of project items.
virtual void serialize (IlvDvStream &stream)
 Serializes the document.
virtual void setTitle (const char *title, IlBoolean update=IlTrue)
 Sets the title title for the document.
.

Protected Member Functions

virtual IlvDvDocumentProjectItemcreateDocumentProjectItem ()
 Creates a document project item.
virtual IlvDvProjectItemcreateProjectFileItem (IlvDvFileInfo *fileInfo)
 Creates a project file item that corresponds to the parameter fileInfo. By default, it creates an IlvDvFileItem object.
virtual IlvDvProjectItemcreateProjectFolderItem (const char *name, const char *extensions=0)
 Creates a project folder item using the parameters name and extensions. By default, it creates an IlvDvFolderItem object.
virtual void removeTreeItemData (IlvDvProjectItem *item)
 It removes the data associated with the project item item.

Friends

class IlvDvFileInfo

Detailed Description

Application Framework document project class.

Library: ilvappframe

IlvDvProjectDocument is a subclass of IlvDvDocument The document data is a hierarchical tree of items whose class must inherit from IlvDvProjectItem class.

Project items
By default, two types of items are provided. Some items store a group of other items (IlvDvFolderItem class) represented in the project view as a folder. The other items reference a file (IlvDvFileItem class) represented in the project view as a file tree item that opens the corresponding document when it is activated.

IlvDvFileInfo objects
References to a file are objects of the class IlvDvFileInfo that contain information on the file, such as its full path. IlvDvFileInfo objects are stored by the IlvDvProjectDocument document and must be locked and unlocked when they are used or stored outside the project document, the same way project file items do. Two project file items that reference the same file point to the same IlvDvFileInfo object.


Member Function Documentation

virtual IlBoolean IlvDvProjectDocument::activateItem ( IlvDvProjectItem item  )  [virtual]

Activates the project item item.

By default, if the item is a file item, a document corresponding to the file path is created, or activated if it was already open.
This method can be overridden to activate its own project item types.

Returns:
IlFalse if a project item could not be activated.
IlBoolean IlvDvProjectDocument::activateItems ( IlvDvProjectItem *const *  items,
IlUInt  count 
)

Activates the project items items by calling the activateItem method for each item. This method can be called by a project view if the multiple selection of tree gadget items has been activated.

Returns:
IlFalse if a project item could not be activated.
virtual IlvDvDocumentProjectItem* IlvDvProjectDocument::createDocumentProjectItem (  )  [protected, virtual]

Creates a document project item.

Creates a project item of a subclass of IlvDvDocumentProjectItem. This project item will be the root of the project items.
By default, it creates an IlvDvDocumentProjectItem object.

Returns:
The new document project item.
virtual IlvDvProjectItem* IlvDvProjectDocument::createProjectFileItem ( IlvDvFileInfo fileInfo  )  [protected, virtual]

Creates a project file item that corresponds to the parameter fileInfo. By default, it creates an IlvDvFileItem object.

Returns:
The new project file item.
virtual IlvDvProjectItem* IlvDvProjectDocument::createProjectFolderItem ( const char *  name,
const char *  extensions = 0 
) [protected, virtual]

Creates a project folder item using the parameters name and extensions. By default, it creates an IlvDvFolderItem object.

Returns:
The new project folder item.
IlvDvFileInfo* IlvDvProjectDocument::getFileInfo ( IlUInt  index  )  const

Returns the file information object located at index index.

These files are referenced by an IlvDvFileInfo object that is used by at least one project file item.

Returns:
The file information located object at index index.
IlUInt IlvDvProjectDocument::getFileInfosCount (  )  const

Returns the number of files that are owned by the project document.

These files are referenced by an IlvDvFileInfo object that is used by at least one project file item.

Returns:
The number of files that are owned by the project document.
IlUInt IlvDvProjectDocument::getIndexOfFileInfo ( const IlvDvFileInfo fInfo  )  const

Returns the index of the file information object fInfo from the list of file information stored by the document.

Returns:
The index of the file information object.
IlvDvDocumentProjectItem* IlvDvProjectDocument::getProjectRootItem (  )  const

Returns the project root item of the document.

Returns:
The project root item of the document.
virtual IlBoolean IlvDvProjectDocument::initializeDocument ( IlAny  data = 0  )  [virtual]

Initializes a new project document.

This method creates a root project item by calling the method createDocumentProjectItem. The item represents the project document itself.

Returns:
IlTrue if initialization of document succeeded.

Reimplemented from IlvDvDocument.

IlBoolean IlvDvProjectDocument::insertFile ( IlvDvProjectItem parent,
const IlPathName filename 
)

Inserts a file in the project.

Inserts a project file item as a child of the project item parent. The project file item is built by calling the method createProjectFileItem, which can be redefined.
Associated document views are notified when they receive the message "AddProjectItem" with the new project item as the parameter.
By default, the project views add a tree gadget item corresponding to the new project item.

Parameters:
parent Project item that will be the parent of the new project file item.
filename Full path of the added file item.
Returns:
IlTrue if the project file item is created and inserted.
IlBoolean IlvDvProjectDocument::insertFolder ( IlvDvProjectItem parent,
const char *  name,
const char *  extensions = 0 
)

Inserts a project folder item with the name name as a child of the project item parent.
.

The project folder item is built by calling method createProjectFolderItem, which can be redefined.
Associated document views are notified when they receive the message "AddProjectItem" with the new project item as the parameter.
By default, the project views add a tree gadget item corresponding to the added project item.

Parameters:
parent Project item that will be the parent of the project folder item.
name Name of the folder.
extensions Specifies the file extensions that filter which file items can be added to the folder items. This parameter is null by default. If it is null, all file items can be added to the folder items.
Returns:
IlTrue if the project folder item is inserted.
IlBoolean IlvDvProjectDocument::insertItem ( IlvDvProjectItem item,
IlvDvProjectItem parent = 0,
IlUShort  index = (IlUShort)-1 
)

Inserts a project item as a child of the project item parent.
.

Associated document views are notified when they receive the message "AddProjectItem" with the project item item given as the parameter.
By default, the project views add a tree gadget item corresponding to the added project item.

Parameters:
item Project item that must be added to the document.
parent Project item that will be the parent of the project file item item.
index The position where the project item item will be inserted among the children of the project item parent.
Returns:
IlTrue if the project file item is inserted.
virtual void IlvDvProjectDocument::removeTreeItemData ( IlvDvProjectItem item  )  [protected, virtual]

It removes the data associated with the project item item.

Called before a project item is deleted.

void IlvDvProjectDocument::removeTreeItems ( IlvDvProjectItem *const *  items,
IlUInt  count 
)

Removes a list of project items.

The items items are destroyed. For each project item destroyed, associated document views are notified. They receive messages of the name "RemoveProjectItem" with the corresponding deleted project item as the parameter. By default, the project views (IlvDvProjectView class) remove the corresponding tree item from the tree.

Parameters:
items Array of project items to be deleted.
count Number of project items to be deleted.
virtual void IlvDvProjectDocument::serialize ( IlvDvStream stream  )  [virtual]

Serializes the document.

All project items are serialized, as well as the file information data used by the project file items.

Parameters:
stream Stream used to serialize the document.

Reimplemented from IlvDvDocument.

virtual void IlvDvProjectDocument::setTitle ( const char *  title,
IlBoolean  update = IlTrue 
) [virtual]

Sets the title title for the document.
.

If the label of the project root item has not been explicitly changed, the label is set to the title.

Parameters:
title New title of the document.
update If update is IlTrue, all associated view containers have their title updated to the document title.

Reimplemented from IlvDvDocument.


© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.