SDKBrowserPluginInterfaceInfo Class Referenceabstract

#include <lib_browser.h>

Detailed Description

Interface for browser plugins.

Public Member Functions

 SDKBrowserPluginInterfaceInfo ()
 
SDKBrowserPluginRef GetPlugin (void) const
 

Private Attributes

SDKBrowserPluginRef plugin
 

Friends

class SDKBrowser
 

SDKBrowserTab

enum  {
  PreviewTab,
  InfoTab,
  PrivateTab0,
  PrivateTab1,
  PrivateTab2,
  PrivateTab3,
  PrivateTab4,
  PrivateTab5,
  PrivateTab6,
  PrivateTab7
}
 

SDKBrowserItemType

enum  {
  BasicItemType,
  SpecificItemType,
  HierarchicalItemType
}
 

SDKBrowserIdentification

enum  { SlowIdentification }
 

SDKBrowserOpen

enum  { Merge }
 

Plugin ID

virtual Int32 GetPluginID (String *plugin_name=0)=0
 

Identify

virtual Bool Identify (const SDKBrowserURL &url, UChar *probe, Int32 size, UInt32 flags)=0
 

Types

virtual String GetTypeName (const SDKBrowserContentNodeRef node, const SDKBrowserURL *url, Int32 mode)=0
 
virtual void GetTypeNames (Int32 mode, maxon::BaseArray< String > &strings)=0
 

Preview Bitmap

virtual SDKBrowserPreviewDataOpenPreviewBitmap (BaseThread *thread, const SDKBrowserContentNodeRef node, const SDKBrowserURL *url, SDKBrowserPreviewInfo *info)=0
 
virtual void ClosePreviewBitmap (SDKBrowserPreviewData *data)=0
 
virtual BaseBitmapGetPreviewBitmap (SDKBrowserPreviewData *data, Int32 w, Int32 h, Int32 quality)=0
 

Preview Dialog

virtual SubDialogOpenPreviewDialog (SDKBrowserContentNodeRef node, Int32 tab_id)=0
 
virtual Int32 ClosePreviewDialog (SDKBrowserContentNodeRef node, SubDialog *s)=0
 
virtual Int32 UpdatePreviewDialog (SDKBrowserContentNodeRef node, SubDialog *s)=0
 

Open

virtual Bool Open (SDKBrowserContentNodeRef node, const SDKBrowserURL *url, Int32 flags)=0
 

Icon

virtual SDKBrowserIconGetIcon (const SDKBrowserURL &url, Int32 pref_wh=0)=0
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
PreviewTab 

Preview tab.

InfoTab 

Info tab.

PrivateTab0 

Plugin specific tab 0.

PrivateTab1 

Plugin specific tab 1.

PrivateTab2 

Plugin specific tab 2.

PrivateTab3 

Plugin specific tab 3.

PrivateTab4 

Plugin specific tab 4.

PrivateTab5 

Plugin specific tab 5.

PrivateTab6 

Plugin specific tab 6.

PrivateTab7 

Plugin specific tab 7.

◆ anonymous enum

anonymous enum
Enumerator
BasicItemType 

The basic item type (i.e. image, or sound file); this string is language dependent.

SpecificItemType 

More specific item type, like "JPEG image file"; this string is language dependent.

HierarchicalItemType 

Hierarchical item type.

◆ anonymous enum

anonymous enum
Enumerator
SlowIdentification 

You are allowed to try the best possible identification, even if it is slow.

◆ anonymous enum

anonymous enum
Enumerator
Merge 

Merge nodes.

Constructor & Destructor Documentation

◆ SDKBrowserPluginInterfaceInfo()

Member Function Documentation

◆ GetPlugin()

SDKBrowserPluginRef GetPlugin ( void  ) const

Retrieves the corresponding plugin.

Returns
The browser plugin reference.

◆ GetPluginID()

virtual Int32 GetPluginID ( String plugin_name = 0)
pure virtual

Called to retrieve the ID and name of the plugin.

Parameters
[in]plugin_nameAssigned the name of the plugin, unless the pointer is nullptr.
Returns
A unique plugin ID. Must be obtained from http://www.plugincafe.com

◆ Identify()

virtual Bool Identify ( const SDKBrowserURL url,
UChar probe,
Int32  size,
UInt32  flags 
)
pure virtual

Called to identify a file.

Parameters
[in]urlThe file URL.
[in]probeThe start of a small chunk of data from the start of the file for testing this file type. Usually the probe size is 1024 bytes.
[in]sizeThe probe size.
[in]flagsThe identification flags. See SDKBrowserIdentification above.
Returns
true if the plugin can handle the file, otherwise false.

◆ GetTypeName()

virtual String GetTypeName ( const SDKBrowserContentNodeRef  node,
const SDKBrowserURL url,
Int32  mode 
)
pure virtual

Called to retrieve the kind of data that is handled by the plugin. For example "Image", "Scene", "Material" etc.

Parameters
[in]nodeA browser node. Can be nullptr.
[in]urlA URL. Can be nullptr.
[in]modeThe mode. See SDKBrowserItemType above.
Returns
A string describing the data, according to mode.

◆ GetTypeNames()

virtual void GetTypeNames ( Int32  mode,
maxon::BaseArray< String > &  strings 
)
pure virtual

Called to retrieve the descriptions for all kinds of data that will be handled by the plugin.

Parameters
[in]modeThe mode. See SDKBrowserItemType above.
[out]stringsStrings to fill.

◆ OpenPreviewBitmap()

virtual SDKBrowserPreviewData* OpenPreviewBitmap ( BaseThread thread,
const SDKBrowserContentNodeRef  node,
const SDKBrowserURL url,
SDKBrowserPreviewInfo info 
)
pure virtual

Called to open a preview bitmap.

Parameters
[in]threadThe current thread.
[in]nodeA node.
[in]urlA URL.
[in]infoThe preview information.
Returns
The preview handle.

◆ ClosePreviewBitmap()

virtual void ClosePreviewBitmap ( SDKBrowserPreviewData data)
pure virtual

Called to close the preview bitmap in data.

Parameters
[in]dataA preview handle.

◆ GetPreviewBitmap()

virtual BaseBitmap* GetPreviewBitmap ( SDKBrowserPreviewData data,
Int32  w,
Int32  h,
Int32  quality 
)
pure virtual

Called to retrieve the preview bitmap from a handle.

Parameters
[in]dataThe preview handle.
[in]wThe width in pixels.
[in]hThe height in pixels.
[in]qualityThe quality. See SDKBrowserPreviewQuality above.
Returns
The preview bitmap. The caller owns the returned bitmap and has to call BaseBitmap::Free() to free it.

◆ OpenPreviewDialog()

virtual SubDialog* OpenPreviewDialog ( SDKBrowserContentNodeRef  node,
Int32  tab_id 
)
pure virtual

Called to retrieve a plugin specific preview sub-dialog for the content node preview.

Parameters
[in]nodeA node.
[in]tab_idThe tab ID. See SDKBrowserTab above.
Returns
The plugin preview sub-dialog. Inherit this from SDKBrowserPreviewDialog.

◆ ClosePreviewDialog()

virtual Int32 ClosePreviewDialog ( SDKBrowserContentNodeRef  node,
SubDialog s 
)
pure virtual

Called when the preview sub-dialog is not used anymore.

Parameters
[in]nodeA node.
[in]sThe sub-dialog to close.
Returns
The active tab ID. Used to open the next preview dialog in the same tab.

◆ UpdatePreviewDialog()

virtual Int32 UpdatePreviewDialog ( SDKBrowserContentNodeRef  node,
SubDialog s 
)
pure virtual

Called to update the current preview sub-dialog.

Parameters
[in]nodeA node.
[in]sThe sub-dialog to update.
Returns
The active tab ID. Used to open the next preview dialog in the same tab.

◆ Open()

virtual Bool Open ( SDKBrowserContentNodeRef  node,
const SDKBrowserURL url,
Int32  flags 
)
pure virtual

Called to open a content node.

Parameters
[in]nodeA node.
[in]urlA URL.
[in]flagsThe flags. See SDKBrowserOpen above.
Returns
true if successful, otherwise false.

◆ GetIcon()

virtual SDKBrowserIcon* GetIcon ( const SDKBrowserURL url,
Int32  pref_wh = 0 
)
pure virtual

Called to retrieve an icon for a kind of file (does not have to be a preview for this specific file).

Parameters
[in]urlA URL.
[in]pref_whThe preferred width/height of the icon.
Returns
The browser icon for url. The caller owns the returned icon and has to call SDKBrowserIcon::Free() to free it.

Friends And Related Function Documentation

◆ SDKBrowser

friend class SDKBrowser
friend

Member Data Documentation

◆ plugin

SDKBrowserPluginRef plugin
private