|
| 1 | +/* Copyright (C) 2003-2015 Runtime Revolution Ltd. |
| 2 | + |
| 3 | + This file is part of LiveCode. |
| 4 | + |
| 5 | + LiveCode is free software; you can redistribute it and/or modify it under |
| 6 | + the terms of the GNU General Public License v3 as published by the Free |
| 7 | + Software Foundation. |
| 8 | + |
| 9 | + LiveCode is distributed in the hope that it will be useful, but WITHOUT ANY |
| 10 | + WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 11 | + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 12 | + for more details. |
| 13 | + |
| 14 | + You should have received a copy of the GNU General Public License |
| 15 | + along with LiveCode. If not see <http://www.gnu.org/licenses/>. */ |
| 16 | + |
| 17 | +#ifndef __LIBBROWSER_IOS_H__ |
| 18 | +#define __LIBBROWSER_IOS_H__ |
| 19 | + |
| 20 | +#include "libbrowser_internal.h" |
| 21 | + |
| 22 | +@class MCUIWebViewBrowserDelegate; |
| 23 | + |
| 24 | +class MCUIWebViewBrowser : public MCBrowserBase |
| 25 | +{ |
| 26 | +public: |
| 27 | + MCUIWebViewBrowser(); |
| 28 | + virtual ~MCUIWebViewBrowser(); |
| 29 | + |
| 30 | + bool Init(void); |
| 31 | + |
| 32 | + virtual void *GetNativeLayer(); |
| 33 | + |
| 34 | + virtual bool GetRect(MCBrowserRect &r_rect); |
| 35 | + virtual bool SetRect(const MCBrowserRect &p_rect); |
| 36 | + |
| 37 | + virtual bool GetBoolProperty(MCBrowserProperty p_property, bool &r_value); |
| 38 | + virtual bool SetBoolProperty(MCBrowserProperty p_property, bool p_value); |
| 39 | + |
| 40 | + virtual bool GetStringProperty(MCBrowserProperty p_property, char *&r_utf8_string); |
| 41 | + virtual bool SetStringProperty(MCBrowserProperty p_property, const char *p_utf8_string); |
| 42 | + |
| 43 | + virtual bool GoBack(); |
| 44 | + virtual bool GoForward(); |
| 45 | + virtual bool GoToURL(const char *p_url); |
| 46 | + virtual bool EvaluateJavaScript(const char *p_script, char *&r_result); |
| 47 | + |
| 48 | +protected: |
| 49 | + bool GetUrl(char *& r_url); |
| 50 | + |
| 51 | + bool GetHTMLText(char *&r_htmltext); |
| 52 | + bool SetHTMLText(const char *p_htmltext); |
| 53 | + |
| 54 | + bool GetScrollingEnabled(bool& r_value); |
| 55 | + bool SetScrollingEnabled(bool p_value); |
| 56 | + |
| 57 | + // Browser-specific actions |
| 58 | + bool ExecAdvance(); |
| 59 | + bool ExecRetreat(); |
| 60 | + bool ExecReload(); |
| 61 | + bool ExecStop(); |
| 62 | + bool ExecExecute(const char * p_script); |
| 63 | + bool ExecLoad(const char *p_url, const char *p_html); |
| 64 | + |
| 65 | + UIScrollView *GetScrollView(void); |
| 66 | + |
| 67 | +private: |
| 68 | + bool GetView(UIWebView *&r_view); |
| 69 | + |
| 70 | + UIWebView *m_view; |
| 71 | + MCUIWebViewBrowserDelegate *m_delegate; |
| 72 | +}; |
| 73 | + |
| 74 | +////////// |
| 75 | + |
| 76 | +bool MCUIWebViewBrowserFactoryCreate(MCBrowserFactoryRef &r_factory); |
| 77 | + |
| 78 | +#endif // __LIBBROWSER_IOS_H__ |
0 commit comments