The paper proposes a general framework allowing the analysis of wetting problems in thesituation when interfacial tensions depend on external fields. An equation predictingapparent contact angles of sessile droplets deposited on rough surfaces in the presence ofexternal fields is derived. The problem of wetting is discussed in the framework of thevariational approach. Derivation of a general equation generalizing the Cassie and Wenzelapproaches is presented. The effects related to the line tension which are important fornano-structured surfaces are considered.