Sprinkled a bit of doxymentation over various classes.

This commit is contained in:
Erik Verbruggen
2010-07-28 17:33:21 +02:00
parent 28be7bc4b4
commit 6bbc732a29
10 changed files with 238 additions and 67 deletions

View File

@@ -55,6 +55,9 @@ namespace QmlJS {
class IContextPane;
}
/*!
The top-level namespace of the QmlJSEditor plug-in.
*/
namespace QmlJSEditor {
class Highlighter;

View File

@@ -51,43 +51,76 @@ namespace Internal {
class QmlJSQuickFixCollector;
} // end of namespace Internal
/*!
Specialized QuickFixState for QML/JavaScript quick-fixes.
This specialized state for QML/JavaScript quick-fixes also holds the
QmlJSEditor::Internal::SemanticInfo for the document in the editor.
*/
class QmlJSQuickFixState: public TextEditor::QuickFixState
{
friend class Internal::QmlJSQuickFixCollector;
public:
/// Creates a new state for the given editor.
QmlJSQuickFixState(TextEditor::BaseTextEditor *editor);
typedef Utils::ChangeSet::Range Range;
Internal::SemanticInfo semanticInfo() const;
/// \returns the snapshot holding the document of the editor.
QmlJS::Snapshot snapshot() const;
/// \returns the document of the editor
QmlJS::Document::Ptr document() const;
/*!
\returns the offset in the document for the start position of the given
source location.
*/
unsigned startPosition(const QmlJS::AST::SourceLocation &loc) const;
private:
Internal::SemanticInfo _semanticInfo;
};
/*!
A quick-fix operation for the QML/JavaScript editor, which works on a
QmlJSQuickFixState .
*/
class QmlJSQuickFixOperation: public TextEditor::QuickFixOperation
{
Q_DISABLE_COPY(QmlJSQuickFixOperation)
public:
/*!
Creates a new QmlJSQuickFixOperation.
This operation will copy the complete state, in order to be able to perform
its changes later on.
\param state The state for which this operation was created.
\param priority The priority for this operation.
*/
QmlJSQuickFixOperation(const QmlJSQuickFixState &state, int priority = -1);
virtual ~QmlJSQuickFixOperation();
protected:
/// \returns A const-reference to the state of the operation.
const QmlJSQuickFixState &state() const;
protected:
/// \returns The name of the file for for which this operation is invoked.
QString fileName() const;
/// \returns The refactoring changes associated with this quick-fix operation.
QmlJSRefactoringChanges *refactoringChanges() const;
protected: // Utility functions forwarding to QmlJSQuickFixState
/// \see QmlJSQuickFixState#startPosition
unsigned startPosition(const QmlJS::AST::SourceLocation &loc) const
{ return state().startPosition(loc); }
/// \see QmlJSQuickFixState#range
static QmlJSQuickFixState::Range range(int start, int end)
{ return QmlJSQuickFixState::range(start, end); }
@@ -105,6 +138,11 @@ public:
virtual ~QmlJSQuickFixFactory();
virtual QList<TextEditor::QuickFixOperation::Ptr> matchingOperations(TextEditor::QuickFixState *state);
/*!
Implement this method to match and create the appropriate
QmlJSQuickFixOperation objects.
*/
virtual QList<QmlJSQuickFixOperation::Ptr> match(const QmlJSQuickFixState &state) = 0;
};
@@ -123,6 +161,7 @@ public:
virtual QList<TextEditor::QuickFixFactory *> quickFixFactories() const;
/// Registers all quick-fixes in this plug-in as auto-released objects.
static void registerQuickFixes(ExtensionSystem::IPlugin *plugIn);
};