In order to use clang-format for formatting/indenting code in IDE we need to add some tricks which are never needed for clang-format itself.
Let's start with the option which keeps all existing line breaks when the flag is set. This option is available only in the new executable clang-format-ide or as an extra parameter for reformat() function.
The next steps could be for example - adding dummy text to empty lines to indent them or applying format only for the code before the cursor (for incomplete code). There are much more tricks which could also be considered later.
I'm not sure that this design is the best (I tried to avoid rewriting too much code and I really want the tool to share the code with ClangFormat) so commentaries are welcome.