lovest: From what I've seen it's been right clicking them every day, making sure there is enough hay for each animal (even if you let them out), letting them out on sunny days, keeping them in on rainy days (and I keep them in on windy days as well just in case), having a heater in the barn or coop in the winter, and milking cows.
I haven't had the chance to deal with animals other than chickens and cows, but I'd bet all other barn animals enjoy getting their products taken too.
I doubt they take gifts (although I haven't tried) and I don't see there being any other ways to raise hearts or of affecting their mood.
Mostly this. The only few things I would add are:
Keeping grass nearby for the animals to munch on when they're let outside each day.
Closing the Coop/Barn doors at night time after they've gone back inside.
You don't have to keep them inside during windy days, only rainy/stormy days (The animals won't come out at all even with the doors open on rainy/stormy days).
There aren't any gifts you can give to them, this could potentially change in the future but as of now there is not.