Table of Contents

include/AK/Wwise/SourceControl/ISourceControl.h

Go to the documentation of this file.
00001 
00002 //
00003 // Copyright (c) 2006 Audiokinetic Inc. / All Rights Reserved
00004 //
00006 
00009 
00010 #ifndef _AK_WWISE_ISOURCECONTROL_H
00011 #define _AK_WWISE_ISOURCECONTROL_H
00012 
00013 // Include the header file that defines the BSTR type.
00014 #include <wtypes.h>
00015 
00016 #include "ISourceControlUtilities.h"
00017 #include "SourceControlContainers.h"
00018 
00019 // Audiokinetic namespace
00020 namespace AK
00021 {
00022     // Audiokinetic Wwise namespace
00023     namespace Wwise
00024     {
00026         class SourceControlConstant
00027         {
00028         public: 
00030             static const unsigned int s_uiMaxWorkUnitName = 128;
00032             static const DWORD s_dwInvalidOperationID = (DWORD)-1;
00033         };
00034 
00040         class ISourceControl
00041         {
00042         public: 
00043             
00045 
00046 
00049             enum OperationResult
00050             {
00051                 OperationResult_Succeed = 0,    
00052                 OperationResult_Failed,         
00053                 OperationResult_TimedOut,       
00054                 OperationResult_NotImplemented  
00055             };
00056 
00059             enum OperationMenuType
00060             {
00061                 OperationMenuType_WorkUnits = 0,
00062                 OperationMenuType_Sources,      
00063                 OperationMenuType_Explorer      
00064             };
00065 
00067             enum CreateOrModifyOperation
00068             {
00069                 CreateOrModifyOperation_Create = 1 << 0,    
00070                 CreateOrModifyOperation_Modify = 1 << 1,    
00071             };
00072 
00074             enum OperationEffect
00075             {
00076                 OperationEffect_LocalContentModification = 1 << 0,  
00077                 OperationEffect_ServerContentModification = 1 << 1, 
00078             };
00079 
00081 
00083             class IOperationResult
00084             {
00085             public:
00087                 virtual OperationResult GetOperationResult() = 0;
00088 
00090                 virtual void Destroy() = 0;
00091             };
00092 
00099             class IFileOperationResult : public IOperationResult
00100             {
00101             public:
00103                 virtual void GetMovedFile( 
00104                     unsigned int in_uiIndex,    
00105                     LPWSTR out_szFrom,          
00106                     LPWSTR out_szTo,            
00107                     unsigned int in_uiArraySize 
00108                     ) = 0;
00109                 
00111                 virtual void GetFile( 
00112                     unsigned int in_uiIndex,    
00113                     LPWSTR out_szPath,          
00114                     unsigned int in_uiArraySize 
00115                     ) = 0;
00116 
00118                 virtual unsigned int GetFileCount() = 0;
00119             };
00120 
00123             struct FilenameToStatusMapItem
00124             {
00125                 BSTR m_bstrStatus;              
00126                 BSTR m_bstrOwner;               
00127             };
00128 
00130             struct OperationListItem
00131             {
00132                 DWORD m_dwOperationID;          
00133                 bool m_bEnabled;                
00134             };
00135 
00138             struct FilenameToIconMapItem
00139             {
00140                 HICON m_hIcon;                  
00141                 BSTR m_bstrToolTip;             
00142             };
00143 
00145 
00146 
00150             typedef SourceControlContainers::IAkList<LPCWSTR, LPCWSTR> StringList;
00151             
00154             typedef SourceControlContainers::IAkList<GUID> PluginIDList;
00155 
00162             typedef SourceControlContainers::IAkList<OperationListItem> OperationList;
00163 
00165 
00167 
00168 
00174             typedef SourceControlContainers::IAkMap<LPCWSTR, LPCWSTR, FilenameToIconMapItem, const FilenameToIconMapItem&> FilenameToIconMap;
00175         
00182             typedef SourceControlContainers::IAkMap<LPCWSTR, LPCWSTR, FilenameToStatusMapItem, const FilenameToStatusMapItem&> FilenameToStatusMap;
00183 
00185 
00187             class PluginInfo
00188             {
00189             public:
00190                 BSTR m_bstrName;                
00191                 unsigned int m_uiVersion;       
00192 
00193                 bool m_bShowConfigDlgAvailable; 
00194                 DWORD m_dwUpdateCommandID;      
00195                 DWORD m_dwCommitCommandID;      
00196                 DWORD m_dwRenameCommandID;      
00197                 DWORD m_dwMoveCommandID;        
00198                 DWORD m_dwAddCommandID;         
00199                 DWORD m_dwDeleteCommandID;      
00200                 DWORD m_dwRevertCommandID;      
00201                 DWORD m_dwDiffCommandID;        
00202                 DWORD m_dwCheckOutCommandID;    
00203                 DWORD m_dwRenameNoUICommandID;  
00204                 DWORD m_dwMoveNoUICommandID;    
00205                 DWORD m_dwDeleteNoUICommandID;  
00206                 bool m_bStatusIconAvailable;    
00207             };
00208 
00210             virtual void Init( 
00211                 AK::Wwise::ISourceControlUtilities* in_pUtilities,  
00212 
00213                 bool in_bAutoAccept                                 
00214                 ) = 0;
00215 
00217             virtual void Term() = 0;
00218 
00220             virtual void Destroy() = 0;
00221 
00226             virtual bool ShowConfigDlg() = 0;
00227 
00230             virtual AK::Wwise::ISourceControl::OperationResult GetOperationList( 
00231                 OperationMenuType in_menuType,      
00232                 const StringList& in_rFilenameList, 
00233                 OperationList& out_rOperationList   
00234                 ) = 0;
00235 
00237             // \return A mask of all the applicable OperationEffect enum values
00238             virtual LPCWSTR GetOperationName(
00239                 DWORD in_dwOperationID  
00240                 ) = 0;
00241 
00243             // \return A mask of all the applicable OperationEffect enum values
00244             virtual DWORD GetOperationEffect(
00245                 DWORD in_dwOperationID  
00246                 ) = 0;
00247 
00250             virtual AK::Wwise::ISourceControl::OperationResult GetFileStatus( 
00251                 const StringList& in_rFilenameList,     
00252                 FilenameToStatusMap& out_rFileStatusMap,
00253                 DWORD in_dwTimeoutMs = INFINITE         
00254                 ) = 0;
00255 
00259             virtual AK::Wwise::ISourceControl::OperationResult GetFileStatusIcons( 
00260                 const StringList& in_rFilenameList,     
00261                 FilenameToIconMap& out_rFileIconsMap,   
00262                 DWORD in_dwTimeoutMs = INFINITE         
00263                 ) = 0;
00264 
00268             virtual AK::Wwise::ISourceControl::OperationResult GetMissingFilesInDirectories( 
00269                 const StringList& in_rDirectoryList,    
00270                 StringList& out_rFilenameList           
00271                 ) = 0;
00272 
00276             virtual IOperationResult* DoOperation( 
00277                 DWORD in_dwOperationID,                         
00278                 const StringList& in_rFilenameList,             
00279                 const StringList* in_pTargetFilenameList = NULL 
00280                 ) = 0;
00281 
00286             virtual AK::Wwise::ISourceControl::OperationResult PreCreateOrModify(
00287                 const StringList& in_rFilenameList,     
00288                 CreateOrModifyOperation in_eOperation,  
00289                 bool& out_rContinue                     
00290                 ) = 0;
00291 
00296             virtual AK::Wwise::ISourceControl::OperationResult PostCreateOrModify(
00297                 const StringList& in_rFilenameList,     
00298                 CreateOrModifyOperation in_eOperation,  
00299                 bool& out_rContinue                     
00300                 ) = 0;
00301 
00304             virtual AK::Wwise::ISourceControl::OperationResult GetFilesForOperation( 
00305                 DWORD in_dwOperationID,                     
00306                 const StringList& in_rFilenameList,         
00307                 StringList& out_rFilenameList,              
00308                 FilenameToStatusMap& out_rFileStatusMap     
00309                 ) = 0;
00310 
00312 
00314 
00315 
00317             typedef void (__stdcall* GetSourceControlIDListFuncPtr)( 
00318                 PluginIDList& out_rPluginIDList     
00319                 );
00320 
00322             typedef void (__stdcall* GetSourceControlPluginInfoFuncPtr)( 
00323                 const GUID& in_rguidPluginID,       
00324                 PluginInfo& out_rPluginInfo         
00325                 );
00326 
00329             typedef ISourceControl* (__stdcall* GetSourceControlInstanceFuncPtr)( 
00330                 const GUID& in_guidPluginID         
00331                 );
00332         };
00333     }
00334 }
00335 
00336 #endif // _AK_WWISE_ISOURCECONTROL_H