2023-07-19 08:10:57 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2023 Hans Leidekker for CodeWeavers
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef __WIDL__
|
|
|
|
#pragma winrt ns_prefix
|
|
|
|
#endif
|
|
|
|
|
2022-12-26 23:24:11 +00:00
|
|
|
import "inspectable.idl";
|
|
|
|
import "asyncinfo.idl";
|
|
|
|
import "eventtoken.idl";
|
|
|
|
import "windowscontracts.idl";
|
2023-07-19 08:10:57 +00:00
|
|
|
import "windows.foundation.idl";
|
2023-07-26 06:28:39 +00:00
|
|
|
import "windows.storage.fileproperties.idl";
|
2022-12-26 23:24:11 +00:00
|
|
|
/* import "windows.storage.provider.idl"; */
|
|
|
|
/* import "windows.storage.search.idl"; */
|
|
|
|
import "windows.storage.streams.idl";
|
|
|
|
import "windows.system.idl";
|
2023-07-19 08:10:57 +00:00
|
|
|
|
|
|
|
namespace Windows.Storage {
|
2022-12-26 23:24:11 +00:00
|
|
|
typedef enum FileAccessMode FileAccessMode;
|
2022-12-27 02:35:17 +00:00
|
|
|
typedef enum FileAttributes FileAttributes;
|
2022-12-26 23:24:11 +00:00
|
|
|
typedef enum NameCollisionOption NameCollisionOption;
|
2022-12-27 02:35:17 +00:00
|
|
|
typedef enum StorageDeleteOption StorageDeleteOption;
|
|
|
|
typedef enum StorageItemTypes StorageItemTypes;
|
2022-12-26 23:24:11 +00:00
|
|
|
|
2023-07-19 08:10:57 +00:00
|
|
|
interface IStorageFolder;
|
|
|
|
interface IStorageFolderStatics;
|
2022-12-26 23:24:11 +00:00
|
|
|
interface IStorageFolderStatics2;
|
|
|
|
interface IStorageFileStatics;
|
|
|
|
interface IStorageFileStatics2;
|
|
|
|
interface IStorageItem;
|
2023-07-19 08:10:57 +00:00
|
|
|
|
|
|
|
runtimeclass StorageFolder;
|
2022-12-26 23:24:11 +00:00
|
|
|
runtimeclass StorageFile;
|
|
|
|
runtimeclass StorageStreamTransaction;
|
|
|
|
|
|
|
|
declare {
|
|
|
|
interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Storage.StorageFile *>;
|
|
|
|
interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Storage.StorageStreamTransaction *>;
|
|
|
|
interface Windows.Foundation.IAsyncOperation<Windows.Storage.StorageFile *>;
|
|
|
|
interface Windows.Foundation.IAsyncOperation<Windows.Storage.StorageStreamTransaction *>;
|
|
|
|
}
|
|
|
|
|
|
|
|
[
|
|
|
|
contract(Windows.Foundation.UniversalApiContract, 1.0)
|
|
|
|
]
|
|
|
|
enum FileAccessMode
|
|
|
|
{
|
|
|
|
Read = 0,
|
|
|
|
ReadWrite = 1,
|
|
|
|
};
|
|
|
|
|
2022-12-27 02:35:17 +00:00
|
|
|
[
|
|
|
|
contract(Windows.Foundation.UniversalApiContract, 1.0),
|
|
|
|
flags
|
|
|
|
]
|
|
|
|
enum FileAttributes
|
|
|
|
{
|
|
|
|
Normal = 0x0,
|
|
|
|
ReadOnly = 0x1,
|
|
|
|
Directory = 0x10,
|
|
|
|
Archive = 0x20,
|
|
|
|
Temporary = 0x100,
|
|
|
|
[contract(Windows.Foundation.UniversalApiContract, 1.0)]
|
|
|
|
LocallyIncomplete = 0x200,
|
|
|
|
};
|
|
|
|
|
2022-12-26 23:24:11 +00:00
|
|
|
[
|
|
|
|
contract(Windows.Foundation.UniversalApiContract, 1.0)
|
|
|
|
]
|
|
|
|
enum NameCollisionOption
|
|
|
|
{
|
|
|
|
GenerateUniqueName = 0,
|
|
|
|
ReplaceExisting = 1,
|
|
|
|
FailIfExists = 2,
|
|
|
|
};
|
|
|
|
|
2022-12-27 02:35:17 +00:00
|
|
|
[
|
|
|
|
contract(Windows.Foundation.UniversalApiContract, 1.0)
|
|
|
|
]
|
|
|
|
enum StorageDeleteOption
|
|
|
|
{
|
|
|
|
Default = 0,
|
|
|
|
PermanentDelete = 1,
|
|
|
|
};
|
|
|
|
|
|
|
|
[
|
|
|
|
contract(Windows.Foundation.UniversalApiContract, 1.0),
|
|
|
|
flags
|
|
|
|
]
|
|
|
|
enum StorageItemTypes
|
|
|
|
{
|
|
|
|
None = 0x0,
|
|
|
|
File = 0x1,
|
|
|
|
Folder = 0x2,
|
|
|
|
};
|
|
|
|
|
2022-12-26 23:24:11 +00:00
|
|
|
[
|
|
|
|
contract(Windows.Foundation.UniversalApiContract, 1.0),
|
|
|
|
uuid(fa3f6186-4214-428c-a64c-14c9ac7315ea)
|
|
|
|
]
|
|
|
|
interface IStorageFile : IInspectable
|
|
|
|
requires Windows.Storage.IStorageItem,
|
|
|
|
Windows.Storage.Streams.IRandomAccessStreamReference,
|
|
|
|
Windows.Storage.Streams.IInputStreamReference
|
|
|
|
{
|
|
|
|
[propget] HRESULT FileType([out, retval] HSTRING *value);
|
|
|
|
[propget] HRESULT ContentType([out, retval] HSTRING *value);
|
|
|
|
HRESULT OpenAsync(
|
|
|
|
[in] Windows.Storage.FileAccessMode mode,
|
|
|
|
[out, retval] Windows.Foundation.IAsyncOperation<Windows.Storage.Streams.IRandomAccessStream *> **operation
|
|
|
|
);
|
|
|
|
HRESULT OpenTransactedWriteAsync([out, retval] Windows.Foundation.IAsyncOperation<Windows.Storage.StorageStreamTransaction *> **operation);
|
|
|
|
[overload("CopyAsync")]
|
|
|
|
HRESULT CopyOverloadDefaultNameAndOptions(
|
|
|
|
[in] Windows.Storage.IStorageFolder *folder,
|
|
|
|
[out, retval] Windows.Foundation.IAsyncOperation<Windows.Storage.StorageFile *> **operation
|
|
|
|
);
|
|
|
|
[overload("CopyAsync")]
|
|
|
|
HRESULT CopyOverloadDefaultOptions(
|
|
|
|
[in] Windows.Storage.IStorageFolder *folder,
|
|
|
|
[in] HSTRING name,
|
|
|
|
[out, retval] Windows.Foundation.IAsyncOperation<Windows.Storage.StorageFile *> **operation);
|
|
|
|
[overload("CopyAsync")]
|
|
|
|
HRESULT CopyOverload(
|
|
|
|
[in] Windows.Storage.IStorageFolder *folder,
|
|
|
|
[in] HSTRING name,
|
|
|
|
[in] Windows.Storage.NameCollisionOption option,
|
|
|
|
[out, retval] Windows.Foundation.IAsyncOperation<Windows.Storage.StorageFile *> **operation
|
|
|
|
);
|
|
|
|
HRESULT CopyAndReplaceAsync([in] Windows.Storage.IStorageFile *file, [out, retval] Windows.Foundation.IAsyncAction **operation);
|
|
|
|
[overload("MoveAsync")]
|
|
|
|
HRESULT MoveOverloadDefaultNameAndOptions([in] Windows.Storage.IStorageFolder *folder, [out, retval] Windows.Foundation.IAsyncAction **operation);
|
|
|
|
[overload("MoveAsync")]
|
|
|
|
HRESULT MoveOverloadDefaultOptions(
|
|
|
|
[in] Windows.Storage.IStorageFolder *folder,
|
|
|
|
[in] HSTRING name,
|
|
|
|
[out, retval] Windows.Foundation.IAsyncAction **operation
|
|
|
|
);
|
|
|
|
[overload("MoveAsync")]
|
|
|
|
HRESULT MoveOverload(
|
|
|
|
[in] Windows.Storage.IStorageFolder *folder,
|
|
|
|
[in] HSTRING name,
|
|
|
|
[in] Windows.Storage.NameCollisionOption option,
|
|
|
|
[out, retval] Windows.Foundation.IAsyncAction **operation);
|
|
|
|
HRESULT MoveAndReplaceAsync([in] Windows.Storage.IStorageFile *file, [out, retval] Windows.Foundation.IAsyncAction **operation);
|
|
|
|
}
|
|
|
|
|
2022-12-27 02:35:17 +00:00
|
|
|
[
|
|
|
|
contract(Windows.Foundation.UniversalApiContract, 1.0),
|
|
|
|
uuid(4207a996-ca2f-42f7-bde8-8b10457a7f30)
|
|
|
|
]
|
|
|
|
interface IStorageItem : IInspectable
|
|
|
|
{
|
|
|
|
[overload("RenameAsync")]
|
|
|
|
HRESULT RenameAsyncOverloadDefaultOptions([in] HSTRING name, [out, retval] Windows.Foundation.IAsyncAction **operation);
|
|
|
|
[overload("RenameAsync")]
|
|
|
|
HRESULT RenameAsync([in] HSTRING name, [in] Windows.Storage.NameCollisionOption option, [out, retval] Windows.Foundation.IAsyncAction **operation);
|
|
|
|
[overload("DeleteAsync")]
|
|
|
|
HRESULT DeleteAsyncOverloadDefaultOptions([out, retval] Windows.Foundation.IAsyncAction **operation);
|
|
|
|
[overload("DeleteAsync")]
|
|
|
|
HRESULT DeleteAsync([in] Windows.Storage.StorageDeleteOption option, [out, retval] Windows.Foundation.IAsyncAction **operation);
|
|
|
|
HRESULT GetBasicPropertiesAsync([out, retval] Windows.Foundation.IAsyncOperation<Windows.Storage.FileProperties.BasicProperties *> **operation);
|
|
|
|
[propget] HRESULT Name([out, retval] HSTRING *value);
|
|
|
|
[propget] HRESULT Path([out, retval] HSTRING *value);
|
|
|
|
[propget] HRESULT Attributes([out, retval] Windows.Storage.FileAttributes *value);
|
|
|
|
[propget] HRESULT DateCreated([out, retval] Windows.Foundation.DateTime *value);
|
|
|
|
HRESULT IsOfType([in] Windows.Storage.StorageItemTypes type, [out, retval] boolean *value);
|
|
|
|
}
|
|
|
|
|
2022-12-26 23:24:11 +00:00
|
|
|
[
|
|
|
|
contract(Windows.Foundation.UniversalApiContract, 1.0),
|
|
|
|
exclusiveto(Windows.Storage.StorageStreamTransaction),
|
|
|
|
uuid(f67cf363-a53d-4d94-ae2c-67232d93acdd)
|
|
|
|
]
|
|
|
|
interface IStorageStreamTransaction : IInspectable
|
|
|
|
requires Windows.Foundation.IClosable
|
|
|
|
{
|
|
|
|
[propget] HRESULT Stream([out, retval] Windows.Storage.Streams.IRandomAccessStream **value);
|
|
|
|
HRESULT CommitAsync([out, retval] Windows.Foundation.IAsyncAction **operation);
|
|
|
|
}
|
|
|
|
|
|
|
|
[
|
|
|
|
contract(Windows.Foundation.UniversalApiContract, 1.0),
|
|
|
|
static(Windows.Storage.IStorageFileStatics, Windows.Foundation.UniversalApiContract, 1.0),
|
|
|
|
static(Windows.Storage.IStorageFileStatics2, Windows.Foundation.UniversalApiContract, 10.0)
|
|
|
|
]
|
|
|
|
runtimeclass StorageFile
|
|
|
|
{
|
|
|
|
[default] interface Windows.Storage.IStorageFile;
|
|
|
|
interface Windows.Storage.Streams.IInputStreamReference;
|
|
|
|
interface Windows.Storage.Streams.IRandomAccessStreamReference;
|
|
|
|
interface Windows.Storage.IStorageItem;
|
|
|
|
interface Windows.Storage.IStorageItemProperties;
|
|
|
|
[contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Storage.IStorageItemProperties2;
|
|
|
|
[contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Storage.IStorageItem2;
|
|
|
|
[contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Storage.IStorageItemPropertiesWithProvider;
|
|
|
|
[contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Storage.IStorageFilePropertiesWithAvailability;
|
|
|
|
[contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Storage.IStorageFile2;
|
|
|
|
}
|
2023-07-19 08:10:57 +00:00
|
|
|
|
|
|
|
[
|
|
|
|
contract(Windows.Foundation.UniversalApiContract, 1.0),
|
|
|
|
static(Windows.Storage.IStorageFolderStatics, Windows.Foundation.UniversalApiContract, 1.0)
|
|
|
|
]
|
|
|
|
runtimeclass StorageFolder
|
|
|
|
{
|
|
|
|
[default] interface Windows.Storage.IStorageFolder;
|
|
|
|
}
|
2022-12-26 23:24:11 +00:00
|
|
|
|
|
|
|
[
|
|
|
|
contract(Windows.Foundation.UniversalApiContract, 1.0)
|
|
|
|
]
|
|
|
|
runtimeclass StorageStreamTransaction
|
|
|
|
{
|
|
|
|
[default] interface Windows.Storage.IStorageStreamTransaction;
|
|
|
|
interface Windows.Foundation.IClosable;
|
|
|
|
}
|
2023-07-19 08:10:57 +00:00
|
|
|
}
|