Comprehensive theory for ion cyclotron resonance power absorption - Application to line shapes for reactive and nonreactive ions