It is possible with the following code to check if a content has been flagged by the current user with a certain flag:
$flag = flag_get_flag('flag_name');
if ($flag && $flag->is_flagged($node->nid, $GLOBALS['user']->uid)) {
print "This node is flagged";
}
But, how to check if the user has flagged content with any flag ?