| 19 | |
| 20 | namespace KDevelop { |
| 21 | class IFileFormatter |
| 22 | { |
| 23 | Q_DISABLE_COPY_MOVE(IFileFormatter) |
| 24 | public: |
| 25 | IFileFormatter() = default; |
| 26 | virtual ~IFileFormatter() = default; |
| 27 | |
| 28 | /** |
| 29 | * Format text using packaged source formatter and style. |
| 30 | * @param text the text to format |
| 31 | * @param leftContext the context at the left side of the text. |
| 32 | * If it is in another line, it must end with a newline. |
| 33 | * @param rightContext the context at the right side of the text. |
| 34 | * If it is in the next line, it must start with a newline. |
| 35 | * |
| 36 | * @note If the source formatter cannot work correctly with the context, |
| 37 | * it will just return the input text. |
| 38 | */ |
| 39 | virtual QString format(const QString& text, const QString& leftContext = QString(), |
| 40 | const QString& rightContext = QString()) const = 0; |
| 41 | }; |
| 42 | |
| 43 | /** \short An interface to the controller managing all source formatter plugins |
| 44 | */ |