OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
ocf::TOcDocument Class Reference

OC Document class, holds parts & is a owner of views. More...

#include <ocf/ocdoc.h>

Public Member Functions

 TOcDocument (TOcApp &app, LPCTSTR fileName=0)
 
 TOcDocument (TOcApp &app, LPCTSTR fileName, IStorage *storageI)
 
 ~TOcDocument ()
 
int AllocPartID ()
 
TOcAppGetOcApp ()
 
Collection management
TOcPartCollectionGetParts ()
 
TOcLinkCollectionGetLinks ()
 
TOcLinkCollectionGetViews ()
 
Storage & streaming related
TOcStorageGetStorage ()
 
void SetStorage (IStorage *storage, bool remember=true)
 Set the storage for this document.
 
void SetStorage (LPCTSTR path)
 Set the storage for this document.
 
bool SaveToFile (LPCTSTR newName)
 Perform saveas operation.
 
bool RestoreStorage ()
 Restore the original root IStorage before the save operation.
 
Load/Save part information
bool LoadParts ()
 Loads the parts from the current storage into the PartCollection.
 
bool SaveParts (IStorage *storage=0, bool sameAsLoaded=true, bool remember=true)
 Save the embedded parts to the provided storage.
 
void RenameParts (IBRootLinkable *bLDocumentI)
 
void Close ()
 
Get/Set active view
TOcViewGetActiveView ()
 
void SetActiveView (TOcView *view)
 
Get/Set document name
owl::tstring GetName () const
 
void SetName (const owl::tstring &newName)
 Notify container that doc pathname has changed.
 

Friends

class _ICLASS TOcControl
 
class _ICLASS TOcView
 
class _ICLASS TOcRemVie
 

Detailed Description

OC Document class, holds parts & is a owner of views.

Definition at line 43 of file ocdoc.h.

Constructor & Destructor Documentation

◆ TOcDocument() [1/2]

ocf::TOcDocument::TOcDocument ( TOcApp & app,
LPCTSTR fileName = 0 )

Definition at line 36 of file ocdoc.cpp.

References owl::ToBool(), ocf::TOcStorage, and TRACEX.

◆ TOcDocument() [2/2]

ocf::TOcDocument::TOcDocument ( TOcApp & app,
LPCTSTR fileName,
IStorage * storageI )

Definition at line 57 of file ocdoc.cpp.

References ocf::TOcStorage, and TRACEX.

◆ ~TOcDocument()

ocf::TOcDocument::~TOcDocument ( )

Definition at line 81 of file ocdoc.cpp.

Member Function Documentation

◆ AllocPartID()

int ocf::TOcDocument::AllocPartID ( )
inline

Definition at line 86 of file ocdoc.h.

◆ Close()

void ocf::TOcDocument::Close ( )

Definition at line 321 of file ocdoc.cpp.

◆ GetActiveView()

TOcView * ocf::TOcDocument::GetActiveView ( )
inline

Definition at line 76 of file ocdoc.h.

◆ GetLinks()

TOcLinkCollection & ocf::TOcDocument::GetLinks ( )
inline

Definition at line 52 of file ocdoc.h.

◆ GetName()

owl::tstring ocf::TOcDocument::GetName ( ) const
inline

Definition at line 82 of file ocdoc.h.

References ocf::Name.

◆ GetOcApp()

TOcApp & ocf::TOcDocument::GetOcApp ( )
inline

Definition at line 87 of file ocdoc.h.

◆ GetParts()

TOcPartCollection & ocf::TOcDocument::GetParts ( )
inline

Definition at line 51 of file ocdoc.h.

◆ GetStorage()

TOcStorage * ocf::TOcDocument::GetStorage ( )
inline

Definition at line 58 of file ocdoc.h.

◆ GetViews()

TOcLinkCollection & ocf::TOcDocument::GetViews ( )
inline

Definition at line 53 of file ocdoc.h.

◆ LoadParts()

bool ocf::TOcDocument::LoadParts ( )

Loads the parts from the current storage into the PartCollection.

Return false if a serious error occurs. Having no part stream at all is OK.

Clear the part collection

PartCollection.Clear(); ///DR clear before make a new one.

There is a case when clearing now causes a crash

Definition at line 230 of file ocdoc.cpp.

References ocf::TOcPartCollection::Clear(), ocf::HRSucceeded(), ocf::TOcStorage::Stat(), owl::to_tstring(), and ocf::TOcPart.

◆ RenameParts()

void ocf::TOcDocument::RenameParts ( IBRootLinkable * bLDocumentI)

Definition at line 301 of file ocdoc.cpp.

References ocf::HRSucceeded().

◆ RestoreStorage()

bool ocf::TOcDocument::RestoreStorage ( )

Restore the original root IStorage before the save operation.

Definition at line 125 of file ocdoc.cpp.

◆ SaveParts()

bool ocf::TOcDocument::SaveParts ( IStorage * storage = 0,
bool sameAsLoaded = true,
bool remember = true )

Save the embedded parts to the provided storage.

'remember' flag is not really used here, as our save/restore is done outside here.

Definition at line 155 of file ocdoc.cpp.

References CHECK, ocf::TOcPartCollection::Count(), ocf::HRSucceeded(), ocf::TOcStorage::Stat(), owl::ToBool(), and ocf::TOcStorage.

◆ SaveToFile()

bool ocf::TOcDocument::SaveToFile ( LPCTSTR newName)

Perform saveas operation.

Definition at line 141 of file ocdoc.cpp.

References PRECONDITION, and SaveParts().

◆ SetActiveView()

void ocf::TOcDocument::SetActiveView ( TOcView * view)

Definition at line 340 of file ocdoc.cpp.

◆ SetName()

void ocf::TOcDocument::SetName ( const owl::tstring & newName)

Notify container that doc pathname has changed.

Definition at line 349 of file ocdoc.cpp.

References ocf::TOcView::Rename().

◆ SetStorage() [1/2]

void ocf::TOcDocument::SetStorage ( IStorage * storage,
bool remember = true )

Set the storage for this document.

Definition at line 92 of file ocdoc.cpp.

References ocf::TOcStorage::GetIStorage(), and ocf::TOcStorage.

◆ SetStorage() [2/2]

void ocf::TOcDocument::SetStorage ( LPCTSTR path)

Set the storage for this document.

Definition at line 114 of file ocdoc.cpp.

References SetName(), and ocf::TOcStorage.

Friends And Related Symbol Documentation

◆ TOcControl

Definition at line 102 of file ocdoc.h.

◆ TOcRemVie

friend class _ICLASS TOcRemVie
friend

Definition at line 104 of file ocdoc.h.

◆ TOcView

Definition at line 103 of file ocdoc.h.


The documentation for this class was generated from the following files: