AssistInterface Class

(TextEditor::AssistInterface)

The AssistInterface class acts as an interface for providing access to the document from which a proposal is computed. More...

Header: #include <AssistInterface>

Public Functions

virtual QChar characterAt(int position) const
virtual QString fileName() const
virtual int position() const
virtual TextEditor::AssistReason reason() const
virtual QString textAt(int position, int length) const
virtual QTextDocument *textDocument() const

Detailed Description

This interface existis in order to avoid a direct dependency on the text editor. This is particularly important and safer for asynchronous providers, since in such cases computation of the proposal is not done in the GUI thread.

In general this API tries to be as decoupled as possible from the base text editor. This is in order to make the design a bit more generic and allow code assist to be pluggable into different types of documents (there are still issues to be treated).

This class is part of the CodeAssist API.

See also IAssistProposal, IAssistProvider, and IAssistProcessor.

Member Function Documentation

[virtual] QChar AssistInterface::characterAt(int position) const

Returns the character at position.

[virtual] QString AssistInterface::fileName() const

Returns the file associated.

[virtual] int AssistInterface::position() const

Returns the cursor position.

[virtual] TextEditor::AssistReason AssistInterface::reason() const

The reason which triggered the assist.

[virtual] QString AssistInterface::textAt(int position, int length) const

Returns the text at position with the given length.

[virtual] QTextDocument *AssistInterface::textDocument() const

Returns the document.