using System;
using System.Runtime.InteropServices;
namespace Vanara.PInvoke
{
public static partial class Shell32
{
///
/// Retrieves a list of valid and invalid characters or the maximum length of a name in the namespace. Use this interface for
/// validation parsing and translation.
///
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nn-shobjidl_core-iitemnamelimits
[ComImport, Guid("1df0d7f1-b267-4d28-8b10-12e23202a5c4"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IItemNameLimits
{
///
/// Loads a string that contains each of the characters that are valid or invalid in the namespace under which it is called.
///
///
/// Type: LPWSTR*
///
/// A pointer to a string that contains all valid characters in the namespace. If the namespace provides any invalid characters
/// in ppwszInvalidChars, then this value returns NULL. See Remarks for more details.
///
///
///
/// Type: LPWSTR*
/// A pointer to a string that contains all invalid characters in the namespace.
///
///
///
/// As an example, the standard file system returns the string "/:*?"<>|" in ppwszInvalidChars and NULL in ppwszValidChars.
///
///
/// Both parameters cannot return non- NULL values, so ppwszValidChars is assigned a value of NULL because of the
/// non- NULL value
///
///
/// in ppwszInvalidChars. It is assumed that when there are specified invalid characters, everything else is valid. Only when
/// ppwszInvalidChars is NULL does ppwszValidChars contain a list of all valid characters.
///
/// If the method returns a success code, the allocated string must be freed using CoTaskMemFree.
///
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-iitemnamelimits-getvalidcharacters HRESULT
// GetValidCharacters( LPWSTR *ppwszValidChars, LPWSTR *ppwszInvalidChars );
void GetValidCharacters([MarshalAs(UnmanagedType.LPWStr)] out string ppwszValidChars, [MarshalAs(UnmanagedType.LPWStr)] out string ppwszInvalidChars);
/// Returns the maximum number of characters allowed for a particular name in the namespace under which it is called.
///
/// Type: LPCWSTR
/// A pointer to a string containing a name.
///
///
/// Type: int*
/// A pointer to the maximum number of characters which can be used in the name.
///
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-iitemnamelimits-getmaxlength HRESULT
// GetMaxLength( LPCWSTR pszName, int *piMaxNameLen );
int GetMaxLength([MarshalAs(UnmanagedType.LPWStr)] string pszName);
}
}
}