|
HDK
|
#include <UT_GalleryDataSource.h>
Public Types | |
| typedef UT_Function< bool(const UT_StringHolder &)> | ValidatorFunc |
| typedef UT_Function < UT_SharedPtr < UT_GalleryDataSourceImpl > const UT_StringHolder &, const UT_StringHolder &)> | CreatorFunc |
Public Member Functions | |
| UT_GalleryDataSource (const UT_StringHolder &source_identifier, const UT_StringHolder &args) | |
| ~UT_GalleryDataSource () | |
| bool | isValid () const |
| bool | isReadOnly () const |
| Return true if the source implementation is read only. More... | |
| bool | supportsAnnotations () const |
| bool | isItemReadOnly (const UT_StringRef &item_id) const |
| const UT_StringHolder & | sourceIdentifier () const |
| Return the source identifier. More... | |
| const UT_StringHolder & | sourceArgs () const |
| Return the source args. More... | |
| UT_StringHolder | infoHtml () const |
| Return HTML formatted info about the data source. More... | |
| void | startTransaction () const |
| void | endTransaction (bool commit=true) const |
| void | itemIds (UT_StringArray &item_ids) const |
| Populate an array with all valid item ids. More... | |
| void | updatedItemIds (UT_StringArray &item_ids) |
| 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'. More... | |
| UT_StringHolder | sourceTypeName (const UT_StringRef &item_id) const |
| Return the source type. More... | |
| UT_StringHolder | typeName (const UT_StringRef &item_id) const |
| UT_StringHolder | renderMethod (const UT_StringRef &item_id) const |
| UT_StringHolder | label (const UT_StringRef &item_id) const |
| UT_WorkBuffer | thumbnail (const UT_StringRef &item_id) const |
| UT_StringHolder | treeIcon (const UT_StringRef &item_id) const |
| time_t | creationDate (const UT_StringRef &item_id) const |
| time_t | modificationDate (const UT_StringRef &item_id) const |
| bool | isStarred (const UT_StringRef &item_id) const |
| UT_StringHolder | colorTag (const UT_StringRef &item_id) const |
| UT_StringSet | tags (const UT_StringRef &item_id) const |
| UT_Options | metadata (const UT_StringRef &item_id) const |
| UT_StringHolder | filePath (const UT_StringRef &item_id) const |
| bool | ownsFile (const UT_StringRef &item_id) const |
| UT_WorkBuffer | blindData (const UT_StringRef &item_id) const |
| UT_StringHolder | status (const UT_StringRef &item_id) const |
| UT_StringHolder | parentId (const UT_StringRef &item_id) const |
| UT_StringHolder | prepareItemForUse (const UT_StringRef &item_id) const |
| bool | isFilePathEditable (const UT_StringRef &item_id) const |
| bool | setRenderMethod (const UT_StringRef &item_id, const UT_StringHolder &render_method) |
| bool | setLabel (const UT_StringRef &item_id, const UT_StringHolder &label) |
| bool | setThumbnail (const UT_StringRef &item_id, const UT_WorkBuffer &thumbnail) |
| bool | setModificationDate (const UT_StringRef &item_id, time_t timestamp) |
| bool | setIsStarred (const UT_StringRef &item_id, bool isstarred) |
| bool | setColorTag (const UT_StringRef &item_id, const UT_StringHolder &color_tag) |
| bool | setMetadata (const UT_StringRef &item_id, const UT_Options &metadata) |
| bool | setFilePath (const UT_StringRef &item_id, const char *file_path) |
| bool | setOwnsFile (const UT_StringRef &item_id, bool owns_file) |
| bool | setBlindData (const UT_StringRef &item_id, const void *data, int data_size) |
| bool | setStatus (const UT_StringRef &item_id, const UT_StringHolder &status) |
| bool | setParentId (const UT_StringRef &item_id, const UT_StringRef &parent_item_id) |
| bool | createTag (const char *tag) |
| bool | deleteTag (const char *tag, bool delete_if_assigned) |
| bool | addTag (const UT_StringRef &item_id, const char *tag) |
| bool | removeTag (const UT_StringRef &item_id, const char *tag) |
| UT_StringHolder | generateItemFilePath (const UT_StringRef &item_id, const char *file_ext) |
| 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=nullptr, bool item_owns_file=false, const void *item_data=nullptr, int item_data_size=0, time_t *creation_date=nullptr, const UT_StringRef &parent_id=UT_StringHolder::theEmptyString) |
| Add a new gallery item to the data source. More... | |
| bool | markItemsForDeletion (const UT_StringArray &item_ids) |
| bool | unmarkItemsForDeletion (const UT_StringArray &item_ids) |
| bool | saveAs (const UT_StringHolder &source_identifier) |
Static Public Member Functions | |
| static void | registerDataSourceImplementation (const ValidatorFunc &validator, const CreatorFunc &creator) |
Provides a stable API for QT_GalleryModel and its subclasses for populating the model from a variety of data sources. Provides a plugin architecture for adding new UT_GalleryDataSourceImpl subclasses which are constructed based on the source_identifier sent to this object's constructor. Also provides a global registry of UT_GalleryDataSource objects, so there is always only one data source created for a given source_identifier.
Definition at line 230 of file UT_GalleryDataSource.h.
| typedef UT_Function<UT_SharedPtr<UT_GalleryDataSourceImpl> const UT_StringHolder &, const UT_StringHolder &)> UT_GalleryDataSource::CreatorFunc |
Definition at line 243 of file UT_GalleryDataSource.h.
| typedef UT_Function<bool (const UT_StringHolder &)> UT_GalleryDataSource::ValidatorFunc |
Definition at line 240 of file UT_GalleryDataSource.h.
| UT_GalleryDataSource::UT_GalleryDataSource | ( | const UT_StringHolder & | source_identifier, |
| const UT_StringHolder & | args | ||
| ) |
| UT_GalleryDataSource::~UT_GalleryDataSource | ( | ) |
| UT_StringHolder UT_GalleryDataSource::addItem | ( | const UT_StringRef & | item_type_name, |
| const UT_StringRef & | name, | ||
| const void * | thumbnail_data, | ||
| int | thumbnail_data_size, | ||
| const char * | item_file = nullptr, |
||
| bool | item_owns_file = false, |
||
| const void * | item_data = nullptr, |
||
| int | item_data_size = 0, |
||
| time_t * | creation_date = nullptr, |
||
| const UT_StringRef & | parent_id = UT_StringHolder::theEmptyString |
||
| ) |
Add a new gallery item to the data source.
| bool UT_GalleryDataSource::addTag | ( | const UT_StringRef & | item_id, |
| const char * | tag | ||
| ) |
|
inline |
Definition at line 321 of file UT_GalleryDataSource.h.
|
inline |
Populate an array with all valid item ids with the given parent 'item_id'.
Definition at line 289 of file UT_GalleryDataSource.h.
|
inline |
Definition at line 311 of file UT_GalleryDataSource.h.
| bool UT_GalleryDataSource::createTag | ( | const char * | tag | ) |
|
inline |
Definition at line 305 of file UT_GalleryDataSource.h.
| bool UT_GalleryDataSource::deleteTag | ( | const char * | tag, |
| bool | delete_if_assigned | ||
| ) |
|
inline |
Definition at line 280 of file UT_GalleryDataSource.h.
|
inline |
Definition at line 317 of file UT_GalleryDataSource.h.
| UT_StringHolder UT_GalleryDataSource::generateItemFilePath | ( | const UT_StringRef & | item_id, |
| const char * | file_ext | ||
| ) |
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).
|
inline |
Return HTML formatted info about the data source.
Definition at line 272 of file UT_GalleryDataSource.h.
|
inline |
Definition at line 329 of file UT_GalleryDataSource.h.
|
inline |
Return true if this specific item is read-only. Only called when isReadOnly() is false.
Definition at line 263 of file UT_GalleryDataSource.h.
|
inline |
Return true if the source implementation is read only.
Definition at line 255 of file UT_GalleryDataSource.h.
|
inline |
Definition at line 309 of file UT_GalleryDataSource.h.
|
inline |
Return true if this gallery data source owns a valid data source implementation object. You can still call all the methods on an invalid object, but they do nothing. This check allows the UI to present an error message for an invalid source identifier.
Definition at line 252 of file UT_GalleryDataSource.h.
|
inline |
Populate an array with all valid item ids.
Definition at line 284 of file UT_GalleryDataSource.h.
|
inline |
Definition at line 299 of file UT_GalleryDataSource.h.
| bool UT_GalleryDataSource::markItemsForDeletion | ( | const UT_StringArray & | item_ids | ) |
Mark items for deletion in the data source. Do nothing for invalid item ids or items that are already marked for deletion.
|
inline |
Definition at line 315 of file UT_GalleryDataSource.h.
|
inline |
Definition at line 307 of file UT_GalleryDataSource.h.
|
inline |
Definition at line 319 of file UT_GalleryDataSource.h.
|
inline |
Definition at line 325 of file UT_GalleryDataSource.h.
|
inline |
Definition at line 327 of file UT_GalleryDataSource.h.
|
static |
| bool UT_GalleryDataSource::removeTag | ( | const UT_StringRef & | item_id, |
| const char * | tag | ||
| ) |
|
inline |
Definition at line 297 of file UT_GalleryDataSource.h.
| bool UT_GalleryDataSource::saveAs | ( | const UT_StringHolder & | source_identifier | ) |
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.
| bool UT_GalleryDataSource::setBlindData | ( | const UT_StringRef & | item_id, |
| const void * | data, | ||
| int | data_size | ||
| ) |
| bool UT_GalleryDataSource::setColorTag | ( | const UT_StringRef & | item_id, |
| const UT_StringHolder & | color_tag | ||
| ) |
| bool UT_GalleryDataSource::setFilePath | ( | const UT_StringRef & | item_id, |
| const char * | file_path | ||
| ) |
| bool UT_GalleryDataSource::setIsStarred | ( | const UT_StringRef & | item_id, |
| bool | isstarred | ||
| ) |
| bool UT_GalleryDataSource::setLabel | ( | const UT_StringRef & | item_id, |
| const UT_StringHolder & | label | ||
| ) |
| bool UT_GalleryDataSource::setMetadata | ( | const UT_StringRef & | item_id, |
| const UT_Options & | metadata | ||
| ) |
| bool UT_GalleryDataSource::setModificationDate | ( | const UT_StringRef & | item_id, |
| time_t | timestamp | ||
| ) |
| bool UT_GalleryDataSource::setOwnsFile | ( | const UT_StringRef & | item_id, |
| bool | owns_file | ||
| ) |
| bool UT_GalleryDataSource::setParentId | ( | const UT_StringRef & | item_id, |
| const UT_StringRef & | parent_item_id | ||
| ) |
| bool UT_GalleryDataSource::setRenderMethod | ( | const UT_StringRef & | item_id, |
| const UT_StringHolder & | render_method | ||
| ) |
| bool UT_GalleryDataSource::setStatus | ( | const UT_StringRef & | item_id, |
| const UT_StringHolder & | status | ||
| ) |
| bool UT_GalleryDataSource::setThumbnail | ( | const UT_StringRef & | item_id, |
| const UT_WorkBuffer & | thumbnail | ||
| ) |
|
inline |
Return the source args.
Definition at line 269 of file UT_GalleryDataSource.h.
|
inline |
Return the source identifier.
Definition at line 266 of file UT_GalleryDataSource.h.
|
inline |
Return the source type.
Definition at line 293 of file UT_GalleryDataSource.h.
|
inline |
Begins/ends transactions so that functions which end up generating large numbers of queries/modifications can be more efficient.
Definition at line 278 of file UT_GalleryDataSource.h.
|
inline |
Definition at line 323 of file UT_GalleryDataSource.h.
|
inline |
Return true if the source supports mutable per-item annotations even when isReadOnly() is true.
Definition at line 259 of file UT_GalleryDataSource.h.
|
inline |
Definition at line 313 of file UT_GalleryDataSource.h.
|
inline |
Definition at line 301 of file UT_GalleryDataSource.h.
|
inline |
Definition at line 303 of file UT_GalleryDataSource.h.
|
inline |
Definition at line 295 of file UT_GalleryDataSource.h.
| bool UT_GalleryDataSource::unmarkItemsForDeletion | ( | const UT_StringArray & | item_ids | ) |
Unmark items for deletion in the data source. Do nothing for invalid item ids or items that are not marked for deletion.
| void UT_GalleryDataSource::updatedItemIds | ( | UT_StringArray & | item_ids | ) |