Theoretical model for thin ferroelectric films and the multilayer structures based on them