OK, I looked into this in a bit more detail now.
At the moment, TTD does something like the following ("try" means check if not used yet, if so use it and skip the remaining checks):
Code:
if (specialtype) // buoy, docks, heliport, airport, oil field
try corresponding name;
if (has mines nearby) // coal, iron ore, copper ore, gold or diamond mine
try "<townname> Mines";
if (less than 8 tiles from town center)
try "<townname>", then "<townname> central"
if (close to water tile but not map edge)
try "Lakeside";
if (close to trees or forest industry)
try "Woods" ("Forest" in arctic climate);
if (station altitude below town center)
try "Valley"
if (station altitude above town center)
try "Heights";
if (station to the north, south, east or west of town center)
try "North", "South", "East" or "West", respectively
try all remaining generic station names ("Transfer", "Halt", "Exchange", etc.)
So, the industries don't really play too much of a role here, except for the specific ones (mines or forests). I suppose I could look for nearby industries anyway, and call the callback for each of them still, but I'm not sure if that's really useful. Btw, the station part being built is probably not useful, since the naming only happens for the very first part built anyway, no matter how the player later arranges the station.
For the station callback, I could look at all nearby industry tiles, and create a bitmask of all industries present, that might be more useful. I'm not sure if any of the other properties are useful for this, like "is close to water", "is north/south/east/west", "is above/below town center" etc.
For the chained handler, all handlers in the chain would be called once for the first name, then for the second name, etc. until one doesn't fail. There's no problem with the callback count that way.
What I'm not sure about is what kind of text ID we should use here. If the callback handlers are to return a D0xx ID, I must allocate a custom text in TTD, of which there may be 512 I think. This would be one custom text for each station so named, not per type of station name.
Alternatively, it could be a DCxx ID, of which the grf would define one per type of station name. That's probably the better solution, but if the .grf is unloaded, the station would show "Text not available". Personally, I'd prefer this one I think.