IPropertyStore.cs 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. // -----------------------------------------
  2. // SoundScribe (TM) and related software.
  3. //
  4. // Copyright (C) 2007-2011 Vannatech
  5. // http://www.vannatech.com
  6. // All rights reserved.
  7. //
  8. // This source code is subject to the MIT License.
  9. // http://www.opensource.org/licenses/mit-license.php
  10. //
  11. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  17. // THE SOFTWARE.
  18. // -----------------------------------------
  19. using System;
  20. using System.Runtime.InteropServices;
  21. namespace Vannatech.CoreAudio.Externals
  22. {
  23. /// <summary>
  24. /// Exposes methods for enumerating, getting, and setting property values.
  25. /// </summary>
  26. /// <remarks>
  27. /// MSDN Reference: http://msdn.microsoft.com/en-us/library/bb761474.aspx
  28. /// Note: This item is external to CoreAudio API, and is defined in the Windows Property System API.
  29. /// </remarks>
  30. [Guid("886d8eeb-8cf2-4446-8d02-cdba1dbdcf99")]
  31. [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  32. public interface IPropertyStore
  33. {
  34. /// <summary>
  35. /// Gets the number of properties attached to the file.
  36. /// </summary>
  37. /// <param name="propertyCount">Receives the property count.</param>
  38. /// <returns>An HRESULT code indicating whether the operation passed of failed.</returns>
  39. [PreserveSig]
  40. int GetCount(
  41. [Out] [MarshalAs(UnmanagedType.U4)] out UInt32 propertyCount);
  42. /// <summary>
  43. /// Gets a property key from an item's array of properties.
  44. /// </summary>
  45. /// <param name="propertyIndex">The index of the property key in the array of <see cref="PROPERTYKEY"/> structures.</param>
  46. /// <param name="propertyKey">The unique identifier for a property.</param>
  47. /// <returns>An HRESULT code indicating whether the operation passed of failed.</returns>
  48. [PreserveSig]
  49. int GetAt(
  50. [In] [MarshalAs(UnmanagedType.U4)] UInt32 propertyIndex,
  51. [Out] out PROPERTYKEY propertyKey);
  52. /// <summary>
  53. /// Gets data for a specific property.
  54. /// </summary>
  55. /// <param name="propertyKey">A <see cref="PROPERTYKEY"/> structure containing a unique identifier for the property in question.</param>
  56. /// <param name="value">Receives a <see cref="PROPVARIANT"/> structure that contains the property data.</param>
  57. /// <returns>An HRESULT code indicating whether the operation passed of failed.</returns>
  58. [PreserveSig]
  59. int GetValue(
  60. [In] ref PROPERTYKEY propertyKey,
  61. [Out] out PROPVARIANT value);
  62. /// <summary>
  63. /// Sets a new property value, or replaces or removes an existing value.
  64. /// </summary>
  65. /// <param name="propertyKey">A <see cref="PROPERTYKEY"/> structure containing a unique identifier for the property in question.</param>
  66. /// <param name="value">A <see cref="PROPVARIANT"/> structure that contains the new property data.</param>
  67. /// <returns>An HRESULT code indicating whether the operation passed of failed.</returns>
  68. [PreserveSig]
  69. int SetValue(
  70. [In] ref PROPERTYKEY propertyKey,
  71. [In] ref PROPVARIANT value);
  72. /// <summary>
  73. /// Saves a property change.
  74. /// </summary>
  75. /// <returns>An HRESULT code indicating whether the operation passed of failed.</returns>
  76. [PreserveSig]
  77. int Commit();
  78. }
  79. }