I am unsure what you are trying to achieve here.. are you looking for a constant DC input to the ucontroller? or are you looking to detect it is connected to the mains or not?
If you want a constant DC, I think a step-down transformer, a rectifier and a regulator (which essentially is a linear DC power supply) is a good idea, although it does use a lot of componenets.. As far as detecting if it is connected to the mains or not, you can just step it down and connect it to the ADC of the controller and write code to detect if AC is present (ofcourse you would need to use appropriate protection with resistors - check the max currect input to the pins)...