Ejemplo n.º 1
0
        public void LoadURL(string url,
                            string frameName = "",
                            string username = "",
                            string password = "")
        {
            StringHelper urlStr = new StringHelper(url);
            StringHelper frameNameStr = new StringHelper(frameName);
            StringHelper usernameStr = new StringHelper(username);
            StringHelper passwordStr = new StringHelper(password);

            awe_webview_load_url(instance, urlStr.value(), frameNameStr.value(), usernameStr.value(), passwordStr.value());
        }
Ejemplo n.º 2
0
        public static void SetCustomResponsePage(int statusCode, string filePath)
        {
            StringHelper filePathStr = new StringHelper(filePath);

            awe_webcore_set_custom_response_page(statusCode, filePathStr.value());
        }
Ejemplo n.º 3
0
        public static String GetCookies(string url, bool excludeHttpOnly = true)
        {
            StringHelper urlStr = new StringHelper(url);

            IntPtr temp = awe_webcore_get_cookies(urlStr.value(), excludeHttpOnly);

            return StringHelper.ConvertAweString(temp);
        }
Ejemplo n.º 4
0
        public bool SaveToPNG(string filePath,
                            bool preserveTransparency = false)
        {
            StringHelper filePathStr = new StringHelper(filePath);

            bool temp = awe_renderbuffer_save_to_png(renderbuffer, filePathStr.value(), preserveTransparency);

            return temp;
        }
Ejemplo n.º 5
0
        public static void Initialize(WebCore.Config config)
        {
            StringHelper userDataPathStr = new StringHelper(config.userDataPath);
            StringHelper pluginPathStr = new StringHelper(config.pluginPath);
            StringHelper logPathStr = new StringHelper(config.logPath);
            StringHelper userAgentOverrideStr = new StringHelper(config.userAgentOverride);
            StringHelper proxyServerStr = new StringHelper(config.proxyServer);
            StringHelper proxyConfigScriptStr = new StringHelper(config.proxyConfigScript);
            StringHelper customCSSStr = new StringHelper(config.customCSS);

            awe_webcore_initialize(config.enablePlugins,
                                     config.enableJavascript,
                                     userDataPathStr.value(),
                                     pluginPathStr.value(),
                                     logPathStr.value(),
                                     config.logLevel,
                                     userAgentOverrideStr.value(),
                                     proxyServerStr.value(),
                                     proxyConfigScriptStr.value(),
                                     config.saveCacheAndCookies,
                                     config.maxCacheSize,
                                     config.disableSameOriginPolicy,
                                     customCSSStr.value());

            activeWebViews = new List<Object>();
        }
Ejemplo n.º 6
0
        public bool HasProperty(string propertyName)
        {
            StringHelper propertyNameStr = new StringHelper(propertyName);

            return awe_jsobject_has_property(instance, propertyNameStr.value());
        }
Ejemplo n.º 7
0
        public void SetPropery(string propertyName,
                               JSValue value)
        {
            StringHelper propertyNameStr = new StringHelper(propertyName);

            awe_jsobject_set_property(instance, propertyNameStr.value(), value.getInstance());
        }
Ejemplo n.º 8
0
        public void CreateObject(string objectName)
        {
            StringHelper objectNameStr = new StringHelper(objectName);

            awe_webview_create_object(instance, objectNameStr.value());
        }
Ejemplo n.º 9
0
        public void DestroyObject(string objectName)
        {
            StringHelper objectNameStr = new StringHelper(objectName);

            awe_webview_destroy_object(instance, objectNameStr.value());
        }
Ejemplo n.º 10
0
        public JSValue ExecuteJavascriptWithResult(string javascript,
                                                  string frameName = "",
                                                  int timeoutMs = 0)
        {
            StringHelper javascriptStr = new StringHelper(javascript);
            StringHelper frameNameStr = new StringHelper(frameName);

            IntPtr temp = awe_webview_execute_javascript_with_result(instance, javascriptStr.value(), frameNameStr.value(), timeoutMs);

            JSValue result = new JSValue(temp);
            result.ownsInstance = true;

            return result;
        }
Ejemplo n.º 11
0
        public void CallJavascriptFunction(string objectName,
                                           string function,
                                           params JSValue[] arguments)
        {
            IntPtr jsarray = JSArrayHelper.createArray(arguments);

            StringHelper objectNameStr = new StringHelper(objectName);
            StringHelper functionStr = new StringHelper(function);
            StringHelper frameNameStr = new StringHelper("");

            awe_webview_call_javascript_function(instance, objectNameStr.value(), functionStr.value(), jsarray, frameNameStr.value());

            JSArrayHelper.destroyArray(jsarray);
        }
Ejemplo n.º 12
0
        public void ExecuteJavascript(string javascript,
                                      string frameName = "")
        {
            StringHelper javascriptStr = new StringHelper(javascript);
            StringHelper frameNameStr = new StringHelper(frameName);

            awe_webview_execute_javascript(instance, javascriptStr.value(), frameNameStr.value());
        }
Ejemplo n.º 13
0
        public void LoadFile(string file,
                             string frameName = "")
        {
            StringHelper fileStr = new StringHelper(file);
            StringHelper frameNameStr = new StringHelper(frameName);

            awe_webview_load_file(instance, fileStr.value(), frameNameStr.value());
        }
Ejemplo n.º 14
0
        public void LoadHTML(string html,
                             string frameName = "")
        {
            StringHelper htmlStr = new StringHelper(html);
            StringHelper frameNameStr = new StringHelper(frameName);

            awe_webview_load_html(instance, htmlStr.value(), frameNameStr.value());
        }
Ejemplo n.º 15
0
        public void ChooseFile(string filePath)
        {
            StringHelper filePathStr = new StringHelper(filePath);

            awe_webview_choose_file(instance, filePathStr.value());
        }
Ejemplo n.º 16
0
        public void SetObjectProperty(string objectName,
                                      string propertyName,
                                      JSValue val)
        {
            StringHelper objectNameStr = new StringHelper(objectName);
            StringHelper propertyNameStr = new StringHelper(propertyName);

            awe_webview_set_object_property(instance, objectNameStr.value(), propertyNameStr.value(), val.getInstance());
        }
Ejemplo n.º 17
0
        public void RequestScrollData(string frameName = "")
        {
            StringHelper frameNameStr = new StringHelper(frameName);

            awe_webview_request_scroll_data(instance, frameNameStr.value());
        }
Ejemplo n.º 18
0
        public void SetObjectCallback(string objectName,
                                      string callbackName)
        {
            StringHelper objectNameStr = new StringHelper(objectName);
            StringHelper callbackNameStr = new StringHelper(callbackName);

            awe_webview_set_object_callback(instance, objectNameStr.value(), callbackNameStr.value());
        }
Ejemplo n.º 19
0
        public JSValue GetProperty(string propertyName)
        {
            StringHelper propertyNameStr = new StringHelper(propertyName);

            return new JSValue(awe_jsobject_get_property(instance, propertyNameStr.value()));
        }
Ejemplo n.º 20
0
        public void AddURLFilter(string filter)
        {
            StringHelper filterStr = new StringHelper(filter);

            awe_webview_add_url_filter(instance, filterStr.value());
        }
Ejemplo n.º 21
0
        public JSValue(string value)
        {
            StringHelper valueStr = new StringHelper(value);

            instance = awe_jsvalue_create_string_value(valueStr.value());
        }
Ejemplo n.º 22
0
        public void SetHeaderDefinition(string name,
                                        uint numFields,
                                        string fieldNames,
                                        string fieldValues)
        {
            StringHelper nameStr = new StringHelper(name);
            StringHelper fieldNamesStr = new StringHelper(fieldNames);
            StringHelper fieldValuesStr = new StringHelper(fieldValues);

            awe_webview_set_header_definition(instance, nameStr.value(), numFields, fieldNamesStr.value(), fieldValuesStr.value());
        }
Ejemplo n.º 23
0
        public bool SaveToJPEG(string filePath,
                              int quality = 90)
        {
            StringHelper filePathStr = new StringHelper(filePath);

            bool temp = awe_renderbuffer_save_to_jpeg(renderbuffer, filePathStr.value(), quality);

            return temp;
        }
Ejemplo n.º 24
0
        public void AddHeaderRewriteRule(string rule, string name)
        {
            StringHelper ruleStr = new StringHelper(rule);
            StringHelper nameStr = new StringHelper(name);

            awe_webview_add_header_rewrite_rule(instance, ruleStr.value(), nameStr.value());
        }
Ejemplo n.º 25
0
        public static void SetBaseDirectory(string baseDirPath)
        {
            StringHelper baseDirPathStr = new StringHelper(baseDirPath);

            awe_webcore_set_base_directory(baseDirPathStr.value());
        }
Ejemplo n.º 26
0
        public void RemoveHeaderRewriteRule(string rule)
        {
            StringHelper ruleStr = new StringHelper(rule);

            awe_webview_remove_header_rewrite_rule(instance, ruleStr.value());
        }
Ejemplo n.º 27
0
        public static void SetCookie(string url,
                                    string cookieString,
                                    bool isHttpOnly = false,
                                    bool forceSessionCookie = false)
        {
            StringHelper urlStr = new StringHelper(url);
            StringHelper cookieStringStr = new StringHelper(cookieString);

            awe_webcore_set_cookie(urlStr.value(), cookieStringStr.value(), isHttpOnly, forceSessionCookie);
        }
Ejemplo n.º 28
0
        public void RemoveHeaderRewriteRulesByDefinition(string name)
        {
            StringHelper nameStr = new StringHelper(name);

            awe_webview_remove_header_rewrite_rules_by_definition_name(instance, nameStr.value());
        }
Ejemplo n.º 29
0
        public static void DeleteCookie(string url, string cookieName)
        {
            StringHelper urlStr = new StringHelper(url);
            StringHelper cookieNameStr = new StringHelper(cookieName);

            awe_webcore_delete_cookie(urlStr.value(), cookieNameStr.value());
        }
Ejemplo n.º 30
0
        public ResourceResponse(string filePath)
        {
            StringHelper filePathStr = new StringHelper(filePath);

            instance = awe_resource_response_create_from_file(filePathStr.value());
        }