00001 //**************************************************************************/ 00002 // Copyright (c) 1998-2005 Autodesk, Inc. 00003 // All rights reserved. 00004 // 00005 // These coded instructions, statements, and computer programs contain 00006 // unpublished proprietary information written by Autodesk, Inc., and are 00007 // protected by Federal copyright law. They may not be disclosed to third 00008 // parties or copied or duplicated in any form, in whole or in part, without 00009 // the prior written consent of Autodesk, Inc. 00010 //**************************************************************************/ 00011 // DESCRIPTION: Interfaces for ATS Notifications 00012 // AUTHOR: Michael Russo - created April 27, 2005 00013 //***************************************************************************/ 00014 00015 #pragma once 00016 00017 #include "IATSProvider.h" 00018 00019 #ifndef ATSExport 00020 #define ATSExport __declspec( dllexport ) 00021 #endif 00022 00024 // 00025 // Consts and Typedefs 00026 // 00028 typedef DWORD ATSNotifyID; 00029 typedef DWORD ATSNotifyResult; 00030 typedef LONG_PTR ATSNotifyClientPtr; 00031 00032 00033 namespace ATS { 00034 00035 // ATS Notification IDs 00036 const ATSNotifyID kATSNotifyPreLogin = 1; 00037 const ATSNotifyID kATSNotifyPostLogin = 2; 00038 const ATSNotifyID kATSNotifyPreLogout = 3; 00039 const ATSNotifyID kATSNotifyPostLogout = 4; 00040 const ATSNotifyID kATSNotifyPreOpenProject = 5; 00041 const ATSNotifyID kATSNotifyPostOpenProject = 6; 00042 const ATSNotifyID kATSNotifyPreCloseProject = 7; 00043 const ATSNotifyID kATSNotifyPostCloseProject = 8; 00044 const ATSNotifyID kATSNotifyPreLaunchOptions = 9; 00045 const ATSNotifyID kATSNotifyPostLaunchOptions = 10; 00046 const ATSNotifyID kATSNotifyPreLaunchProvider = 11; 00047 const ATSNotifyID kATSNotifyPostLaunchProvider = 12; 00048 const ATSNotifyID kATSNotifyPreCheckin = 13; 00049 const ATSNotifyID kATSNotifyPostCheckin = 14; 00050 const ATSNotifyID kATSNotifyPreCheckout = 15; 00051 const ATSNotifyID kATSNotifyPostCheckout = 16; 00052 const ATSNotifyID kATSNotifyPreUndoCheckout = 17; 00053 const ATSNotifyID kATSNotifyPostUndoCheckout = 18; 00054 const ATSNotifyID kATSNotifyPreAddFiles = 19; 00055 const ATSNotifyID kATSNotifyPostAddFiles = 20; 00056 const ATSNotifyID kATSNotifyPreGetLatest = 21; 00057 const ATSNotifyID kATSNotifyPostGetLatest = 22; 00058 const ATSNotifyID kATSNotifyPreProperties = 23; 00059 const ATSNotifyID kATSNotifyPostProperties = 24; 00060 const ATSNotifyID kATSNotifyPreShowHistory = 25; 00061 const ATSNotifyID kATSNotifyPostShowHistory = 26; 00066 const ATSNotifyID kATSNotifyFileListUpdate = 27; 00067 const ATSNotifyID kATSNotifyPreExploreProvider = 28; 00068 const ATSNotifyID kATSNotifyPostExploreProvider = 29; 00069 const ATSNotifyID kATSNotifyPreGetVersion = 30; 00070 const ATSNotifyID kATSNotifyPostGetVersion = 31; 00071 00072 00073 // 00074 // ATS Notification Callback Results 00075 // 00076 00078 const ATSNotifyResult kATSNotifyResultOk = 0; 00083 const ATSNotifyResult kATSNotifyResultCancel = 1; 00085 const ATSNotifyResult kATSNotifyResultStop = 2; 00086 }; 00087 00089 // 00090 // class ATSNotifyParams 00091 // 00093 00095 00098 class ATSNotifyParams : public MaxHeapOperators 00099 { 00100 public: 00102 ATSExport ATSNotifyParams(); 00104 ATSExport virtual ~ATSNotifyParams(); 00105 00107 00109 ATSExport virtual ATSNotifyID GetID(); 00110 00112 00114 ATSExport virtual void SetID( ATSNotifyID id ); 00115 00117 00119 ATSExport virtual UINT GetProviderIndex(); 00120 00122 00124 ATSExport virtual void SetProviderIndex( UINT uIndex ); 00125 00127 00134 ATSExport virtual bool IsCancelled(); 00135 00137 00140 ATSExport virtual void SetCancelled( bool bCancelled ); 00141 00143 00146 ATSExport virtual ATSFileList* GetATSFileList(); 00147 00149 00152 ATSExport virtual void SetATSFileList( ATSFileList* pATSFileList ); 00153 00154 protected: 00155 ATSNotifyID mID; 00156 UINT mProviderIndex; 00157 bool mCancelled; 00158 ATSFileList* mpATSFileList; 00159 }; 00160 00162 // 00163 // class IATSNotifyCallback 00164 // 00166 00168 00171 class IATSNotifyCallback : public MaxHeapOperators 00172 { 00173 public: 00175 00185 virtual ATSNotifyResult ATSNotifyCallback( ATSNotifyParams *pATSNotifyParams, ATSNotifyClientPtr pClientPtr ) = 0; 00186 }; 00187 00189 // 00190 // class ATSNotification 00191 // 00194 class ATSNotification : public MaxHeapOperators 00195 { 00196 public: 00198 00203 ATSExport static bool RegisterATSNotification( IATSNotifyCallback *pCallback, ATSNotifyClientPtr pClientPtr ); 00205 00209 ATSExport static bool UnRegisterATSNotification( IATSNotifyCallback *pCallback ); 00210 00212 00216 ATSExport static ATSNotifyResult BroadcastATSNotification( ATSNotifyParams *pATSNotifyParamsn ); 00218 00224 ATSExport static ATSNotifyResult BroadcastATSNotification( ATSNotifyID id, UINT uProviderIndex ); 00225 }; 00226