Arduino ceiling fan control
Ceiling fan switch diagrams

You can easily do it with three arduino activated relays; you might be able to do it with only two. 

You'll need to figure out how the switch maps position to connections as it rotates, and replace all of those connections with relays.  Relatively easy, but somewhat time consuming.