Graphisoft®

API Development KitVersion: 18

APIViewEventHandlerProc

Project Navigator 항목들의 변경사항들을 처리하기 위한 사용자 제공 콜백 함수입니다.

    typedef GSErrCode  APIViewEventHandlerProc (
        const API_NotifyViewEventType*     viewEvent
    );

 

파라미터

viewEvent
[in] 이 structure는 Project Navigator 항목과 애드온이 호출되는 이벤트를 식별합니다.

 

리턴 값

NoError
함수가 성공적으로 완료되었습니다.

다른 공통 API 오류들에 대해서는 API 오류 문서를 보십시오.

 

설명

애드온이 ACAPI_Notify_CatchViewEvent와 함께 Project Navigator 항목 변경사항에 대한 알림들을 받게 되면 이 함수가 호출될 것입니다.

 

예제

static GSErrCode __ACENV_CALL  ViewNotificationHandlerProc (const API_NotifyViewEventType* viewEvent) {
    char        msgStr[256];
    char        eventStr[64];

    switch (viewEvent->notifID) {
        case APINotifyView_Inserted:    CHCopyC ("inserted", eventStr);           break;
        case APINotifyView_Modified:    CHCopyC ("modified", eventStr);           break;
        case APINotifyView_Deleted:     CHCopyC ("deleted", eventStr);            break;
        case APINotifyView_Opened:      CHCopyC ("opened", eventStr);             break;
        case APINotifyView_Begin:       return NoError;
        case APINotifyView_End:         return NoError;
        default:                        CHCopyC ("- unknown event -", eventStr);  break;
    }

    API_NavigatorItem item;
    BNZeroMemory (&item, sizeof (API_NavigatorItem));
    GSErrCode err = ACAPI_Environment (APIEnv_GetNavigatorItemID, const_cast<char*>(viewEvent->itemGuid), &item);

    if (err == NoError) {
        sprintf (msgStr, "API Notification: navigator item \"%s%s%s\" has been %s",
        item.uiId, ((strlen (item.uiId) > 0 && strlen (item.name) > 0) ? " " : ""), item.name, eventStr);
    } else {
        sprintf (msgStr, "API Notification: navigator item \"%s\" has been %s", viewEvent->itemGuid, eventStr);
    }

    ACAPI_WriteReport (msgStr, false);

    return NoError;
}

 

요구사항

버전: API 10 또는 이후
헤더: APIdefs_Callback.h

 

참고사항

API_NotifyViewEventType
ACAPI_Notify_CatchViewEvent
API 함수