1
0

scriptbrowser.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #ifndef _SCRIPTBROWSER_H
  2. #define _SCRIPTBROWSER_H
  3. #include <api/skin/widgets/mb/minibrowserwnd.h>
  4. #include <api/script/script.h>
  5. #include <api/script/objects/guiobj.h>
  6. class BrowserScriptController : public GuiObjectScriptController {
  7. public:
  8. virtual const wchar_t *getClassName();
  9. virtual const wchar_t *getAncestorClassName();
  10. virtual ScriptObjectController *getAncestorController() { return guiController; }
  11. virtual int getNumFunctions();
  12. virtual const function_descriptor_struct *getExportedFunctions();
  13. virtual GUID getClassGuid();
  14. virtual ScriptObject *instantiate();
  15. virtual void destroy(ScriptObject *o);
  16. virtual void *encapsulate(ScriptObject *o);
  17. virtual void deencapsulate(void *o);
  18. private:
  19. static function_descriptor_struct exportedFunction[];
  20. };
  21. extern BrowserScriptController *browserController;
  22. #define SCRIPTBROWSERWND_PARENT MiniBrowserWnd
  23. class ScriptBrowserWnd : public SCRIPTBROWSERWND_PARENT {
  24. public:
  25. ScriptBrowserWnd();
  26. virtual ~ScriptBrowserWnd();
  27. void setMainMB(int m);
  28. virtual int setXmlParam(const wchar_t *name, const wchar_t *value);
  29. virtual int onInit();
  30. virtual int handleDesktopAlpha() { return 0; } // showing the browser will turn off desktop alpha on the parent layout
  31. virtual void onDocumentComplete(const char *url);
  32. virtual int onBeforeNavigate(const char *url, int flags, const char *frame);
  33. public:
  34. static scriptVar script_vcpu_gotoUrl(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar url);
  35. static scriptVar script_vcpu_back(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  36. static scriptVar script_vcpu_forward(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  37. static scriptVar script_vcpu_home(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  38. static scriptVar script_vcpu_refresh(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  39. static scriptVar script_vcpu_stop(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  40. static scriptVar script_vcpu_setTargetName(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar name);
  41. static scriptVar script_vcpu_onDocumentComplete(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar url);
  42. static scriptVar script_vcpu_onBeforeNavigate(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar url, scriptVar flags, scriptVar framename);
  43. private:
  44. String defurl;
  45. };
  46. #endif