Temperature fields in a liquid due to the thermocapillary motion of bubbles and drops