Have a look at the files
To add a new tool, you will probably extend the class
AbstractTool or the
AbstractTileTool which you can find in the files
abstracttiletool.h. You can go through the files
bucketfilltool.h, etc to understand how exactly to make a tool.
Apart from this, you can also have a look at
CommandButton in the
commandbutton.h file which is not exactly a tool but a utility added in the main toolbar.