# IRfProjectFn Interface Reference

Inherits IRsObject.

List of all members.

## Public Member Functions
HRESULT | GetProjectSpace ([out, retval] IRnEncapsulator **ppProjectSpace)
HRESULT | ClearProject ()
HRESULT | ReplaceProject ([in] IRnEncapsulator *pNewProjectSpace,[in] RtBOOL bDontReplaceLayout)
HRESULT | SaveProject ([in] BSTR bstrFileName,[in] BSTR bstrAuthor,[in] BSTR bstrDescr,[in] IRdBitmap *pThumbnail,[in] RtBool fClearDirty)
HRESULT | LoadProject ([in] BSTR bstrFileName)
HRESULT | SaveProjectObject ([in] IRsFileHandle *pRsFileHandle,[in] IRnEncapsulator *pProjectEnc)
HRESULT | LoadProjectObject ([in] IRsFileHandle *pRsFileHandle,[out] IRnEncapsulator **ppProjectEnc,[out] RtBOOL *pOldLayout)

## Detailed Description

Function set for working with projects.

## Member Function Documentation

HRESULT IRfProjectFn::GetProjectSpace | ( | [out, retval] IRnEncapsulator ** | ppProjectSpace | ) |

GetProjectSpace

Returns:
  ppProjectSpace [out,retval] interface to project encapsulator .

HRESULT IRfProjectFn::ClearProject | ( |  | ) |

ClearProject

HRESULT IRfProjectFn::ReplaceProject | ( | [in] IRnEncapsulator * | pNewProjectSpace,
|  | [in] RtBOOL | bDontReplaceLayout |
| ) |  |  |

ReplaceProject

- replace the current project by new one

Parameters:

  | pNewProjectSpace | [in] new project.
  | bDontReplaceLayout | [in] do not replace UI layout .

HRESULT IRfProjectFn::SaveProject | ( | [in] BSTR | bstrFileName,
|  | [in] BSTR | bstrAuthor,
|  | [in] BSTR | bstrDescr,
|  | [in] IRdBitmap * | pThumbnail,
|  | [in] RtBool | fClearDirty |
| ) |  |  |

Save project.

Parameters:

  | bstrFileName | [in] Desired filename.
  | bstrAuthor | [in] Author of the file.
  | bstrDescr | [in] File description.
  | pThumbnail | [in] Thumbnail.
  | fClearDirty | [in] .

HRESULT IRfProjectFn::LoadProject | ( | [in] BSTR | bstrFileName | ) |

Load and apply project.

Parameters:

  | bstrFileName | [in] Desired filename.

Remarks:
  If the load or application fails, the original system will be automatically restored.

HRESULT IRfProjectFn::SaveProjectObject | ( | [in] IRsFileHandle * | pRsFileHandle,
|  | [in] IRnEncapsulator * | pProjectEnc |
| ) |  |  |

Save given object as project.

Parameters:

  | pRsFileHandle | [in] File handle through which the object will be saved.
  | pProjectEnc | [in] The project object.

Remarks:
  First the RsObj file chunk is detected.
  - If it is found, its content is replaced.

HRESULT IRfProjectFn::LoadProjectObject | ( | [in] IRsFileHandle * | pRsFileHandle,
|  | [out] IRnEncapsulator ** | ppProjectEnc,
|  | [out] RtBOOL * | pOldLayout |
| ) |  |  |

Load project object.

- If you want to apply the object, call ReplaceProject method.

Remarks:
  Sometimes may happen the project files are too big
  - In this case call the ClearProject method as first and only then load the new project.
  - Note: if the load or replace fail, you will loose the current project.

Parameters:

  | pRsFileHandle | [in] File handle from which the object will be loaded.
  | ppProjectEnc | [out] The project object.
  | pOldLayout | [out] Return TRUE if old layout is loaded. In this case consider layout apply.

Remarks:
  Read is the first RsObj file chunk.