Files
cefsharp/CefSharp/ICookieManager.cs
T
Alex Maitland 8a367fbdc4 Refactor CefSharp.Core into CefSharp.Core.Runtime (#3311)
* Net Core - Rename CefSharp.Core.dll to CefSharp.Core.Runtime.dll

Partial rename, only Net Core, folder not renamed

* Net Core - Rename CefSharp.Core.RefAssembly to CefSharp.Core.netcore

Remove GenApi

* Core - Rename CefDragDataWrapper to DragData

Move into CefSharp.Core namespace

* WinForms/WPF/OffScreen - Migrate from GitLink command line to Nuget package

* Net Core - Refactor to have CefSharp.Core.dll contain only public Api

* Net Core - Remove CefSharp.Core.RefAssembly

* Net Core - Change CefSharp.Core.netcore output folder

* Net Core - Restructure nuget packages

* Net Core - Add Cefsharp.Core.Runtime.RefAssembly

* Net Core - Hide CLI/C++ classes from intellisense

Make sure users don't attempt to load them directly

* Rename CefSharp.Core to CefSharp.Core.Runtime

* Core - Restructure Net 4.5.2 packages to use CefSharp.Core.dll anycpu variant

Attempt to load CefSharp.Core.Runtime at runtime rather than having to use msbuild to copy the correct version

* Rename CefSharp.Core.netcore to CefSharp.Core

* WPF/WinForms/OffScreen - Change from x86/64 to AnyCPU

As they are all managed assemblies they can target AnyCPU.
Includes CefSharp.dll

* Convert RequestContextBuilder from C++ to C#

Now part of the CefSharp.Core PublicApi

* Update version number to 87.1.11

* Migrate more of the public Api to C#

* Net Core - Basic restructure complete

* Net Core - ModuleInitializer (Doesn't work yet)

* Remove direct references to BrowserSettings

* Net Core - ModuleInitializer load CefShar.Core.Runtime.dl

* Net Core - Load libcef.dll via CLR Module initializer

If no RID is specified then we can load libcef.dll using the module initializer

* Add version to CefSharp.Core

* Remove dependency on CefSharp.Core.Runtime
Rewrite common targets

* AnyCPU app.config transform

Improve AnyCPU support

* Improve Net Core 3 support
Only delete CefSharp.Core.Runtime.dll when AnyCPU

* Nuget - Add CefSharp.Core.Runtime reference when TargetFramework = NetCore

* Fix Typos

Based on #3306

* Net Core - Rename CefSharp.Core.Runtime RefAssembly source file

* Net Full - Generate CefSharp.Core.Runtime Ref Assembly

For now the powershell build script generates the .cs file based on a x86 release build.ps1
It's not possible to directly install GenApi as it requires a Sdk style project

* Net Core - Old packages copy files to required folders

* Test - Install newer .Net Compiler and set Lang Version to 7.3

* Net Core - Exclude Net 452 Runtime generated reference source

* Core - Add Refactoring TODO

* Ref Assembly - Generate source as part of build

- Move ref assembly source generate into GenerateRefAssemblySource.ps1
- Call before project build

Runs locally, see if Appveyor has a problem with the powershell script execution

* Core - Add more factory methods to create instances of managed wrappers

* Net Core - Make Initialzier properties internal

Not quite sure what the public API should look like as yet, so making internal for now.
2020-12-16 10:47:34 +10:00

82 lines
5.3 KiB
C#

// Copyright © 2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using System;
namespace CefSharp
{
/// <summary>
/// Used for managing cookies. The methods may be called on any thread unless otherwise indicated.
/// </summary>
public interface ICookieManager : IDisposable
{
/// <summary>
/// Delete all cookies that match the specified parameters.
/// If both <paramref name="url"/> and <paramref name="name"/> values are specified all host and domain cookies matching both will be deleted.
/// If only <paramref name="url"/> is specified all host cookies (but not domain cookies) irrespective of path will be deleted.
/// If <paramref name="url"/> is empty all cookies for all hosts and domains will be deleted.
/// Cookies can alternately be deleted using the Visit*Cookies() methods.
/// </summary>
/// <param name="url">The cookie URL.</param>
/// <param name="name">The name of the cookie.</param>
/// <param name="callback">If non-NULL it will be executed asynchronously on the CEF UI thread after the cookies have been deleted.</param>
/// <returns>Returns false if a non-empty invalid URL is specified or if cookies cannot be accessed; otherwise, true.</returns>
bool DeleteCookies(string url = null, string name = null, IDeleteCookiesCallback callback = null);
/// <summary>
/// Sets a cookie given a valid URL and explicit user-provided cookie attributes. This function expects each attribute to be well-formed. It will check for disallowed
/// characters (e.g. the ';' character is disallowed within the cookie value attribute) and fail without setting the cookie if such characters are found.
/// This method will be executed on the CEF UI thread in an async fashion, to be notified upon completion implement <see cref="ISetCookieCallback"/>
/// and pass in as <paramref name="callback"/>
/// </summary>
/// <param name="url">The cookie URL</param>
/// <param name="cookie">The cookie</param>
/// <param name="callback">If non-NULL it will be executed asynchronously on the CEF UI thread after the cookie has been set.</param>
/// <returns>Returns false if an invalid URL is specified or if cookies cannot be accessed.</returns>
bool SetCookie(string url, Cookie cookie, ISetCookieCallback callback = null);
/// <summary>
/// Set the schemes supported by this manager. Calling this method with an empty <paramref name="schemes"/> value and <paramref name="includeDefaults"/>
/// set to false will disable all loading and saving of cookies for this manager. Must be called before any cookies are accessed.
/// </summary>
/// <param name="schemes">The list of supported schemes.</param>
/// <param name="includeDefaults">If true the default schemes ("http", "https", "ws" and "wss") will also be supported. Calling this method with an empty schemes value and includeDefaults
/// set to false will disable all loading and saving of cookies for this manager</param>
/// <param name="callback">If non-NULL it will be executed asynchronously on the CEF UI thread after the change has been applied.</param>
void SetSupportedSchemes(string[] schemes, bool includeDefaults, ICompletionCallback callback = null);
/// <summary>
/// Visit all cookies on the UI thread. The returned cookies are ordered by longest path, then by earliest creation date.
/// </summary>
/// <param name="visitor">A user-provided Cookie Visitor implementation.</param>
/// <returns>Returns false if cookies cannot be accessed; otherwise, true.</returns>
bool VisitAllCookies(ICookieVisitor visitor);
/// <summary>
/// Visit a subset of cookies on the CEF UI thread.
/// The results are filtered by the given url scheme, host, domain and path.
/// The returned cookies are ordered by longest path, then by earliest creation date.
/// </summary>
/// <param name="url">The URL to use for filtering a subset of the cookies available.</param>
/// <param name="includeHttpOnly">If true HTTP-only cookies will also be included in the results.</param>
/// <param name="visitor">A user-provided Cookie Visitor implementation.</param>
/// <returns>Returns false if cookies cannot be accessed; otherwise, true.</returns>
bool VisitUrlCookies(string url, bool includeHttpOnly, ICookieVisitor visitor);
/// <summary>
/// Flush the backing store (if any) to disk
/// This method will be executed on the CEF UI thread in an async fashion, to be notified upon completion implement <see cref="ICompletionCallback"/>
/// and pass in as <paramref name="callback"/>
/// </summary>
/// <param name="callback">If non-NULL it will be executed asynchronously on the CEF UI thread after the flush is complete.</param>
/// <returns>Returns false if cookies cannot be accessed.</returns>
bool FlushStore(ICompletionCallback callback);
/// <summary>
/// Returns true if disposed
/// </summary>
bool IsDisposed { get; }
}
}