  For a spectrally negative L\'evy process, scale functions appear in the
solution of two-sided exit problems, and in particular in relation with the
Laplace transform of the first time it exits a closed interval. In this paper,
we consider the Laplace transform of more general functionals, which can depend
simultaneously on the values of the process and its supremum up to the exit
time. These quantities will be expressed in terms of generalized scale
functions, which can be defined using excursion theory. In the case the
functional does not depend on the supremum, these scale functions coincide with
the ones found on the literature, and therefore the results in this work are an
extension of them.
