using System;
using System.Runtime.InteropServices;
using static Vanara.PInvoke.User32;
namespace Vanara.PInvoke
{
public static partial class Shell32
{
/// Undocumented.
[ComImport, Guid("5efb46d7-47C0-4b68-acda-ded47c90ec91"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), CoClass(typeof(StorageProviderBanners))]
public interface IStorageProviderBanners
{
/// [Undocumented] Sets the banner.
/// The provider identity.
/// The subscription identifier.
/// The content identifier.
/// Returns S_OK if successful, or an error code otherwise.
HRESULT SetBanner([MarshalAs(UnmanagedType.LPWStr)] string providerIdentity,
[MarshalAs(UnmanagedType.LPWStr)] string subscriptionId, [MarshalAs(UnmanagedType.LPWStr)] string contentId);
/// [Undocumented] Clears the banner.
/// The provider identity.
/// The subscription identifier.
/// Returns S_OK if successful, or an error code otherwise.
HRESULT ClearBanner([MarshalAs(UnmanagedType.LPWStr)] string providerIdentity,
[MarshalAs(UnmanagedType.LPWStr)] string subscriptionId);
/// [Undocumented] Clears all banners.
/// The provider identity.
/// Returns S_OK if successful, or an error code otherwise.
HRESULT ClearAllBanners([MarshalAs(UnmanagedType.LPWStr)] string providerIdentity);
/// [Undocumented] Gets the banner.
/// The provider identity.
/// The subscription identifier.
/// The content identifier.
/// Returns S_OK if successful, or an error code otherwise.
HRESULT GetBanner([MarshalAs(UnmanagedType.LPWStr)] string providerIdentity,
[MarshalAs(UnmanagedType.LPWStr)] string subscriptionId, [MarshalAs(UnmanagedType.LPWStr)] out string contentId);
}
///
/// Exposes a method that determines whether the Shell will be allowed to move, copy, delete, or rename a folder in a cloud
/// provider's sync root.
///
// https://docs.microsoft.com/en-us/windows/win32/shell/nn-shobjidl-istorageprovidercopyhook
[PInvokeData("shobjidl.h")]
[ComImport, Guid("7bf992a9-af7a-4dba-b2e5-4d080b1ecbc6"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IStorageProviderCopyHook
{
///
/// Determines whether the Shell will be allowed to move, copy, delete, or rename a folder in a cloud provider's sync root.
///
///
/// A handle to the window that the copy hook handler should use as the parent for any user interface elements the handler may
/// need to display. If FOF_SILENT is specified in operation, the method should ignore this parameter.
///
///
/// The operation to perform. This parameter can be one of the values listed under the member.
///
///
///
/// The flags that control the operation. This parameter can be one or more of the values listed under the the member.
///
/// For printer copy hooks, this value is one of the following values defined in shellapi.h.
///
///
/// Value
/// Description
///
/// -
/// PO_DELETE
/// A printer is being deleted. The srcFile parameter points to the full path to the specified printer.
///
/// -
/// PO_RENAME
///
/// A printer is being renamed. The srcFile parameter points to the printer's new name. The destFile parameter points to the old name.
///
///
/// -
/// PO_PORTCHANGE
/// Not supported. Do not use.
///
/// -
/// PO_REN_PORT
/// Not supported. Do not use.
///
///
///
/// A pointer to a string that contains the name of the source folder.
///
/// [in]
///
///
/// The attributes of the source folder. This parameter can be a combination of any of the file attribute flags
/// (FILE_ATTRIBUTE_*) defined in the header files. See File Attribute Constants.
///
///
///
///
/// [in]
///
/// A pointer to a string that contains the name of the destination folder.
///
///
///
/// [in]
///
///
/// The attributes of the destination folder. This parameter can be a combination of any of the file attribute flags
/// (FILE_ATTRIBUTE_*) defined in the header files. See File Attribute Constants.
///
///
///
///
/// [out]
///
/// The integer value that indicates whether the Shell should perform the operation. One of the following:
///
///
/// Returns S_OK if successful, or an error code otherwise.
///
///
/// The Shell calls the cloud provider's copy hook handler for every folder under the registered sync root. To register a copy
/// hook handler for cloud folders, set the CopyHook value under the
/// HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/CurrentVersion/Explorer/SyncRootManager/{SyncRootId} key to the CLSID
/// of the copy hook object.
///
///
/// When the CopyCallback method is called, the Shell initializes the IStorageProviderCopyHook interface directly without
/// using an IShellExtInit interface first.
///
///
// https://docs.microsoft.com/en-us/windows/win32/shell/nf-shobjidl-istorageprovidercopyhook-copycallback
[PreserveSig]
HRESULT CopyCallback([Optional] HWND hwnd, ShellFileOperation operation, FILEOP_FLAGS flags, [MarshalAs(UnmanagedType.LPWStr)] string srcFile,
FileFlagsAndAttributes srcAttribs, [Optional, MarshalAs(UnmanagedType.LPWStr)] string destFile, FileFlagsAndAttributes destAttribs,
out MB_RESULT result);
}
/// CLSID_StorageProviderBanners
[ComImport, Guid("7CCDF9F4-E576-455A-8BC7-F6EC68D6F063"), ClassInterface(ClassInterfaceType.None)]
public class StorageProviderBanners { }
}
}