Spells without somatic components are no trouble at all. Spells with somatic components require at least one free hand, though I'd allow a mage with a quarterstaff (or other two-handed weapon) to let go of it with one hand as a free action, cast the spell as normal, and then grab the staff again as a second free action. They wouldn't have a threat zone during the casting time though, but that pretty much only applies if someone has a readied action that would provoke an AoO.