ibrowser.h

Go to the documentation of this file.
00001 /*  
00002  *  IBrowser.h - Browser Manager public interface
00003  *
00004  *      contains public interface defintions for the global manager 
00005  *      and individual browsers
00006  *
00007  *          Copyright � Autodesk, Inc, 2000.  John Wainwright.
00008  *
00009  */
00010 
00011 #pragma once
00012 
00013 #include "iFnPub.h"
00014 #include "GetCOREInterface.h"
00015 
00016 #ifdef BLD_BROWSER
00017 #   define BrowserExport __declspec( dllexport )
00018 #else
00019 #   define BrowserExport __declspec( dllimport )
00020 #endif
00021 
00022 class IBrowserMgr; 
00023 class IBrowser;
00024 
00025 // Core interface to the new MAX browser manager
00026 
00027 // Browser Manager interface ID
00028 #define BROWSER_MGR_INTERFACE   Interface_ID(0x65342378, 0x4c540d3b)
00029 inline IBrowserMgr* GetBrowserMgr() { return (IBrowserMgr*)GetCOREInterface(BROWSER_MGR_INTERFACE); }
00030 
00031 // class IBrowserMgr
00032 // manager public Core interface 
00033 class IBrowserMgr : public FPStaticInterface 
00034 {
00035 public:
00036     // new browser windows
00037     virtual IBrowser*   NewBrowser(MCHAR* rootURL, 
00038                             BOOL showDirectory=TRUE, BOOL showContent=TRUE,
00039                             BOOL showToolbar=TRUE, BOOL showMenu=TRUE, 
00040                             HWND parentWindow=NULL)=0;
00041     // iterate browsers
00042     virtual int         NumBrowsers()=0;
00043     virtual IBrowser*   GetBrowser(int i)=0;
00044 
00045     // interface function IDs 
00046     enum { 
00047         newBrowser, 
00048         numBrowsers, 
00049         getBrowser, 
00050     }; 
00051 
00052 }; 
00053 
00054 // Browser interface ID
00055 #define BROWSER_INTERFACE_DESC   Interface_ID(0x74a22be8, 0x18e117c9)
00056 inline FPInterfaceDesc* GetBrowserInterfaceDesc() { return (FPInterfaceDesc*)GetCOREInterface(BROWSER_INTERFACE_DESC); }
00057 
00058 // class IBrowser
00059 // individiual browser interface 
00060 class IBrowser : public FPMixinInterface
00061 {
00062 public:
00063     // browser control
00064 #ifdef USE_CUSTOM_MATNAV
00065     virtual void    Init()=0;
00066 #endif
00067     virtual void    Close()=0;
00068     virtual void    ShowDirectory(BOOL onOff)=0;
00069     virtual void    ShowContent(BOOL onOff)=0;
00070     virtual void    ShowMenu(BOOL onOff)=0;
00071     virtual void    ShowToolbar(BOOL onOff)=0;
00072 
00073     // navigation 
00074     virtual BOOL    SetRootURL(MCHAR* rootURL)=0;
00075     virtual BOOL    BrowseTo(MCHAR* browseURL)=0;
00076 
00077     // interface function IDs 
00078     enum { 
00079 #ifdef USE_CUSTOM_MATNAV    // russom - 10/18/01
00080         init,
00081 #endif
00082         close, 
00083         showDirectory, 
00084         showContent, 
00085         showMenu, 
00086         showToolbar, 
00087         setRootURL, 
00088         browseTo, 
00089     }; 
00090 
00091     // dispatch map
00092     BEGIN_FUNCTION_MAP
00093 #ifdef USE_CUSTOM_MATNAV
00094         VFN_0(init,         Init); 
00095 #endif
00096         VFN_0(close,        Close); 
00097         VFN_1(showDirectory,ShowDirectory,  TYPE_BOOL); 
00098         VFN_1(showContent,  ShowContent,    TYPE_BOOL); 
00099         VFN_1(showMenu,     ShowMenu,       TYPE_BOOL); 
00100         VFN_1(showToolbar,  ShowToolbar,    TYPE_BOOL); 
00101         FN_1(setRootURL,    TYPE_BOOL, SetRootURL, TYPE_STRING); 
00102         FN_1(browseTo,      TYPE_BOOL, BrowseTo,   TYPE_STRING); 
00103     END_FUNCTION_MAP 
00104 
00105     FPInterfaceDesc*    GetDesc() { return GetBrowserInterfaceDesc(); }
00106 
00107 };
00108 
00109 
00110