Yes, this is possible. Here is a semi-random example of one that does so:
If you’re asking how to do it, that I don’t know. The source code for that plugin will certainly hold the answer and I’m sure someone else will be able to help with more specific questions about doing it.