ACAPI_Notify_CatchProjectEvent
당신의 애드온이 애플리케이션과 프로젝트 이벤트들의 알림을 받을지 여부를 등록 또는 등록 해제합니다.
GSErrCode ACAPI_Notify_CatchProjectEvent ( GSFlags eventTypes, APIProjectEventHandlerProc* handlerProc );
파라미터
- eventTypes
- [in] 서로 다른 API_NotifyEventID 값들의 조합입니다. 이것은 당신이 관심 있는 프로젝트 이벤트들의 타입을 지정합니다.
- handlerProc
- [in] 서로 다른 프로젝트 이벤트들에 대한 알림이 전송되면 호출되는 콜백 프로시저입니다.
여기에
NULL
을 지정하는 것은 당신이 더 이상 알림이 필요하지 않다는 것을 의미합니다.
리턴 값
NoError
- 요청한 동작을 성공적으로 완료했습니다.
다른 공통 API 오류들에 대해서는 API 오류 문서를 보십시오.
설명
이 함수는 API 도구 애드온이 프로젝트에 발생하는 이벤트들을 캐치할 수 있게 해줍니다.
그러한 이벤트가 발생할 때마다 서버 애플리케이션은 예전에 이 이벤트에 대해 등록된 애드온이 제공한 handlerProc
를 호출합니다.
만약 더이상 프로젝트 이벤트들을 캐치할 필요가 없다면, handlerProc
파라미터에 NULL
을 전달하여
요구하는 요소 타입에 대한 ACAPI_Notify_CatchProjectEvent
를 호출하여 등록을 해제하는 것을 기억하시기 바랍니다.
예제
// ----------------------------------------------------------------------------- // 프로젝트 이벤트 핸들러 함수 // ----------------------------------------------------------------------------- static GSErrCode __ACENV_CALL NotificationHandler (API_NotifyEventID notifID, Int32 param) { char msgStr[256]; switch (notifID) { case APINotify_New: CHCopyC ("APINotify_New", msgStr); break; case APINotify_NewAndReset: CHCopyC ("APINotify_NewAndReset", msgStr); break; case APINotify_Open: CHCopyC ("APINotify_Open", msgStr); break; case APINotify_PreSave: CHCopyC ("APINotify_PreSave", msgStr); break; case APINotify_Save: CHCopyC ("APINotify_Save", msgStr); break; case APINotify_Close: CHCopyC ("APINotify_Close", msgStr); break; case APINotify_Quit: CHCopyC ("APINotify_Quit", msgStr); break; case APINotify_SendChanges: CHCopyC ("APINotify_SendChanges", msgStr); break; case APINotify_ReceiveChanges: CHCopyC ("APINotify_ReceiveChanges", msgStr); break; case APINotify_ChangeProjectDB: CHCopyC ("APINotify_ChangeProjectDB", msgStr); break; case APINotify_ChangeWindow: CHCopyC ("APINotify_ChangeWindow", msgStr); break; case APINotify_ChangeFloor: CHCopyC ("APINotify_ChangeFloor", msgStr); break; case APINotify_ChangeLibrary: CHCopyC ("APINotify_ChangeLibrary", msgStr); break; } ACAPI_WriteReport (msgStr, false); return NoError; } // NotificationHandler // ----------------------------------------------------------------------------- // 애드온이 메모리에 로드된 후에 호출됨 // ----------------------------------------------------------------------------- GSErrCode __ACENV_CALL Initialize (void) { // 프로젝트 이벤트들의 변경사항을 캐치 GSErrCode err = ACAPI_Notify_CatchProjectEvent (API_AllProjectNotificationMask, NotificationHandler); return err; } // Initialize
요구사항
- 버전: API 4.1 또는 이후
- 헤더: ACAPinc.h
참고사항
API_NotifyEventID, APIProjectEventHandlerProc,
알림 관리자, API 함수