SDKBrowserContentNodeInfo Class Reference

abstract

#include <lib_browser.h>

详细描述

Plugin interface for content node plugins.

Private Attributes

Int32   plugin_id
void *  node

Friends

class  SDKBrowserContentNode
class  SDKNode

Constructor

  SDKBrowserContentNodeInfo ( Int32 plugin_id )
SDKBrowserContentNodeRef   GetNode (void) const

Init/Free

virtual Bool   Init (void * node )
virtual void  Free (void)

Get

virtual Int32   GetTypeID (void)=0
virtual SDKBrowserPluginRef   GetPlugin ( UInt32 flags=0)=0
virtual String   GetName (void)=0
virtual String   GetTypeName ( Int32 mode)
virtual Int32   GetNodeURL ( SDKBrowserURL &url, UInt32 flags=0) const =0
virtual Bool   GetNodeTime ( UInt32 模式, LocalFileTime *out)=0
virtual UInt32   GetNodeFlags ( Int64 *out_size=nullptr)=0
virtual SDKBrowserIcon GetIcon ( Int32 flags=0, Int32 pref_wh=0)=0

杂项

virtual Int32   UpdateDirectory (void)=0
virtual Int32   PrivateCall ( Int32 plugin_id , Int32 node_type, Int32 selector, void *data)

SDKBrowserOperation

enum   {
   CheckOperation ,
   PrepareOperation ,
   PerformOperation ,
   ModeMask ,
   ModePrivateFlag1 ,
   ModePrivateFlag2 ,
   ModePrivateFlag3 ,
   ModePrivateFlag4 ,
   ModePrivateFlag5 ,
   ModePrivateFlag6 ,
   ModePrivateFlag7
}

SDKBrowserOperationResult

enum   {
   OperationSuccessful ,
   RenameNotPermitted ,
   MoveNotPermitted ,
   CopyNotPermitted ,
   DeleteNotPermitted ,
   NewFolderNotPermitted ,
   RenameError ,
   MoveError ,
   CopyError ,
   DeleteError ,
   UnsupportedNodeType ,
   UserCancelled
}

Rename/NewFolder

virtual Int32   Rename ( Int32 mode, const String &name)
virtual Int32   NewFolder ( Int32 mode, const String &name, SDKBrowserContentNodeRef *folder=nullptr)

Move/Copy/Delete

virtual Int32   MoveFrom ( SDKBrowserContentNodeRef new_child, Int32 模式, CopyMoveCallback *callback, void *private_data, BaseThread *thread)
virtual Int32   CopyFrom ( SDKBrowserContentNodeRef new_child, Int32 mode, const String *rename, CopyMoveCallback *callback, void *private_data, BaseThread *thread)
virtual Int32   删除 ( Int32 模式, CopyMoveCallback *callback, void *private_data, BaseThread *thread)

Destructor

virtual  ~SDKBrowserContentNodeInfo ()

Member Enumeration Documentation

◆  anonymous enum

anonymous enum
Enumerator
CheckOperation 

Check if the node (and its children) can be moved/copied/deleted (to the requested destination).

PrepareOperation 

Collect information about the number of items and their size.

PerformOperation 

Perform the move/copy/delete operation.

ModeMask 

Mask.

ModePrivateFlag1 

Private .

ModePrivateFlag2 

Private .

ModePrivateFlag3 

Private .

ModePrivateFlag4 

Private .

ModePrivateFlag5 

Private .

ModePrivateFlag6 

Private .

ModePrivateFlag7 

Private .

◆  anonymous enum

anonymous enum
Enumerator
OperationSuccessful 

Operation successful.

RenameNotPermitted 

Rename not permitted. 0x80000001 .

MoveNotPermitted 

Move not permitted. 0x80000002 .

CopyNotPermitted 

Copy not permitted. 0x80000004 .

DeleteNotPermitted 

Delete not permitted. 0x80000008 .

NewFolderNotPermitted 

New folder not permitted. 0x80000010 .

RenameError 

Rename error. 0x80000100 .

MoveError 

Move error. 0x80000200 .

CopyError 

Copy error. 0x80000400 .

DeleteError 

Delete error. 0x80000800 .

UnsupportedNodeType 

Unsupported node type. 0xa0000000L .

UserCancelled 

User canceled. 0xc0000000L

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

◆  SDKBrowserContentNodeInfo()

SDKBrowserContentNodeInfo ( Int32   plugin_id )
explicit

Constructor.

参数
[in] plugin_id The ID of the plugin that has created the node info.

◆  ~SDKBrowserContentNodeInfo()

virtual ~ SDKBrowserContentNodeInfo ( )
virtual

A dummy destructor to make the compiler happy.

成员函数文档编制

◆  GetNode()

SDKBrowserContentNodeRef GetNode ( void  ) const

Retrieves the corresponding node.

返回
The node corresponding to this info.

◆  Init()

virtual Bool Init ( void *  node )
virtual

Called by the browser with pointer to the corresponding node.

参数
[in] node Pointer to the node.
返回
true if successful, otherwise false .

◆  Free()

virtual void Free ( void  )
virtual

Called by the browser before the node is deleted (overload this to dispose of the SDKBrowserContentNodeInfo at a later time).

◆  GetTypeID()

virtual Int32 GetTypeID ( void  )
pure virtual

Called to retrieve the type of content node.

返回
The content node type ID. See SDKBrowserNodeTypeID .

◆  GetPlugin()

virtual SDKBrowserPluginRef GetPlugin ( UInt32   flags = 0 )
pure virtual

Called to retrieve a plugin that can deal with the file.

参数
[in] flags The flags.
返回
A plugin that can deal with the file of the node.

◆  GetName()

virtual String GetName ( void  )
pure virtual

Called to retrieve the name of the content node (used in the UI).

返回
The name of the content node.

◆  GetTypeName()

virtual String GetTypeName ( Int32   mode )
virtual

Called to retrieve the type name of the content node.

参数
[in] mode The mode. See SDKBrowserItemType .
返回
The type name.

◆  GetNodeURL()

virtual Int32 GetNodeURL ( SDKBrowserURL url ,
UInt32   flags = 0  
) const
pure virtual

Called to retrieve the URL of the content node (this is the file name if the node represents a file or folder in the file system).
If there are multiple objects in a file (e.g. presets) the return value should reflect the index.

参数
[out] url Assign the URL.
[in] flags The flags.
返回
The index, if there are multiple objects.

◆  GetNodeTime()

virtual Bool GetNodeTime ( UInt32   mode ,
LocalFileTime out  
)
pure virtual

Called to retrieve the creation and last modification time of a node (this will usually be the file times).
For a directory the modification time will usually be the time when a file has been added or removed.

参数
[in] mode The mode: GE_FILETIME
[out] out Assign the time.
返回
true if successful, otherwise false .

◆  GetNodeFlags()

virtual UInt32 GetNodeFlags ( Int64 out_size = nullptr )
pure virtual

Called to retrieve some node flags.

参数
[in] out_size Assign the size of the output.
返回
The node flags. See SDKBrowserNodeFlags .

◆  GetIcon()

virtual SDKBrowserIcon * GetIcon ( Int32   flags = 0 ,
Int32   pref_wh = 0  
)
pure virtual

Called to retrieve the icon for this kind of file.

参数
[in] flags The flags. See SDKBrowserIcon .
[in] pref_wh The preferred width/height of the icon.
返回
The browser icon for the node. The caller owns the returned icon and has to call SDKBrowserIcon::Free() to free it.

◆  UpdateDirectory()

virtual Int32 UpdateDirectory ( void  )
pure virtual

Called before GetDown() is used to search for children (mainly for file system based trees).

返回
Not used.

◆  PrivateCall()

virtual Int32 PrivateCall ( Int32   plugin_id ,
Int32   node_type ,
Int32   selector ,
void *  data  
)
virtual

Hook for private calls. The plugin_id and node_type parameters should be used to validate the call, so that if a call is made to the wrong node it will do nothing.

参数
[in] plugin_id Must be the same as GetPlugin()->GetPluginID() .
[in] node_type Must be the same as GetTypeID() .
[in] selector The private method index.
[in] data The private data.
返回
NOTOK if not successful.

◆  Rename()

virtual Int32 Rename ( Int32   mode ,
const String name  
)
virtual

Called to rename the node.

参数
[in] mode The mode. Either CheckOperation or PerformOperation .
[in] name The new name.
返回
The result. See SDKBrowserOperationResult .

◆  NewFolder()

virtual Int32 NewFolder ( Int32   mode ,
const String name ,
SDKBrowserContentNodeRef folder = nullptr  
)
virtual

Called to create a new folder.

参数
[in] mode The mode. Either CheckOperation or PerformOperation .
[in] name A unique name.
[in] folder The node folder.
返回
The result. See SDKBrowserOperationResult .

◆  MoveFrom()

virtual Int32 MoveFrom ( SDKBrowserContentNodeRef   new_child ,
Int32   mode ,
CopyMoveCallback callback ,
void *  private_data ,
BaseThread thread  
)
virtual

Called to move nodes (the node will be the new parent).

参数
[in] new_child The new child.
[in] mode The mode. See SDKBrowserOperation .
[in] callback The callback, e.g. for progress report. Only called for PrepareOperation and PerformOperation 模式。
[in] private_data Private data for the callback.
[in] thread The thread.
返回
The result. See SDKBrowserOperationResult .

◆  CopyFrom()

virtual Int32 CopyFrom ( SDKBrowserContentNodeRef   new_child ,
Int32   mode ,
const String rename ,
CopyMoveCallback callback ,
void *  private_data ,
BaseThread thread  
)
virtual

Called to copy nodes (the node will be the new parent).

参数
[in] new_child The new child.
[in] mode The mode. See SDKBrowserOperation .
[in] rename Pointer to a string if new_child has to be renamed to avoid a name conflict. Can be nullptr .
[in] callback The callback, e.g. for progress report. Only called for PrepareOperation and PerformOperation 模式。
[in] private_data Private data for the callback.
[in] thread The thread.
返回
The result. See SDKBrowserOperationResult .

◆  Delete()

virtual Int32 删除 ( Int32   mode ,
CopyMoveCallback callback ,
void *  private_data ,
BaseThread thread  
)
virtual

Called to delete the node and its children.

参数
[in] mode The mode. See SDKBrowserOperation .
[in] callback The callback, e.g. for progress report. Only called for PrepareOperation and PerformOperation 模式。
[in] private_data Private data for the callback.
[in] thread The thread.
返回
The result. See SDKBrowserOperationResult .

Friends And Related Function Documentation

◆  SDKBrowserContentNode

friend class SDKBrowserContentNode
friend

◆  SDKNode

friend class SDKNode friend

Member Data Documentation

◆  plugin_id

Int32 plugin_id
private

◆  node

void* node private