Contempt committed in the immediate view and presence of the court may be punished summarily; in other cases the party charged shall be notified of the accusation, and have a reasonable time to make his defense.