The gradual and impulsive reconnection and the preheating of solar flares