SDKBrowserContentNodeInfo Class Referenceabstract

#include <lib_browser.h>

Detailed Description

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 mode, LocalFileTime *out)=0
 
virtual UInt32 GetNodeFlags (Int64 *out_size=0)=0
 
virtual SDKBrowserIconGetIcon (Int32 flags=0, Int32 pref_wh=0)=0
 

Miscellaneous

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=0)
 

Move/Copy/Delete

virtual Int32 MoveFrom (SDKBrowserContentNodeRef new_child, Int32 mode, 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 Delete (Int32 mode, 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

Constructor & Destructor Documentation

◆ SDKBrowserContentNodeInfo()

SDKBrowserContentNodeInfo ( Int32  plugin_id)
explicit

Constructor.

Parameters
[in]plugin_idThe ID of the plugin that has created the node info.

◆ ~SDKBrowserContentNodeInfo()

virtual ~SDKBrowserContentNodeInfo ( )
virtual

A dummy destructor to make the compiler happy.

Member Function Documentation

◆ GetNode()

SDKBrowserContentNodeRef GetNode ( void  ) const

Retrieves the corresponding node.

Returns
The node corresponding to this info.

◆ Init()

virtual Bool Init ( void *  node)
virtual

Called by the browser with pointer to the corresponding node.

Parameters
[in]nodePointer to the node.
Returns
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.

Returns
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.

Parameters
[in]flagsThe flags.
Returns
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).

Returns
The name of the content node.

◆ GetTypeName()

virtual String GetTypeName ( Int32  mode)
virtual

Called to retrieve the type name of the content node.

Parameters
[in]modeThe mode. See SDKBrowserItemType.
Returns
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.

Parameters
[out]urlAssign the URL.
[in]flagsThe flags.
Returns
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.

Parameters
[in]modeThe mode: GE_FILETIME
[out]outAssign the time.
Returns
true if successful, otherwise false.

◆ GetNodeFlags()

virtual UInt32 GetNodeFlags ( Int64 out_size = 0)
pure virtual

Called to retrieve some node flags.

Parameters
[in]out_sizeAssign the size of the output.
Returns
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.

Parameters
[in]flagsThe flags. See SDKBrowserIcon.
[in]pref_whThe preferred width/height of the icon.
Returns
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).

Returns
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.

Parameters
[in]plugin_idMust be the same as GetPlugin()->GetPluginID().
[in]node_typeMust be the same as GetTypeID().
[in]selectorThe private method index.
[in]dataThe private data.
Returns
NOTOK if not successful.

◆ Rename()

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

Called to rename the node.

Parameters
[in]modeThe mode. Either CheckOperation or PerformOperation.
[in]nameThe new name.
Returns
The result. See SDKBrowserOperationResult.

◆ NewFolder()

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

Called to create a new folder.

Parameters
[in]modeThe mode. Either CheckOperation or PerformOperation.
[in]nameA unique name.
[in]folderThe node folder.
Returns
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).

Parameters
[in]new_childThe new child.
[in]modeThe mode. See SDKBrowserOperation.
[in]callbackThe callback, e.g. for progress report. Only called for PrepareOperation and PerformOperation modes.
[in]private_dataPrivate data for the callback.
[in]threadThe thread.
Returns
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).

Parameters
[in]new_childThe new child.
[in]modeThe mode. See SDKBrowserOperation.
[in]renamePointer to a string if new_child has to be renamed to avoid a name conflict. Can be nullptr.
[in]callbackThe callback, e.g. for progress report. Only called for PrepareOperation and PerformOperation modes.
[in]private_dataPrivate data for the callback.
[in]threadThe thread.
Returns
The result. See SDKBrowserOperationResult.

◆ Delete()

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

Called to delete the node and its children.

Parameters
[in]modeThe mode. See SDKBrowserOperation.
[in]callbackThe callback, e.g. for progress report. Only called for PrepareOperation and PerformOperation modes.
[in]private_dataPrivate data for the callback.
[in]threadThe thread.
Returns
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