forked from qt-creator/qt-creator
Doc: move Class View plugin docs to .cpp files.
QDoc does not find docs in the .h files. Use \brief only for namespaces, classes, enums, and properties. Use standard wording for \brief and \fn. Use \a and \c according to guidelines. Fix grammar and style. Change-Id: Ib685a03c97ef38661ecc156f61d70085514357fc Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
committed by
Erik Verbruggen
parent
5b268822cf
commit
3f843aca67
@@ -58,11 +58,89 @@ namespace Internal {
|
||||
static Manager *managerInstance = 0;
|
||||
|
||||
/*!
|
||||
\struct ManagerPrivate
|
||||
\class ClassView::Internal::Manager
|
||||
|
||||
\brief The Manager class implements a class view manager that interacts with
|
||||
other \QC plugins and acts as a proxy between them and the parser.
|
||||
|
||||
The parser is moved to a separate thread and is connected to the manager by
|
||||
using signals and slots. Manager's signals starting with 'request' are for
|
||||
the parser.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn explicit ClassView::Internal::Manager(QObject *parent = 0)
|
||||
|
||||
Creates a shared instance of a \a parent object.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void ClassView::Internal::Manager::stateChanged(bool state)
|
||||
|
||||
Changes the internal manager state. \a state returns true if manager is
|
||||
enabled, otherwise false.
|
||||
|
||||
\sa setState, state
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void ClassView::Internal::Manager::treeDataUpdate(QSharedPointer<QStandardItem> result)
|
||||
|
||||
Emits a signal about a tree data update (to tree view). \a result holds the
|
||||
item with the current tree.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void ClassView::Internal::Manager::requestTreeDataUpdate()
|
||||
|
||||
Emits a signal that a request for sending the tree view has to be handled by
|
||||
listeners (the parser).
|
||||
|
||||
\sa onRequestTreeDataUpdate
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void ClassView::Internal::Manager::requestDocumentUpdated(CPlusPlus::Document::Ptr doc)
|
||||
|
||||
Emits a signal that \a doc was updated and has to be reparsed.
|
||||
|
||||
\sa onDocumentUpdated
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void ClassView::Internal::Manager::requestResetCurrentState()
|
||||
|
||||
Emits a signal that the parser has to reset its internal state to the
|
||||
current state from the code manager.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void ClassView::Internal::Manager::requestClearCache()
|
||||
|
||||
Requests the parser to clear a cache.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void ClassView::Internal::Manager::requestClearCacheAll()
|
||||
|
||||
Requests the parser to clear a full cache.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void ClassView::Internal::Manager::requestSetFlatMode(bool flat)
|
||||
|
||||
Requests the manager to set the flat mode without subprojects. Set \a flat
|
||||
to \c true to enable flat mode and to false to disable it.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\class ManagerPrivate
|
||||
\internal
|
||||
\brief Private class data for \a Manager
|
||||
\brief The ManagerPrivate class contains private class data for the Manager
|
||||
class.
|
||||
\sa Manager
|
||||
*/
|
||||
*/
|
||||
|
||||
class ManagerPrivate
|
||||
{
|
||||
public:
|
||||
@@ -118,11 +196,20 @@ Manager *Manager::instance()
|
||||
return managerInstance;
|
||||
}
|
||||
|
||||
/*!
|
||||
Checks \a item for lazy data population of a QStandardItemModel.
|
||||
*/
|
||||
|
||||
bool Manager::canFetchMore(QStandardItem *item) const
|
||||
{
|
||||
return d->parser.canFetchMore(item);
|
||||
}
|
||||
|
||||
/*!
|
||||
Checks \a item for lazy data population of a QStandardItemModel.
|
||||
\a skipRoot item is needed for the manual update, call not from model.
|
||||
*/
|
||||
|
||||
void Manager::fetchMore(QStandardItem *item, bool skipRoot)
|
||||
{
|
||||
d->parser.fetchMore(item, skipRoot);
|
||||
@@ -193,11 +280,27 @@ void Manager::initialize()
|
||||
&d->parser, SLOT(removeFiles(QStringList)), Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
/*!
|
||||
Gets the internal manager state. If it is disabled, does not emit signals
|
||||
about parsing requests. If enabled, does parsing in the background even if
|
||||
the navigation pane is not visible. Returns true if the manager is enabled,
|
||||
false otherwise.
|
||||
|
||||
\sa setState, stateChanged
|
||||
*/
|
||||
|
||||
bool Manager::state() const
|
||||
{
|
||||
return d->state;
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the internal manager \a state to \c true if the manager has to be
|
||||
enabled, otherwise sets it to \c false.
|
||||
|
||||
\sa state, stateChanged
|
||||
*/
|
||||
|
||||
void Manager::setState(bool state)
|
||||
{
|
||||
QMutexLocker locker(&d->mutexState);
|
||||
@@ -211,11 +314,24 @@ void Manager::setState(bool state)
|
||||
emit stateChanged(d->state);
|
||||
}
|
||||
|
||||
/*!
|
||||
Reacts to the widget factory creating a widget.
|
||||
|
||||
\sa setState, state
|
||||
*/
|
||||
|
||||
void Manager::onWidgetIsCreated()
|
||||
{
|
||||
// do nothing - continue to sleep
|
||||
}
|
||||
|
||||
/*!
|
||||
Reacts to the \a visibility of one navigation pane widget being changed
|
||||
(there might be a lot of them).
|
||||
|
||||
\sa setState, state
|
||||
*/
|
||||
|
||||
void Manager::onWidgetVisibilityIsChanged(bool visibility)
|
||||
{
|
||||
// activate data handling - when 1st time 'Class View' will be open
|
||||
@@ -223,6 +339,13 @@ void Manager::onWidgetVisibilityIsChanged(bool visibility)
|
||||
setState(true);
|
||||
}
|
||||
|
||||
/*!
|
||||
Reacts to the state changed signal for the current manager \a state.
|
||||
For example, requests the currect code snapshot if needed.
|
||||
|
||||
\sa setState, state, stateChanged
|
||||
*/
|
||||
|
||||
void Manager::onStateChanged(bool state)
|
||||
{
|
||||
if (state) {
|
||||
@@ -234,6 +357,11 @@ void Manager::onStateChanged(bool state)
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
Reacts to the project list being changed by updating the navigation pane
|
||||
visibility if necessary.
|
||||
*/
|
||||
|
||||
void Manager::onProjectListChanged()
|
||||
{
|
||||
// do nothing if Manager is disabled
|
||||
@@ -244,6 +372,13 @@ void Manager::onProjectListChanged()
|
||||
requestTreeDataUpdate();
|
||||
}
|
||||
|
||||
/*!
|
||||
Handles parse tasks started by the progress manager. \a type holds the
|
||||
task index, which should be \c CppTools::Constants::TASK_INDEX.
|
||||
|
||||
\sa CppTools::Constants::TASK_INDEX
|
||||
*/
|
||||
|
||||
void Manager::onTaskStarted(const QString &type)
|
||||
{
|
||||
if (type != QLatin1String(CppTools::Constants::TASK_INDEX))
|
||||
@@ -253,6 +388,13 @@ void Manager::onTaskStarted(const QString &type)
|
||||
d->disableCodeParser = true;
|
||||
}
|
||||
|
||||
/*!
|
||||
Handles parse tasks finished by the progress manager.\a type holds the
|
||||
task index, which should be \c CppTools::Constants::TASK_INDEX.
|
||||
|
||||
\sa CppTools::Constants::TASK_INDEX
|
||||
*/
|
||||
|
||||
void Manager::onAllTasksFinished(const QString &type)
|
||||
{
|
||||
if (type != QLatin1String(CppTools::Constants::TASK_INDEX))
|
||||
@@ -272,6 +414,13 @@ void Manager::onAllTasksFinished(const QString &type)
|
||||
emit requestResetCurrentState();
|
||||
}
|
||||
|
||||
/*!
|
||||
Emits the signal \c documentUpdated when the code model manager state is
|
||||
changed for \a doc.
|
||||
|
||||
\sa documentUpdated
|
||||
*/
|
||||
|
||||
void Manager::onDocumentUpdated(CPlusPlus::Document::Ptr doc)
|
||||
{
|
||||
// do nothing if Manager is disabled
|
||||
@@ -285,6 +434,11 @@ void Manager::onDocumentUpdated(CPlusPlus::Document::Ptr doc)
|
||||
emit requestDocumentUpdated(doc);
|
||||
}
|
||||
|
||||
/*!
|
||||
Opens the text editor for the file \a fileName on \a line (1-based) and
|
||||
\a column (1-based).
|
||||
*/
|
||||
|
||||
void Manager::gotoLocation(const QString &fileName, int line, int column)
|
||||
{
|
||||
bool newEditor = false;
|
||||
@@ -293,6 +447,12 @@ void Manager::gotoLocation(const QString &fileName, int line, int column)
|
||||
&newEditor);
|
||||
}
|
||||
|
||||
/*!
|
||||
Opens the text editor for any of the symbol locations in the \a list.
|
||||
|
||||
\sa Manager::gotoLocations
|
||||
*/
|
||||
|
||||
void Manager::gotoLocations(const QList<QVariant> &list)
|
||||
{
|
||||
QSet<SymbolLocation> locations = Utils::roleToLocations(list);
|
||||
@@ -344,6 +504,13 @@ void Manager::gotoLocations(const QList<QVariant> &list)
|
||||
gotoLocation(loc.fileName(), loc.line(), loc.column());
|
||||
}
|
||||
|
||||
/*!
|
||||
Emits the signal \c requestTreeDataUpdate if the latest tree info is
|
||||
requested and if parsing is enabled.
|
||||
|
||||
\sa requestTreeDataUpdate, NavigationWidget::requestDataUpdate
|
||||
*/
|
||||
|
||||
void Manager::onRequestTreeDataUpdate()
|
||||
{
|
||||
// do nothing if Manager is disabled
|
||||
@@ -353,11 +520,20 @@ void Manager::onRequestTreeDataUpdate()
|
||||
emit requestTreeDataUpdate();
|
||||
}
|
||||
|
||||
/*!
|
||||
Switches to flat mode (without subprojects) if \a flat is set to \c true.
|
||||
*/
|
||||
|
||||
void Manager::setFlatMode(bool flat)
|
||||
{
|
||||
emit requestSetFlatMode(flat);
|
||||
}
|
||||
|
||||
/*!
|
||||
Sends a new tree data update to a tree view. \a result holds the item with
|
||||
the current tree.
|
||||
*/
|
||||
|
||||
void Manager::onTreeDataUpdate(QSharedPointer<QStandardItem> result)
|
||||
{
|
||||
// do nothing if Manager is disabled
|
||||
|
||||
Reference in New Issue
Block a user