HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_GalleryDataSourceImpl Class Referenceabstract

#include <UT_GalleryDataSource.h>

Public Member Functions

virtual ~UT_GalleryDataSourceImpl ()
 
virtual bool isValid () const =0
 
virtual bool isReadOnly () const =0
 
virtual UT_StringHolder infoHtml () const =0
 Return HTML formatted info about the data source. More...
 
virtual void itemIds (UT_StringArray &item_ids) const =0
 Populate an array with all valid item ids. More...
 
virtual void updatedItemIds (UT_StringArray &item_ids)=0
 
virtual void childItemIds (const UT_StringRef &parent_item_id, UT_StringArray &item_ids) const
 Populate an array with all valid item ids with the given parent 'item_id'. By default there is no hierarchy. More...
 
virtual UT_StringHolder sourceTypeName (const UT_StringRef &item_id) const =0
 A string identifying the implementation data type. More...
 
virtual UT_StringHolder typeName (const UT_StringRef &item_id) const =0
 
virtual UT_StringHolder label (const UT_StringRef &item_id) const =0
 
virtual UT_WorkBuffer thumbnail (const UT_StringRef &item_id) const =0
 
virtual time_t creationDate (const UT_StringRef &item_id) const =0
 
virtual time_t modificationDate (const UT_StringRef &item_id) const =0
 
virtual bool isStarred (const UT_StringRef &item_id) const =0
 
virtual UT_StringHolder colorTag (const UT_StringRef &item_id) const =0
 
virtual UT_StringSet tags (const UT_StringRef &item_id) const =0
 
virtual UT_Options metadata (const UT_StringRef &item_id) const =0
 
virtual UT_StringHolder filePath (const UT_StringRef &item_id) const =0
 
virtual bool ownsFile (const UT_StringRef &item_id) const =0
 
virtual UT_WorkBuffer blindData (const UT_StringRef &item_id) const =0
 
virtual UT_StringHolder status (const UT_StringRef &item_id) const =0
 
virtual UT_StringHolder parentId (const UT_StringRef &item_id) const =0
 Return the parent item id of the given 'item_id'. More...
 
virtual UT_StringHolder prepareItemForUse (const UT_StringRef &item_id) const =0
 
virtual bool setLabel (const UT_StringRef &item_id, const UT_StringHolder &label)
 
virtual bool setThumbnail (const UT_StringRef &item_id, const UT_WorkBuffer &thumbnail)
 
virtual bool setModificationDate (const UT_StringRef &item_id, time_t timestamp)
 
virtual bool setIsStarred (const UT_StringRef &item_id, bool isstarred)
 
virtual bool setColorTag (const UT_StringRef &item_id, const UT_StringHolder &color_tag)
 
virtual bool setMetadata (const UT_StringRef &item_id, const UT_Options &metadata)
 
virtual bool setFilePath (const UT_StringRef &item_id, const char *file_path)
 
virtual bool setOwnsFile (const UT_StringRef &item_id, bool owns_file)
 
virtual bool setBlindData (const UT_StringRef &item_id, const void *data, int data_size)
 
virtual bool setStatus (const UT_StringRef &item_id, const UT_StringHolder &status)
 
virtual bool setParentId (const UT_StringRef &item_id, const UT_StringHolder &parent_item_id)
 
virtual bool createTag (const char *tag)
 
virtual bool deleteTag (const char *tag, bool delete_if_assigned) const
 
virtual bool addTag (const UT_StringRef &item_id, const char *tag)
 
virtual bool removeTag (const UT_StringRef &item_id, const char *tag) const
 
virtual UT_StringHolder generateItemFilePath (const UT_StringRef &item_id, const char *file_ext)
 
virtual UT_StringHolder addItem (const UT_StringRef &item_type_name, const UT_StringRef &name, const void *thumbnail_data, int thumbnail_data_size, const char *item_file, bool item_owns_file, const void *item_data, int item_data_size, time_t *creation_date, const UT_StringRef &parent_id)
 Add a new gallery item to the data source. More...
 
virtual bool markItemsForDeletion (const UT_StringArray &item_ids)
 
virtual bool unmarkItemsForDeletion (const UT_StringArray &item_ids)
 
virtual void startTransaction () const
 
virtual void endTransaction (bool commit=true) const
 
virtual bool saveAs (const UT_StringHolder &source_identifier)
 

Protected Member Functions

 UT_GalleryDataSourceImpl ()
 
void addOwner (const UT_GalleryDataSource *owner)
 
void removeOwner (const UT_GalleryDataSource *owner)
 
void ownerFetchedUpdatedIds (const UT_GalleryDataSource *owner, UT_StringArray &item_ids)
 

Protected Attributes

UT_Map< const
UT_GalleryDataSource
*, UT_StringSet
myOwnerUpdatedIds
 

Friends

class UT_GalleryDataSource
 

Detailed Description

Implementation class for UT_GalleryDataSource. Subclass this and register it with UT_GalleryDataSource as a plugin to create a new data source. See documentation for hou.AssetGalleryDataSource for descriptions of the methods that need to be implemented to create a new DataSource subclass.

Definition at line 43 of file UT_GalleryDataSource.h.

Constructor & Destructor Documentation

virtual UT_GalleryDataSourceImpl::~UT_GalleryDataSourceImpl ( )
virtual
UT_GalleryDataSourceImpl::UT_GalleryDataSourceImpl ( )
protected

Member Function Documentation

virtual UT_StringHolder UT_GalleryDataSourceImpl::addItem ( const UT_StringRef item_type_name,
const UT_StringRef name,
const void thumbnail_data,
int  thumbnail_data_size,
const char *  item_file,
bool  item_owns_file,
const void item_data,
int  item_data_size,
time_t *  creation_date,
const UT_StringRef parent_id 
)
inlinevirtual

Add a new gallery item to the data source.

Definition at line 146 of file UT_GalleryDataSource.h.

void UT_GalleryDataSourceImpl::addOwner ( const UT_GalleryDataSource owner)
inlineprotected

Definition at line 187 of file UT_GalleryDataSource.h.

virtual bool UT_GalleryDataSourceImpl::addTag ( const UT_StringRef item_id,
const char *  tag 
)
inlinevirtual

Definition at line 132 of file UT_GalleryDataSource.h.

virtual UT_WorkBuffer UT_GalleryDataSourceImpl::blindData ( const UT_StringRef item_id) const
pure virtual
virtual void UT_GalleryDataSourceImpl::childItemIds ( const UT_StringRef parent_item_id,
UT_StringArray item_ids 
) const
virtual

Populate an array with all valid item ids with the given parent 'item_id'. By default there is no hierarchy.

virtual UT_StringHolder UT_GalleryDataSourceImpl::colorTag ( const UT_StringRef item_id) const
pure virtual
virtual bool UT_GalleryDataSourceImpl::createTag ( const char *  tag)
inlinevirtual

Definition at line 128 of file UT_GalleryDataSource.h.

virtual time_t UT_GalleryDataSourceImpl::creationDate ( const UT_StringRef item_id) const
pure virtual
virtual bool UT_GalleryDataSourceImpl::deleteTag ( const char *  tag,
bool  delete_if_assigned 
) const
inlinevirtual

Definition at line 130 of file UT_GalleryDataSource.h.

virtual void UT_GalleryDataSourceImpl::endTransaction ( bool  commit = true) const
inlinevirtual

Definition at line 175 of file UT_GalleryDataSource.h.

virtual UT_StringHolder UT_GalleryDataSourceImpl::filePath ( const UT_StringRef item_id) const
pure virtual
virtual UT_StringHolder UT_GalleryDataSourceImpl::generateItemFilePath ( const UT_StringRef item_id,
const char *  file_ext 
)
inlinevirtual

Generates a file path to associate with a particular item id, for cases where the new item needs a new file, as in a snapshot data source (rather than referring to an existing file, as in an asset data source).

Definition at line 140 of file UT_GalleryDataSource.h.

virtual UT_StringHolder UT_GalleryDataSourceImpl::infoHtml ( ) const
pure virtual

Return HTML formatted info about the data source.

virtual bool UT_GalleryDataSourceImpl::isReadOnly ( ) const
pure virtual

If this method returns true, none of the set methods should ever be called, or expected to do anything.

virtual bool UT_GalleryDataSourceImpl::isStarred ( const UT_StringRef item_id) const
pure virtual
virtual bool UT_GalleryDataSourceImpl::isValid ( ) const
pure virtual

Required overridesCheck if the data source is valid. If not, no other methods will ever be called on this object.

virtual void UT_GalleryDataSourceImpl::itemIds ( UT_StringArray item_ids) const
pure virtual

Populate an array with all valid item ids.

virtual UT_StringHolder UT_GalleryDataSourceImpl::label ( const UT_StringRef item_id) const
pure virtual
virtual bool UT_GalleryDataSourceImpl::markItemsForDeletion ( const UT_StringArray item_ids)
inlinevirtual

Mark items for deletion in the data source. Do nothing for invalid item ids or items that are already marked for deletion.

Definition at line 161 of file UT_GalleryDataSource.h.

virtual UT_Options UT_GalleryDataSourceImpl::metadata ( const UT_StringRef item_id) const
pure virtual
virtual time_t UT_GalleryDataSourceImpl::modificationDate ( const UT_StringRef item_id) const
pure virtual
void UT_GalleryDataSourceImpl::ownerFetchedUpdatedIds ( const UT_GalleryDataSource owner,
UT_StringArray item_ids 
)
protected
virtual bool UT_GalleryDataSourceImpl::ownsFile ( const UT_StringRef item_id) const
pure virtual
virtual UT_StringHolder UT_GalleryDataSourceImpl::parentId ( const UT_StringRef item_id) const
pure virtual

Return the parent item id of the given 'item_id'.

virtual UT_StringHolder UT_GalleryDataSourceImpl::prepareItemForUse ( const UT_StringRef item_id) const
pure virtual
void UT_GalleryDataSourceImpl::removeOwner ( const UT_GalleryDataSource owner)
inlineprotected

Definition at line 189 of file UT_GalleryDataSource.h.

virtual bool UT_GalleryDataSourceImpl::removeTag ( const UT_StringRef item_id,
const char *  tag 
) const
inlinevirtual

Definition at line 134 of file UT_GalleryDataSource.h.

virtual bool UT_GalleryDataSourceImpl::saveAs ( const UT_StringHolder source_identifier)
inlinevirtual

For file-based sources, does the equivalent of a "save as" operation. The source identifier of the data source should be updated if the implementation's save as operation reports success.

Definition at line 181 of file UT_GalleryDataSource.h.

virtual bool UT_GalleryDataSourceImpl::setBlindData ( const UT_StringRef item_id,
const void data,
int  data_size 
)
inlinevirtual

Definition at line 118 of file UT_GalleryDataSource.h.

virtual bool UT_GalleryDataSourceImpl::setColorTag ( const UT_StringRef item_id,
const UT_StringHolder color_tag 
)
inlinevirtual

Definition at line 106 of file UT_GalleryDataSource.h.

virtual bool UT_GalleryDataSourceImpl::setFilePath ( const UT_StringRef item_id,
const char *  file_path 
)
inlinevirtual

Definition at line 112 of file UT_GalleryDataSource.h.

virtual bool UT_GalleryDataSourceImpl::setIsStarred ( const UT_StringRef item_id,
bool  isstarred 
)
inlinevirtual

Definition at line 103 of file UT_GalleryDataSource.h.

virtual bool UT_GalleryDataSourceImpl::setLabel ( const UT_StringRef item_id,
const UT_StringHolder label 
)
inlinevirtual

Required overrides for writable data sources

Definition at line 94 of file UT_GalleryDataSource.h.

virtual bool UT_GalleryDataSourceImpl::setMetadata ( const UT_StringRef item_id,
const UT_Options metadata 
)
inlinevirtual

Definition at line 109 of file UT_GalleryDataSource.h.

virtual bool UT_GalleryDataSourceImpl::setModificationDate ( const UT_StringRef item_id,
time_t  timestamp 
)
inlinevirtual

Definition at line 100 of file UT_GalleryDataSource.h.

virtual bool UT_GalleryDataSourceImpl::setOwnsFile ( const UT_StringRef item_id,
bool  owns_file 
)
inlinevirtual

Definition at line 115 of file UT_GalleryDataSource.h.

virtual bool UT_GalleryDataSourceImpl::setParentId ( const UT_StringRef item_id,
const UT_StringHolder parent_item_id 
)
inlinevirtual

Definition at line 124 of file UT_GalleryDataSource.h.

virtual bool UT_GalleryDataSourceImpl::setStatus ( const UT_StringRef item_id,
const UT_StringHolder status 
)
inlinevirtual

Definition at line 121 of file UT_GalleryDataSource.h.

virtual bool UT_GalleryDataSourceImpl::setThumbnail ( const UT_StringRef item_id,
const UT_WorkBuffer thumbnail 
)
inlinevirtual

Definition at line 97 of file UT_GalleryDataSource.h.

virtual UT_StringHolder UT_GalleryDataSourceImpl::sourceTypeName ( const UT_StringRef item_id) const
pure virtual

A string identifying the implementation data type.

virtual void UT_GalleryDataSourceImpl::startTransaction ( ) const
inlinevirtual

Optional overrides

Definition at line 173 of file UT_GalleryDataSource.h.

virtual UT_StringHolder UT_GalleryDataSourceImpl::status ( const UT_StringRef item_id) const
pure virtual
virtual UT_StringSet UT_GalleryDataSourceImpl::tags ( const UT_StringRef item_id) const
pure virtual
virtual UT_WorkBuffer UT_GalleryDataSourceImpl::thumbnail ( const UT_StringRef item_id) const
pure virtual
virtual UT_StringHolder UT_GalleryDataSourceImpl::typeName ( const UT_StringRef item_id) const
pure virtual
virtual bool UT_GalleryDataSourceImpl::unmarkItemsForDeletion ( const UT_StringArray item_ids)
inlinevirtual

Unmark items for deletion in the data source. Do nothing for invalid item ids or items that are not marked for deletion.

Definition at line 166 of file UT_GalleryDataSource.h.

virtual void UT_GalleryDataSourceImpl::updatedItemIds ( UT_StringArray item_ids)
pure virtual

Friends And Related Function Documentation

friend class UT_GalleryDataSource
friend

Definition at line 196 of file UT_GalleryDataSource.h.

Member Data Documentation

UT_Map<const UT_GalleryDataSource *, UT_StringSet> UT_GalleryDataSourceImpl::myOwnerUpdatedIds
protected

Definition at line 194 of file UT_GalleryDataSource.h.


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