SDKBrowser Class Reference Library » Browser

#include <lib_browser.h>

详细描述

The main browser library class.

私有成员函数

  SDKBrowser ()
  ~SDKBrowser ()

SDKBrowserCategory

enum   {
   CategoryPresetNodes ,
   CategoryCatalogNodes ,
   CategoryDriveNodes ,
   CategoryRecentNodes ,
   CategorySearchNodes ,
   ddumdumdimdum
}

SDKBrowserFind

enum   {
   FindExactMatch ,
   FindBestMatch ,
   ForceDirectoryUpdate
}

SDKBrowserFileSystemTypes

enum   {
   Computer ,
   Drive ,
   DriveCD ,
   Folder ,
   FolderOpen ,
   FolderPresets ,
   FolderCatalogs ,
   FolderSearch ,
   Document ,
   ThreeDFile ,
   ImageFile ,
   MovieFile ,
   预置
}

SDKBrowserPresetDb

enum   {
   UserPresetDb ,
   InvalidPresetDb
}

SDKBrowserPresetLibrary

enum   {
   ReadOnlyPresetLibrary ,
   SystemPresetLibrary ,
   IgnoreROPresetLibrary
}

SDKBrowserPreview

enum   {
   PreviewReplace ,
   PreviewAppend
}

InsertNodeFromDataBase Callback

typedef SDKBrowserContentNodeRef   InsertNodeFromDataBase ( SDKBrowserContentNodeRef parent, SDKBrowserContentNodeRef existing_node, const SDKBrowserURL &url, const String &name, UInt32 flags, Int32 db_index, void *user_data)

Open New Browser

static Bool   OpenNewBrowser (const SDKBrowserURL &path, UInt32 flags=0)
static Bool   OpenNewBrowserWithTitle (const SDKBrowserURL &path, const String &custom_title= String (), UInt32 flags=0)

Category Node

static SDKBrowserContentNodeRef   GetCategoryNode ( Int32 where)

Icon

static SDKBrowserIcon GetIcon ( Int32 id, Int32 pref_wh=0)
static SDKBrowserIcon GetIcon (const SDKBrowserURL &url, SDKBrowserPluginRef plugin=nullptr, Int32 flags=0, LocalFileTime *preview_time=nullptr)
static SDKBrowserIcon GetPreviewIcon ( SDKBrowserContentNodeRef content, Int32 pref_wh, Int32 flags= SDKBrowserContentNode::IconPreviewBitmap )
static SDKBrowserIcon CreateIcon ( BaseBitmap *bm, Bool dont_free)
static void  ReleaseIcon ( SDKBrowserIcon *icon)

Register Browser Plugin

static Bool   RegisterBrowserPlugin ( SDKBrowserPluginInterfaceInfo *plugin_info, UInt32 flags=0)
static Bool   UnregisterBrowserPlugin ( SDKBrowserPluginInterfaceInfo *plugin_info)

Register Preset Library

static Int32   RegisterPresetLibrary (const SDKBrowserURL &domain, const String &name, const Filename &f)
static Bool   UnregisterPresetLibrary ( Int32 db_index, const Filename &f)

Database Index

static Int32   GetDbIndex (const SDKBrowserURL &url, UInt32 flags=0)

预置

static Bool   ExistsPreset (const SDKBrowserURL &url)
static Bool   LoadPreset ( Int32 db_index, const SDKBrowserURL &url, Int32 &plugin_id, BaseContainer *bc, void **data, Int *length)
static Bool   SavePreset ( Int32 db_index, const SDKBrowserURL &url, Int32 plugin_id, const BaseContainer *bc, void *data, Int length)
static Bool   DeletePreset ( Int32 db_index, const SDKBrowserURL &url, Int32 plugin_id)
static Bool   CopyPreset (const SDKBrowserURL &src, const SDKBrowserURL &dst)
static Bool   GetPresetName ( Int32 db_index, const SDKBrowserURL &url, Int32 language_id, String &out_name)
static Bool   SetPresetName ( Int32 db_index, const SDKBrowserURL &url, Int32 language_id, const String &name)
static Bool   ChangePresetURL ( Int32 db_index, const SDKBrowserURL &url, const SDKBrowserURL &new_url, Int32 plugin_id)
static Bool   GetPresetAnnotation ( Int32 db_index, const SDKBrowserURL &url, String &annotation)
static Bool   SetPresetAnnotation ( Int32 db_index, const SDKBrowserURL &url, const String &annotation)
static Bool   SetPresetPreview ( Int32 db_index, const SDKBrowserURL &url, Int32 模式, Int32 preview_quality, BaseBitmap *bm, const LocalFileTime *lft)
static BaseBitmap GetPresetPreview ( Int32 db_index, const SDKBrowserURL &url, Int32 frame_idx)
static Bool   GetPresetAnimationData ( Int32 db_index, const SDKBrowserURL &url, Int32 *first_frame_idx, Int32 *last_frame_idx, Float *fps)
static Bool   SetPresetAnimationData ( Int32 db_index, const SDKBrowserURL &url, Int32 first_frame_idx, Int32 last_frame_idx, Float fps)
static Bool   SavePresetObject (const SDKBrowserURL &url, BaseList2D *bl)
static Bool   ReadNodesFromDatabase ( Int32 db_index, const SDKBrowserURL &base_url, SDKBrowserContentNodeRef base_node, InsertNodeFromDataBase *callback, void *user_data)
static Bool   CreatePresetNode ( Int32 db_index, const SDKBrowserURL &url, Int32 plugin_id, Int32 mode=0)
static Bool   SetPresetSortOrder ( SDKBrowserContentNodeRef *nodes, Int32 cnt)
static Bool   MountPresetLibrary (const Filename &fn, UInt32 flags, SDKBrowserURL *domain=nullptr)

杂项

static void  UpdateNotification ( SDKBrowserContentNodeRef node, Int32 flags=0)
static Int32   PreviewDialogMisc ( SubDialog *dlg, void *&private_data, Int32 cmd, Int32 value0=0, Int32 value1=0, void *value2=nullptr, void *value3=nullptr)
static SDKBrowserContentNodeRef   FindNode (const SDKBrowserURL &url, Int32 flags= FindExactMatch , SDKBrowserContentNodeRef start_from=0)
static Bool   Identify (const SDKBrowserURL &url, UInt32 flags, SDKBrowserPluginRef *plugin_out)

Default Object

static BaseList2D GetDefaultObject ( Int32 id, UInt32 flags=0)
static Bool   SetDefaultObject ( BaseList2D *bl, UInt32 flags=0)

Member Typedef Documentation

◆  InsertNodeFromDataBase

typedef SDKBrowserContentNodeRef InsertNodeFromDataBase( SDKBrowserContentNodeRef parent, SDKBrowserContentNodeRef existing_node, const SDKBrowserURL &url, const String &name, UInt32 flags, Int32 db_index, void *user_data)

Node insertion callback.

参数
[in] parent The parent node.
[in] existing_node An existing node.
[in] url The URL.
[in] name The name.
[in] flags The flags.
[in] db_index The database index.
[in] user_data The callback user data.
返回
A content node.

Member Enumeration Documentation

◆  anonymous enum

anonymous enum
Enumerator
CategoryPresetNodes 

Preset category.

CategoryCatalogNodes 

Catalog category.

CategoryDriveNodes 

Drive category.

CategoryRecentNodes 

Recent category.

CategorySearchNodes 

Search category.

ddumdumdimdum 

◆  anonymous enum

anonymous enum
Enumerator
FindExactMatch 

Find exact match.

FindBestMatch 

Find best match.

ForceDirectoryUpdate 

Force directory update.

◆  anonymous enum

anonymous enum
Enumerator
Computer 

Computer.

Drive 

Drive.

DriveCD 

CD drive.

Folder 

Folder.

FolderOpen 

Open folder.

FolderPresets 

Presets folder.

FolderCatalogs 

Catalogs folder.

FolderSearch 

Search folder.

Document 

Document folder.

ThreeDFile 

3D file.

ImageFile 

Image file.

MovieFile 

Movie file.

Preset 

Preset.

◆  anonymous enum

anonymous enum
Enumerator
UserPresetDb 

User preset library database index.

InvalidPresetDb 

Invalid database index.

◆  anonymous enum

anonymous enum
Enumerator
ReadOnlyPresetLibrary 

Disable write operations to the preset library (regardless of the file system settings).

SystemPresetLibrary 

System preset library.

IgnoreROPresetLibrary 

Ignore a read-only flag in the preset library and makes it writable.

◆  anonymous enum

anonymous enum
Enumerator
PreviewReplace 

Previews are replaced.

PreviewAppend 

Previews are appended.

构造函数 & 析构函数文档编制

◆  SDKBrowser()

SDKBrowser () private

◆  ~SDKBrowser()

~ SDKBrowser () private

成员函数文档编制

◆  OpenNewBrowser()

static Bool OpenNewBrowser ( const SDKBrowserURL path ,
UInt32   flags = 0  
)
static

Opens a new browser at path .

参数
[in] path The path to open.
[in] flags The flags.
返回
true if successful, otherwise false .

◆  OpenNewBrowserWithTitle()

static Bool OpenNewBrowserWithTitle ( const SDKBrowserURL path ,
const String custom_title = String() ,
UInt32   flags = 0  
)
static

Opens a new browser at path with a custom title.

参数
[in] path The path to open.
[in] custom_title The custom title.
[in] flags The flags.
返回
true if successful, otherwise false .

◆  GetCategoryNode()

static SDKBrowserContentNodeRef GetCategoryNode ( Int32   where )
static

Gets a category node.

参数
[in] where The category. See SDKBrowserCategory .
返回
The category node, or nullptr if it could not be found.

◆  GetIcon() [1/2]

static SDKBrowserIcon * GetIcon ( Int32   id ,
Int32   pref_wh = 0  
)
static

Gets an icon by ID.

参数
[in] id The icon ID.
[in] pref_wh The preferred width/height of the icon.
返回
The icon.

◆  GetIcon() [2/2]

static SDKBrowserIcon * GetIcon ( const SDKBrowserURL url ,
SDKBrowserPluginRef   plugin = nullptr ,
Int32   flags = 0 ,
LocalFileTime preview_time = nullptr  
)
static

Gets an icon by URL and plugin ID.

参数
[in] url A URL to get the icon for.
[in] plugin A corresponding plugin ID.
[in] flags Reserved.
[in] preview_time An optional preview time.
返回
The icon.

◆  GetPreviewIcon()

static SDKBrowserIcon * GetPreviewIcon ( SDKBrowserContentNodeRef   content ,
Int32   pref_wh ,
Int32   flags = SDKBrowserContentNode::IconPreviewBitmap  
)
static

Retrieves the pointer to a preview icon. If no preview is available the default icon for the type of node will be returned. The browser will cache the icon.

参数
[in] content The node for which an icon will be returned.
[in] pref_wh The preferred width/height of the icon.
[in] flags The flags. See SDKBrowserIconFlags .
返回
The icon.

◆  CreateIcon()

static SDKBrowserIcon * CreateIcon ( BaseBitmap bm ,
Bool   dont_free  
)
static

Creates an icon from a bitmap.

参数
[in] bm The bitmap to create the icon from.
[in] dont_free true if the icon bitmap should not be freed.
返回
The icon.

◆  ReleaseIcon()

static void ReleaseIcon ( SDKBrowserIcon icon )
static

Releases icon .

参数
[in,out] icon The icon to release.

◆  RegisterBrowserPlugin()

static Bool RegisterBrowserPlugin ( SDKBrowserPluginInterfaceInfo plugin_info ,
UInt32   flags = 0  
)
static

Registers the browser plugin in plugin_info .

参数
[in] plugin_info The browser plugin to register.
[in] flags The flags.
返回
true if successful, otherwise false .

◆  UnregisterBrowserPlugin()

static Bool UnregisterBrowserPlugin ( SDKBrowserPluginInterfaceInfo plugin_info )
static

Unregisters the browser plugin in plugin_info .

参数
[in] plugin_info The browser plugin to unregister.
返回
true if successful, otherwise false .

◆  RegisterPresetLibrary()

static Int32 RegisterPresetLibrary ( const SDKBrowserURL domain ,
const String name ,
const Filename f  
)
static

Registers a preset library.

参数
[in] domain The preset domain.
[in] name The name of the database.
[in] f The file name and path.
返回
The database index of the registered preset library, or < 0 if an error occurred.

◆  UnregisterPresetLibrary()

static Bool UnregisterPresetLibrary ( Int32   db_index ,
const Filename f  
)
static

Unregisters a preset library.

参数
[in] db_index The database index. Use UserPresetDb for the user preset library, or a value from GetDbIndex() or RegisterPresetLibrary() .
[in] f The file name and path.
返回
true if successful, otherwise false .

◆  GetDbIndex()

static Int32 GetDbIndex ( const SDKBrowserURL url ,
UInt32   flags = 0  
)
static

Gets the database index of url .

参数
[in] url The URL to get the database index for.
[in] flags The flags.
返回
The database index, or InvalidPresetDb if url does not belong to any preset database.

◆  ExistsPreset()

static Bool ExistsPreset ( const SDKBrowserURL url )
static

Checks if a preset exists.

参数
[in] url The URL of the preset.
返回
true if a preset exists at url , otherwise false .

◆  LoadPreset()

static Bool LoadPreset ( Int32   db_index ,
const SDKBrowserURL url ,
Int32 plugin_id ,
BaseContainer bc ,
void **  data ,
Int length  
)
static

Loads data for a preset node in a specific preset database.

参数
[in] db_index The database index. Use UserPresetDb for the user preset library, or a value from GetDbIndex() or RegisterPresetLibrary() .
[in] url The URL of the preset node.
[out] plugin_id Assigned The ID of the plugin that saved the data.
[out] bc Assigned an information container. Can be nullptr .
[out] data Assigned a memory block with private node data. The memory will be owned by the caller. Can be nullptr .
[out] length Assigned the length of the private node data in bytes.
返回
true if successful, otherwise false .

◆  SavePreset()

static Bool SavePreset ( Int32   db_index ,
const SDKBrowserURL url ,
Int32   plugin_id ,
const BaseContainer bc ,
void *  data ,
Int   length  
)
static

Saves data for a preset node in a specific preset database.

参数
[in] db_index The database index. Use UserPresetDb for the user preset library, or a value from GetDbIndex() or RegisterPresetLibrary() .
[in] url The URL of the preset node.
[in] plugin_id The ID of the plugin that saves the data. (This should be the same value as SDKBrowserPluginInterface::GetPluginID() .)
[in] bc Pointer to an information container. Can be nullptr .
[in] data Memory block with private node data. The caller owns the memory block. Can be nullptr .
[in] length The length of the private node data in bytes.
返回
true if successful, otherwise false .

◆  DeletePreset()

static Bool DeletePreset ( Int32   db_index ,
const SDKBrowserURL url ,
Int32   plugin_id  
)
static

Deletes data for a preset node in a specific preset database.

参数
[in] db_index The database index. Use UserPresetDb for the user preset library, or a value from GetDbIndex() or RegisterPresetLibrary() .
[in] url The URL of the preset node.
[in] plugin_id The ID of the plugin that saves the data. (This should be the same value as SDKBrowserPluginInterface::GetPluginID() .)
返回
true if successful, otherwise false .

◆  CopyPreset()

static Bool CopyPreset ( const SDKBrowserURL src ,
const SDKBrowserURL dst  
)
static

Copies presets.

参数
[in] src The URL of the source preset.
[in] dst The URL of the destination preset.
返回
true if successful, otherwise false .

◆  GetPresetName()

static Bool GetPresetName ( Int32   db_index ,
const SDKBrowserURL url ,
Int32   language_id ,
String out_name  
)
static

Retrieves the language specific name of a preset.

参数
[in] db_index The database index. Use UserPresetDb for the user preset library, or a value from GetDbIndex() or RegisterPresetLibrary() .
[in] url The URL of the preset node.
[in] language_id The language ID. LanguageDefault for the default language. See SDKBrowserLanguage .
[out] out_name Assigned the preset name.
返回
true if successful, otherwise false .

◆  SetPresetName()

static Bool SetPresetName ( Int32   db_index ,
const SDKBrowserURL url ,
Int32   language_id ,
const String name  
)
static

Sets the language specific name of a preset.

参数
[in] db_index The database index. Use UserPresetDb for the user preset library, or a value from GetDbIndex() or RegisterPresetLibrary() .
[in] url The URL of the preset node.
[in] language_id The language ID. LanguageDefault for the default language. See SDKBrowserLanguage .
[in] name The new name..
返回
true if successful, otherwise false .

◆  ChangePresetURL()

static Bool ChangePresetURL ( Int32   db_index ,
const SDKBrowserURL url ,
const SDKBrowserURL new_url ,
Int32   plugin_id  
)
static

Changes the preset URL.

参数
[in] db_index The database index. Use UserPresetDb for the user preset library, or a value from GetDbIndex() or RegisterPresetLibrary() .
[in] url The URL of the preset node.
[in] new_url The new URL.
[in] plugin_id The ID of the plugin that saved the data (this should be the same value as SDKBrowserPluginInterface::GetPluginID() ).
返回
true if successful, otherwise false .

◆  GetPresetAnnotation()

static Bool GetPresetAnnotation ( Int32   db_index ,
const SDKBrowserURL url ,
String annotation  
)
static

Retrieves the annotation string of a preset.

参数
[in] db_index The database index. Use UserPresetDb for the user preset library, or a value from GetDbIndex() or RegisterPresetLibrary() .
[in] url The URL of the preset node.
[out] annotation Assigned the annotation.
返回
true if successful, otherwise false .

◆  SetPresetAnnotation()

static Bool SetPresetAnnotation ( Int32   db_index ,
const SDKBrowserURL url ,
const String annotation  
)
static

Sets the annotation string of a preset.

参数
[in] db_index The database index. Use UserPresetDb for the user preset library, or a value from GetDbIndex() or RegisterPresetLibrary() .
[in] url The URL of the preset node.
[in] annotation The new annotation.
返回
true if successful, otherwise false .

◆  SetPresetPreview()

static Bool SetPresetPreview ( Int32   db_index ,
const SDKBrowserURL url ,
Int32   mode ,
Int32   preview_quality ,
BaseBitmap bm ,
const LocalFileTime lft  
)
static

Sets the preview bitmap of a preset.

参数
[in] db_index The database index. Use UserPresetDb for the user preset library, or a value from GetDbIndex() or RegisterPresetLibrary() .
[in] url The URL of the preset node.
[in] mode The mode. See SDKBrowserPreview .
[in] preview_quality The new preview quality. See SDKBrowserPreviewQuality .
[in] bm The preview bitmap. Copied.
[in] lft The preview time. Copied.
返回
true if successful, otherwise false .

◆  GetPresetPreview()

static BaseBitmap * GetPresetPreview ( Int32   db_index ,
const SDKBrowserURL url ,
Int32   frame_idx  
)
static

Gets the preview bitmap for a preset.

参数
[in] db_index The database index. Use UserPresetDb for the user preset library, or a value from GetDbIndex() or RegisterPresetLibrary() .
[in] url The URL of the preset node.
[in] frame_idx The frame index, for movie clip previews.
返回
The preview bitmap.

◆  GetPresetAnimationData()

static Bool GetPresetAnimationData ( Int32   db_index ,
const SDKBrowserURL url ,
Int32 first_frame_idx ,
Int32 last_frame_idx ,
Float fps  
)
static

Retrieves the animation data for an animated preset preview.

参数
[in] db_index The database index. Use UserPresetDb for the user preset library, or a value from GetDbIndex() or RegisterPresetLibrary() .
[in] url The URL of the preset node.
[out] first_frame_idx Assigned the number of the first frame.
[out] last_frame_idx Assigned the number of the last frame.
[out] fps Assigned the frames per second.
返回
true if successful, otherwise false .

◆  SetPresetAnimationData()

static Bool SetPresetAnimationData ( Int32   db_index ,
const SDKBrowserURL url ,
Int32   first_frame_idx ,
Int32   last_frame_idx ,
Float   fps  
)
static

Sets the animation data for an animated preset preview.

参数
[in] db_index The database index. Use UserPresetDb for the user preset library, or a value from GetDbIndex() or RegisterPresetLibrary() .
[in] url The URL of the preset node.
[in] first_frame_idx The number of the first frame.
[in] last_frame_idx The number of the last frame.
[in] fps Assigned the frames per second.
返回
true if successful, otherwise false .

◆  SavePresetObject()

static Bool SavePresetObject ( const SDKBrowserURL url ,
BaseList2D bl  
)
static

Saves a BaseList2D object as preset. An already existing node with the url will be replaced.

参数
[in] url The URL of the preset node. There must be an existing node for the URL!
[in] bl The base list object.
返回
true if successful, otherwise false .

◆  ReadNodesFromDatabase()

static Bool ReadNodesFromDatabase ( Int32   db_index ,
const SDKBrowserURL base_url ,
SDKBrowserContentNodeRef   base_node ,
InsertNodeFromDataBase callback ,
void *  user_data  
)
static

Reads nodes from a database.

参数
[in] db_index The database index. Use UserPresetDb for the user preset library, or a value from GetDbIndex() or RegisterPresetLibrary() .
[in] base_url The base URL.
[in] base_node The base node.
[in] callback The callback.
[in] user_data The user data for the callback.
返回
true if successful, otherwise false .

◆  CreatePresetNode()

static Bool CreatePresetNode ( Int32   db_index ,
const SDKBrowserURL url ,
Int32   plugin_id ,
Int32   mode = 0  
)
static

Creates a new preset node.

参数
[in] db_index The database index. Use UserPresetDb for the user preset library, or a value from GetDbIndex() or RegisterPresetLibrary() .
[in] url The URL to create the preset node for.
[in] plugin_id The ID of the plugin for the preset node (this should be the same value as SDKBrowserPluginInterface::GetPluginID() ).
[in] mode The preset mode.
返回
true if successful, otherwise false .

◆  SetPresetSortOrder()

static Bool SetPresetSortOrder ( SDKBrowserContentNodeRef nodes ,
Int32   cnt  
)
static

Used to define a custom preset order for a directory.
When iterating through the nodes in a directory the content browser will return them in the order that is specified in the array nodes .
BodyPaint 3D for example uses this function to change the order of the brush presets.

参数
[in] nodes The nodes array.
[in] cnt The length of the nodes array.
返回
true if successful, otherwise false .

◆  MountPresetLibrary()

static Bool MountPresetLibrary ( const Filename fn ,
UInt32   flags ,
SDKBrowserURL domain = nullptr  
)
static

Mounts a preset library.

参数
[in] fn The file name of the library to load.
[in] flags The flags. See SDKBrowserPresetLibrary .
[out] domain Assigned the domain of the preset, can be nullptr .
返回
true if successful, otherwise false .

◆  UpdateNotification()

static void UpdateNotification ( SDKBrowserContentNodeRef   node ,
Int32   flags = 0  
)
static

Tells the browser about changes in node .

参数
[in] node The modified node (or parent node).
[in] flags Reserved.

◆  PreviewDialogMisc()

static Int32 PreviewDialogMisc ( SubDialog dlg ,
void *&  private_data ,
Int32   cmd ,
Int32   value0 = 0 ,
Int32   value1 = 0 ,
void *  value2 = nullptr ,
void *  value3 = nullptr  
)
static

Private .

◆  FindNode()

static SDKBrowserContentNodeRef FindNode ( const SDKBrowserURL url ,
Int32   flags = FindExactMatch ,
SDKBrowserContentNodeRef   start_from = 0  
)
static

Retrieves the browser content node corresponding to url .

参数
[in] url The URL of the node.
[in] flags The flags. See SDKBrowserFind .
[in] start_from An optional start node.
返回
The found node, or nullptr if no node was found.

◆  Identify()

static Bool Identify ( const SDKBrowserURL url ,
UInt32   flags ,
SDKBrowserPluginRef plugin_out  
)
static

Identifies url .

参数
[in] url The URL to identify.
[in] flags The flags.
[in] plugin_out Assigned the corresponding plugin, if found.
返回
true if successful, otherwise false .

◆  GetDefaultObject()

static BaseList2D * GetDefaultObject ( Int32   id ,
UInt32   flags = 0  
)
static

Retrieves a default object of type id if available.

参数
[in] id The object type.
[in] flags The flags.
返回
A clone of the default object. The caller owns the pointed object.

◆  SetDefaultObject()

static Bool SetDefaultObject ( BaseList2D bl ,
UInt32   flags = 0  
)
static

Sets a default object for the type of bl , overwriting older default library objects for this type.

参数
[in] bl The new default object. The object is cloned. The caller owns the pointed object.
[in] flags The flags.
返回
true if successful, otherwise false .