Domain wall dynamics and Barkhausen effect in metallic ferromagnetic materials. I. Theory