/// <summary> /// Call to run a file chooser dialog. Only a single file chooser dialog may be /// pending at any given time. |mode| represents the type of dialog to display. /// |title| to the title to be used for the dialog and may be NULL to show the /// default title ("Open" or "Save" depending on the mode). |default_file_path| /// is the path with optional directory and/or file name component that will be /// initially selected in the dialog. |accept_filters| are used to restrict the /// selectable file types and may any combination of (a) valid lower-cased MIME /// types (e.g. "text/*" or "image/*"), (b) individual file extensions (e.g. /// ".txt" or ".png"), or (c) combined description and file extension delimited /// using "|" and ";" (e.g. "Image Types|.png;.gif;.jpg"). /// |selected_accept_filter| is the 0-based index of the filter that will be /// selected by default. |callback| will be executed after the dialog is /// dismissed or immediately if another dialog is already pending. The dialog /// will be initiated asynchronously on the UI thread. /// </summary> public unsafe virtual void RunFileDialog(CefFileDialogMode mode, string title, string defaultFilePath, CefStringList acceptFilters, bool selectedAcceptFilter, CefRunFileDialogCallback callback) { fixed(char *s1 = title) fixed(char *s2 = defaultFilePath) { var cstr1 = new cef_string_t { Str = s1, Length = title != null ? title.Length : 0 }; var cstr2 = new cef_string_t { Str = s2, Length = defaultFilePath != null ? defaultFilePath.Length : 0 }; NativeInstance->RunFileDialog(mode, &cstr1, &cstr2, acceptFilters.GetNativeInstance(), selectedAcceptFilter ? 1 : 0, (callback != null) ? callback.GetNativeInstance() : null); } GC.KeepAlive(this); }
/// <summary> /// Continue the file selection. |selected_accept_filter| should be the 0-based /// index of the value selected from the accept filters array passed to /// cef_dialog_handler_t::OnFileDialog. |file_paths| should be a single value /// or a list of values depending on the dialog mode. An NULL |file_paths| /// value is treated the same as calling cancel(). /// </summary> public unsafe virtual void Continue(bool selectedAcceptFilter, CefStringList filePaths) { NativeInstance->Continue(selectedAcceptFilter ? 1 : 0, filePaths.GetNativeInstance()); GC.KeepAlive(this); }
/// <summary> /// Returns the names of all existing frames. /// </summary> public unsafe virtual void GetFrameNames(CefStringList names) { NativeInstance->GetFrameNames(names.GetNativeInstance()); GC.KeepAlive(this); }
/// <summary> /// Retrieve the list of all extensions that this context has access to (see /// HasExtension). |extension_ids| will be populated with the list of extension /// ID values. Returns true (1) on success. This function must be called on the /// browser process UI thread. /// </summary> public unsafe virtual bool GetExtensions(CefStringList extensionIds) { return(SafeCall(NativeInstance->GetExtensions(extensionIds.GetNativeInstance()) != 0)); }
/// <summary> /// Retrieve the list of domain components. /// </summary> public unsafe virtual void GetDomainComponents(CefStringList components) { NativeInstance->GetDomainComponents(components.GetNativeInstance()); GC.KeepAlive(this); }
/// <summary> /// Retrieve the list of street addresses. /// </summary> public unsafe virtual void GetStreetAddresses(CefStringList addresses) { NativeInstance->GetStreetAddresses(addresses.GetNativeInstance()); GC.KeepAlive(this); }
/// <summary> /// Retrieve the list of file names that are being dragged into the browser /// window. /// </summary> public unsafe virtual int GetFileNames(CefStringList names) { return(SafeCall(NativeInstance->GetFileNames(names.GetNativeInstance()))); }
/// <summary> /// Set the schemes supported by this manager. If |include_defaults| is true /// (1) the default schemes ("http", "https", "ws" and "wss") will also be /// supported. Calling this function with an NULL |schemes| value and /// |include_defaults| set to false (0) will disable all loading and saving of /// cookies for this manager. If |callback| is non-NULL it will be executed /// asnychronously on the UI thread after the change has been applied. Must be /// called before any cookies are accessed. /// </summary> public unsafe virtual void SetSupportedSchemes(CefStringList schemes, bool includeDefaults, CefCompletionCallback callback) { NativeInstance->SetSupportedSchemes(schemes.GetNativeInstance(), includeDefaults ? 1 : 0, (callback != null) ? callback.GetNativeInstance() : null); GC.KeepAlive(this); }
/// <summary> /// Returns true (1) if suggestions exist, false (0) otherwise. Fills in /// |suggestions| from the spell check service for the misspelled word if there /// is one. /// </summary> public unsafe virtual bool GetDictionarySuggestions(CefStringList suggestions) { return(SafeCall(NativeInstance->GetDictionarySuggestions(suggestions.GetNativeInstance()) != 0)); }
/// <summary> /// Get the remaining command line arguments. /// </summary> public unsafe virtual void GetArguments(CefStringList arguments) { NativeInstance->GetArguments(arguments.GetNativeInstance()); GC.KeepAlive(this); }
/// <summary> /// Reads all keys for this dictionary into the specified vector. /// </summary> public unsafe virtual int GetKeys(CefStringList keys) { return(SafeCall(NativeInstance->GetKeys(keys.GetNativeInstance()))); }