Generic isolated horizons and their applications