For the pastry, mix the flour with the spices in a bowl. Rub in the butter until the mixture resembles breadcrumbs. Add the egg and mix everything to a smooth dough. Chill the pastry for 45 minutes.
Peel and finely dice the onions.
Wash the leek, halve and cut into fine strips.
Cut the ham into small cubes.
Melt the butter in a pan and fry the onions. Add the leek and ham and cook for 3 minutes. Add the white wine, simmer for 5 minutes and season with salt and pepper. Allow to cool.
For the filling, mix the eggs with the cream and Emmental. Season with nutmeg.
Preheat the oven to 180°C (160°C fan, gas 4). Butter a flan dish. Roll out the pastry slightly larger than the dish, then use to line the dish. Line the pastry with baking paper, weight down with baking beans and bake for 10 minutes.
Remove the beans and paper and brush the base with egg white.
Add the leek mixture to the pastry case, pour over the egg mixture and bake in the oven for 30 minutes until golden brown.