have a look at some of the battery charger datasheet from Linear technology.
They provide the block digram for the same.
You could develop from their on.
in case of charging a battery
it is good to use half wave rectifier with a series resistor to limit the charging current
this configuration also tricle charge your battery, if your battery is fully charged