Theory of winds in late-type evolved and pre-main-sequence stars