When is a surface foam-phobic or foam-philic?