CFx SDK Documentation  2022 SP0
Public Types | Public Member Functions | List of all members
CFxDesignDataSource Class Referenceabstract

#include <FxDesignDataSource.h>

Public Types

enum  Result { eOk = 0 , eFail , eNotImplemented }
 

Public Member Functions

 CFxDesignDataSource ()
 
virtual ~CFxDesignDataSource (void)
 
void SetModel (CFxDesignResourceModel *pBaseModel)
 
CFxDesignResourceModelGetModel () const
 
virtual void AddChildren (CFxDesignDataItem *pParentItem)=0
 
virtual bool ValidateURL (CFxString &sURL, bool bCorrection=false) const =0
 
virtual CFxDatabasePtr LoadDatabase (const CFxString &strURL, bool &bCacheIt)=0
 
virtual CFxDesignDataItemFind (CFxString &strURL)=0
 
virtual bool BrowseResourceLocation (CFxString &strURL)=0
 
virtual CFxString GetHomeLocation () const =0
 
virtual void SetHomeLocation (const CFxDesignDataItem *pItem)=0
 
virtual void AddToFavorites (const CFxDesignDataItem *pItem)=0
 
virtual void RemoveFromFavorites (const CFxDesignDataItem *pItem)=0
 
virtual void OpenDrawing (const CFxString &strDrawing)=0
 
virtual bool IsLocalURL (const CFxString &strURL)=0
 
virtual bool DownloadFile (const CFxString &strURL, CFxString &strLocalPath)=0
 
virtual int DrawingSubItemVisibilty () const =0
 
virtual bool PerformOperation (CFxDesignResourceModel::Operation, CFxDesignDataItem *pItem)=0
 
virtual void GetHeaderColumnInfo (int iIndex, CFxString &strColumnName, CFxDesignResourceModel::DataType &datatype) const =0
 
virtual int GetHeaderColumnCount () const =0
 
virtual void ColumnVisibilty (CFxDesignResourceModel::ItemType, OdIntArray &columnArray) const =0
 
virtual bool IsRefreshRequired (CFxDesignDataItem *pItem)=0
 
virtual bool IsFavoritesSupported (CFxString &sFavoriteName)=0
 
virtual Result Copy (const CFxDesignDataItem *pItem, OdBinaryData &data)
 
virtual Result Paste (const OdBinaryData &data)
 

Detailed Description

Description: This interface has to be implemented by the user to create their own Design Resource. /sa CFxDsignResources::AddSource

Definition at line 34 of file FxDesignDataSource.h.

Member Enumeration Documentation

◆ Result

Description: Return type results.

Enumerator
eOk 
eFail 
eNotImplemented 

Definition at line 40 of file FxDesignDataSource.h.

Constructor & Destructor Documentation

◆ CFxDesignDataSource()

CFxDesignDataSource::CFxDesignDataSource ( )

◆ ~CFxDesignDataSource()

virtual CFxDesignDataSource::~CFxDesignDataSource ( void  )
virtual

Member Function Documentation

◆ AddChildren()

virtual void CFxDesignDataSource::AddChildren ( CFxDesignDataItem pParentItem)
pure virtual

Description: Implementation will add all sub-items or child items of given parent item. Arguments:

Parameters
CFxDesignDataItem*parent item if NULL then it add Root items. Return Value:

◆ AddToFavorites()

virtual void CFxDesignDataSource::AddToFavorites ( const CFxDesignDataItem pItem)
pure virtual

Description: Notification for Add/Remove favorites item. Arguments:

Parameters
CFxDesignDataItem*Item that will add/remove to favorites. Return Value:

◆ BrowseResourceLocation()

virtual bool CFxDesignDataSource::BrowseResourceLocation ( CFxString strURL)
pure virtual

Description: Implementation has to provide UI to select URL within the Data Source Hierarchy. Arguments:

Parameters
CFxStringSelected URL. Return Value: true if it succeeds, false if it fails.

◆ ColumnVisibilty()

virtual void CFxDesignDataSource::ColumnVisibilty ( CFxDesignResourceModel::ItemType  ,
OdIntArray columnArray 
) const
pure virtual

Description: Implementation returns array of detail view columns to make it visible in detail view, according to specified item type. Arguments:

Parameters
CFxDesignResourceModel::ItemTypeItem type.
OdIntArrayReturns array of columns.

◆ Copy()

virtual Result CFxDesignDataSource::Copy ( const CFxDesignDataItem pItem,
OdBinaryData data 
)
virtual

Description: Implementation of these functions required only if client want to customize Copy/Paste and Drag/Drop operation. Framework will invoke Copy function on start of drag or copy operation. Implementation of Copy function will copy Binary chunk into data using information from pItem. Framework will invoke Paste function whenever pItem is pasted or dropped into Drawing Graphic Area with copied information. Implementation of Paste will perform paste operation on copied information. Arguments:

Parameters
CFxDesignDataItem* Specified item node.
OdBinaryDataData used in copy/paste operation.

Return Value: Return eOK if handled properly.Default implementation returns eNotImplemented.

◆ DownloadFile()

virtual bool CFxDesignDataSource::DownloadFile ( const CFxString strURL,
CFxString strLocalPath 
)
pure virtual

Description: Implementation will download resource file from specified URL path to local disk. Arguments:

Parameters
CFxStringURL path to download.
CFxStringLocal disk path at where URL file downloaded. Return Value: true if it succeeds, false if it fails.

◆ DrawingSubItemVisibilty()

virtual int CFxDesignDataSource::DrawingSubItemVisibilty ( ) const
pure virtual

Description: Implementation returns drawing sub item visibility.So sub-items under CFxDesignResourceModel::eDrawingItem node will be added automatically. It will be combination of CFxDesignResourceModel::DrawignSubItemVisibilty

◆ Find()

virtual CFxDesignDataItem* CFxDesignDataSource::Find ( CFxString strURL)
pure virtual

Description: Implementation will perform search of given URL and returns item in Data Source structure Hierarchy. Arguments:

Parameters
CFxStringReturn URL Location string Return Value: null if location not found, else the found item.

◆ GetHeaderColumnCount()

virtual int CFxDesignDataSource::GetHeaderColumnCount ( ) const
pure virtual

Description: Returns Column count of detail view.

◆ GetHeaderColumnInfo()

virtual void CFxDesignDataSource::GetHeaderColumnInfo ( int  iIndex,
CFxString strColumnName,
CFxDesignResourceModel::DataType datatype 
) const
pure virtual

Description: Implementation provides column name and its DataType for specified column. Arguments:

Parameters
intColumn number for which information required.
CFxStringReturns Column Display name.
CFxDesignResourceModel::DataTypeReturns column contents data type. Return Value:

◆ GetHomeLocation()

virtual CFxString CFxDesignDataSource::GetHomeLocation ( ) const
pure virtual

Description: Implementation will returns home location URL.

◆ GetModel()

CFxDesignResourceModel* CFxDesignDataSource::GetModel ( ) const

◆ IsFavoritesSupported()

virtual bool CFxDesignDataSource::IsFavoritesSupported ( CFxString sFavoriteName)
pure virtual

Description: If return true then One Favorites node will be added below all root nodes to support favorites, else all favorites support will be disabled. If favorites supported then only following sub item types can be added in Favorites Root Node by CFxDesignResourceModel::AppendChild.

  1. CFxDesignResourceModel::eRootItem
  2. CFxDesignResourceModel::eLinkItem Arguments:
    Parameters
    CFxStringIf Favorites support required then implementer must give Favorite Name so that Favorites node can be created by sFavoriteName name.

◆ IsLocalURL()

virtual bool CFxDesignDataSource::IsLocalURL ( const CFxString strURL)
pure virtual

Description: Returns true if specified URL represents file on local disk or local network. Arguments:

Parameters
CFxStringURL path.

◆ IsRefreshRequired()

virtual bool CFxDesignDataSource::IsRefreshRequired ( CFxDesignDataItem pItem)
pure virtual

Description: Implementation returns true if sub items of the specified node item required refilling. If It will return true then system will remove all existing sub items and will call AddChildren. Arguments:

Parameters
CFxDesignDataItem* Specified item node.

◆ LoadDatabase()

virtual CFxDatabasePtr CFxDesignDataSource::LoadDatabase ( const CFxString strURL,
bool &  bCacheIt 
)
pure virtual

Description: Implementation will Load URL drawing/database path. Arguments:

Parameters
CFxStringURL string for drawing file or database path.
boolIf set true then loaded database will be cached for further use. Use CFxDesignResourceModel::RemoveDatabaseFromCache to remove this database from cache when needed.

Return Value: Database if loaded successfully.

See also
CFxDesignResourceModel::RemoveDatabaseFromCache

◆ OpenDrawing()

virtual void CFxDesignDataSource::OpenDrawing ( const CFxString strDrawing)
pure virtual

Description: Open Drawing URL path. Arguments:

Parameters
CFxStringDrawing URL path. Return Value:

◆ Paste()

virtual Result CFxDesignDataSource::Paste ( const OdBinaryData data)
virtual

◆ PerformOperation()

virtual bool CFxDesignDataSource::PerformOperation ( CFxDesignResourceModel::Operation  ,
CFxDesignDataItem pItem 
)
pure virtual

Description: Implementation will perform custom handling of operation of context menu if required. Arguments:

Parameters
CFxDesignResourceModel::OperationOperation type.
CFxDesignDataItem*Item at which operation will be performed. Return Value: return true to override default behavior of specified operation else false.

◆ RemoveFromFavorites()

virtual void CFxDesignDataSource::RemoveFromFavorites ( const CFxDesignDataItem pItem)
pure virtual

◆ SetHomeLocation()

virtual void CFxDesignDataSource::SetHomeLocation ( const CFxDesignDataItem pItem)
pure virtual

Description: Notify that specified item is Set as Home Location. Arguments:

Parameters
CFxDesignDataItem*Item that will set as home location. Return Value:

◆ SetModel()

void CFxDesignDataSource::SetModel ( CFxDesignResourceModel pBaseModel)

Description: Set/Get model pointer. Arguments:

Parameters
CFxDesignResourceModel*Design Resource model pointer.

◆ ValidateURL()

virtual bool CFxDesignDataSource::ValidateURL ( CFxString sURL,
bool  bCorrection = false 
) const
pure virtual

Description: Implementation checks validity of specified URL. Arguments:

Parameters
CFxStringURL string to check.
bCorrectiontrue to correct input URL if it is not valid Return Value: true if URL is valid else false.

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