Theory of generalized Fano profiles