Prince Charles has shaken hands with Sinn Fein president Gerry Adams in a historic moment during a trip to Ireland.