A generalization of quasi-Frobenius rings