Need help to **getSelected** and **replace** from Toolbarevent

I am not sure this is what I want. I just want to call a few javascript calls. I think I see them but the toolevent only gives access to a small set of calls.

I can gettext and addtext, but not much else.
I’m looking for functions that mimic this functionality:
getselectedtext
replaceselectedtext

I think this should be available.