London's Barbican Centre says the Sherlock star will play Shakespeare's melancholy Danish prince in Hamlet at the venue.