Macros such as CONNECT_FUNCTION, CONNECT_CONDITION expect that they are called while working within the mitk namespace. If this condition is not met, then compilation errors arise. Changing MessageDelegate2 to ::mitk::MessageDelegate2 and similar for other classes can fix this problem without need for additional changes to other mitk code (mitkEventStateMachine.h).
Similarly the parameter to the mitkCheckOperationTypeMacro expects the OperationType parameter to be a class within the mitk namespace. Therefore this macro isn't usable for classes outside mitk namespace. It would make sense to me if this macro doesn't make such assumptions and does not implicitly try the conversion to mitk::OperationType instead of simply OperationType (mitkOperationActor.h).