Perforce checkout via editor code

Hi, everyone!
I making some editors extensions for our team and we are using Perforce as version control system.
The problem is:
There are text-file data edited in this extensions and I want to make a simple “Save” button, but it will not work coz file write access permissions until this text file will be checked out in version control system.
For example, when you applying changes to prefabs Unity3D automatically offers you to check out prefab files. I need similar behaviour in my extensions.
Any manuals/links on how to do that?

Have a look at Provider.Checkout(…). If you selected Perforce as your version control tool in the editor settings and provided valid credentials, this will translate to an actual perforce checkout.