Metal enrichment of the intra-cluster medium by thermally and cosmic-ray driven galactic winds An analytical prescription for galactic outflows