ISourceControlUtilities.h 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. /*******************************************************************************
  2. The content of this file includes portions of the AUDIOKINETIC Wwise Technology
  3. released in source code form as part of the SDK installer package.
  4. Commercial License Usage
  5. Licensees holding valid commercial licenses to the AUDIOKINETIC Wwise Technology
  6. may use this file in accordance with the end user license agreement provided
  7. with the software or, alternatively, in accordance with the terms contained in a
  8. written agreement between you and Audiokinetic Inc.
  9. Apache License Usage
  10. Alternatively, this file may be used under the Apache License, Version 2.0 (the
  11. "Apache License"); you may not use this file except in compliance with the
  12. Apache License. You may obtain a copy of the Apache License at
  13. http://www.apache.org/licenses/LICENSE-2.0.
  14. Unless required by applicable law or agreed to in writing, software distributed
  15. under the Apache License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
  16. OR CONDITIONS OF ANY KIND, either express or implied. See the Apache License for
  17. the specific language governing permissions and limitations under the License.
  18. Copyright (c) 2023 Audiokinetic Inc.
  19. *******************************************************************************/
  20. /// \file
  21. /// Wwise source control plug-in utilities interface, used to create custom dialogs, display the progress dialog, and get
  22. /// the registry path needed to save the plug-in configuration.
  23. #ifndef _AK_WWISE_ISOURCECONTROLUTILITIES_H
  24. #define _AK_WWISE_ISOURCECONTROLUTILITIES_H
  25. #include <AK/SoundEngine/Common/AkTypes.h>
  26. #include "ISourceControlDialogBase.h"
  27. #include "ISourceControlProgress.h"
  28. // Audiokinetic namespace
  29. namespace AK
  30. {
  31. // Audiokinetic Wwise namespace
  32. namespace Wwise
  33. {
  34. /// Wwise source control utilities interface. This interface is provided when the plug-in is initialized.
  35. /// With this interface, you can display a progress dialog, create custom dialogs, display message boxes, and
  36. /// save the plug-in configuration to the registry.
  37. class ISourceControlUtilities
  38. {
  39. public:
  40. /// Get a pointer to an AK::Wwise::ISourceControlProgress interface, so you can display a simple progress dialog for the operation.
  41. /// \warning This function is not thread-safe.
  42. /// \return A pointer to an AK::Wwise::ISourceControlOperationProgress interface.
  43. virtual ISourceControlProgress* GetProgress() = 0;
  44. /// This function does the same thing as the standard \c MessageBox function, except that this one will
  45. /// be displayed with the Wwise UI look and feel.
  46. /// \warning This function is not thread-safe.
  47. /// \return The window results of the dialog
  48. virtual int MessageBox(
  49. HWND in_hWnd, ///< The window handle of the dialog
  50. LPCWSTR in_pszText, ///< The text to be displayed in the message box
  51. LPCWSTR in_pszCaption, ///< The caption of the message box
  52. UINT in_uiType ///< The window message box type (e.g. MB_OK)
  53. ) = 0;
  54. /// This function show a dialog with a edit field and allow the user enter input string
  55. /// \warning This function is not thread-safe.
  56. /// \return The window results of the dialog: IDOK or IDCANCEL
  57. virtual int PromptMessage(
  58. HWND in_hWnd, ///< The window handle of the dialog
  59. LPCWSTR in_pszText, ///< The text to be displayed in the message box
  60. LPCWSTR in_pszCaption, ///< The caption of the message box
  61. LPWSTR out_pszInput, ///< The buffer to receive the user input
  62. UINT in_uiInputSize, ///< The size of the buffer to receive input
  63. bool in_bIsPassword ///< True to hide text; used for passwords
  64. ) = 0;
  65. /// Show a browse for folder dialog.
  66. /// \warning This function is not thread-safe.
  67. /// \return The resulting path is set in out_pszChoosenPath
  68. /// \return True if user clicked OK, false if user clicked Cancel
  69. virtual bool ShowBrowseForFolderDialog(
  70. LPCWSTR in_pszDialogTitle, ///< The dialog title
  71. LPWSTR out_pszChoosenPath, ///< The choosen path
  72. UINT in_uiChoosenPathSize, ///< The size of the buffer to receive path (out_pszChoosenPath)
  73. LPCWSTR in_pszRootPath = NULL ///< The root path for the browse for folder dialog
  74. ) = 0;
  75. /// This function does the same thing as the CDialog::DoModal function.
  76. /// \warning This function is not thread-safe.
  77. /// \return The window results of the dialog (e.g. IDOK)
  78. virtual INT_PTR CreateModalCustomDialog(
  79. ISourceControlDialogBase* in_pDialog ///< A pointer to a dialog class that implements
  80. ///< AK::Wwise::ISourceControlDialogBase functions.
  81. ) = 0;
  82. /// Set DWORD value in user preferences.
  83. /// \warning This function is not thread-safe.
  84. virtual void SetUserPreferenceDword(
  85. LPCWSTR in_pszPreference, ///< Name of preference
  86. DWORD in_dwValue ///< Value to set in user preferences.
  87. ) = 0;
  88. /// Get DWORD value in user preferences.
  89. /// \warning This function is not thread-safe.
  90. virtual void GetUserPreferenceDword(
  91. LPCWSTR in_pszPreference, ///< Name of preference
  92. DWORD& io_dwValue ///< in: value to return if preference is not set; out: changed to user preference value if set
  93. ) = 0;
  94. /// Set string value in user preferences.
  95. /// \warning This function is not thread-safe.
  96. virtual void SetUserPreferenceString(
  97. LPCWSTR in_pszPreference, ///< Name of preference
  98. LPCWSTR in_pszValue ///< Value to set in user preferences.
  99. ) = 0;
  100. /// Get string value from user preferences.
  101. /// \warning This function is not thread-safe.
  102. virtual void GetUserPreferenceString(
  103. LPCWSTR in_pszPreference, ///< Name of preference
  104. LPWSTR io_pszValue, ///< in: value to return if preference is not set; out: changed to user preference value if set
  105. DWORD in_dwSize ///< Size of out_pszValue buffer.
  106. ) = 0;
  107. /// Get the root path for a move operation.
  108. /// The input file can either be a work unit or a source file
  109. /// \warning This function is not thread-safe.
  110. /// \return Nothing as return value. The out_pszRootPath will contain the path.
  111. virtual void GetMoveRootPath(
  112. LPCWSTR in_pszFullPath, ///< The full path of an audio source or work unit file
  113. LPWSTR out_pszRootPath, ///< A pointer to the array that receives the root path
  114. UINT in_uiRootPathSize ///< The size of the array that receives the root path
  115. ) = 0;
  116. /// Create a AK style list control with 3 columns:
  117. /// - Filename
  118. /// - Status
  119. /// - Owner
  120. /// You must create a static control in the resources delimitating the region of the list control and
  121. /// pass the control ID of it.
  122. /// \note DestroyFileStatusListControl must be called when handling WM_DESTROY in WindowProc
  123. /// \warning This function is not thread-safe.
  124. virtual void CreateFileStatusListControl(
  125. HWND in_hWndParent, ///< The parent dialog to create the list control
  126. UINT in_idStatic, ///< The ID of the placeholder static control, which will also be the ID of the list control after the creation
  127. const WCHAR** in_ppFilenameList, ///< The list of files to show in the list
  128. unsigned int in_uiFilenameListCount ///< the number of files in the in_ppFilenameList array
  129. ) = 0;
  130. /// Retrieve if the current operation was marked as to be cancelled.
  131. /// \return True if the user requested to cancel the current operation.
  132. virtual bool IsCancelRequested() const = 0;
  133. /// Log a message into the Source Control channel
  134. /// \note This message will be visible to users in the Log view
  135. virtual void LogMessage(LPCWSTR in_pszMessage) = 0;
  136. };
  137. }
  138. }
  139. #endif // _AK_WWISE_ISOURCECONTROLUTILITIES_H