A phenomenological thermodynamic theory of ferroelectric thin films epitaxially grown on cubic substrates is developed using a new form of the thermodynamic potential, which corresponds to the actual mechanical boundary conditions of the problem. For single-domain ${\mathrm{BaTiO}}_{3}$ and ${\mathrm{PbTiO}}_{3}$ films, the ``misfit-temperature'' phase diagrams are constructed. It is found that the 2D clamping of the films, apart from a shift of the temperature of the ferroelectric transition, results in a change of its order. A change of the sequence of the phases and the appearance of phases forbidden in the bulk crystals are predicted.