Commit 58111b2d authored by Friedemann Kleint's avatar Friedemann Kleint

API Documentation: Add VCSBase.

parent 34a96d88
...@@ -108,6 +108,10 @@ ...@@ -108,6 +108,10 @@
\o \l{Debugger} \o \l{Debugger}
\o Debugging functionality. \o Debugging functionality.
\row
\o \l{VCSBase}
\o Base classes for version control support.
\endtable \endtable
*/ */
......
...@@ -14,7 +14,8 @@ headerdirs = . \ ...@@ -14,7 +14,8 @@ headerdirs = . \
../../src/plugins/coreplugin \ ../../src/plugins/coreplugin \
../../src/plugins/find \ ../../src/plugins/find \
../../src/plugins/locator \ ../../src/plugins/locator \
../../src/plugins/debugger ../../src/plugins/debugger \
../../src/plugins/vcsbase
sourcedirs = . \ sourcedirs = . \
../../src/libs/aggregation \ ../../src/libs/aggregation \
...@@ -25,7 +26,8 @@ sourcedirs = . \ ...@@ -25,7 +26,8 @@ sourcedirs = . \
../../src/plugins/coreplugin \ ../../src/plugins/coreplugin \
../../src/plugins/find \ ../../src/plugins/find \
../../src/plugins/locator \ ../../src/plugins/locator \
../../src/plugins/debugger ../../src/plugins/debugger \
../../src/plugins/vcsbase
# -- Generate complete documentation. Set this to 'false' # -- Generate complete documentation. Set this to 'false'
# to generate public API documentation only. # to generate public API documentation only.
......
...@@ -43,6 +43,19 @@ ...@@ -43,6 +43,19 @@
typedef QMap<QString, QTextCharFormat> ChangeNumberFormatMap; typedef QMap<QString, QTextCharFormat> ChangeNumberFormatMap;
/*!
\class VCSBase::BaseAnnotationHighlighter
\brief Base for a highlighter for annotation lines of the form 'changenumber:XXXX'.
The change numbers are assigned a color gradient. Example:
\code
112: text1 <color 1>
113: text2 <color 2>
112: text3 <color 1>
\endcode
*/
namespace VCSBase { namespace VCSBase {
struct BaseAnnotationHighlighterPrivate { struct BaseAnnotationHighlighterPrivate {
......
...@@ -42,12 +42,6 @@ namespace VCSBase { ...@@ -42,12 +42,6 @@ namespace VCSBase {
struct BaseAnnotationHighlighterPrivate; struct BaseAnnotationHighlighterPrivate;
// Base for a highlighter for annotation lines of the form
// 'changenumber:XXXX'. The change numbers are assigned a color gradient.
// Example:
// 112: text1 <color 1>
// 113: text2 <color 2>
// 112: text3 <color 1>
class VCSBASE_EXPORT BaseAnnotationHighlighter : public TextEditor::SyntaxHighlighter class VCSBASE_EXPORT BaseAnnotationHighlighter : public TextEditor::SyntaxHighlighter
{ {
Q_OBJECT Q_OBJECT
......
...@@ -43,6 +43,27 @@ ...@@ -43,6 +43,27 @@
#include <QtCore/QDir> #include <QtCore/QDir>
#include <QtGui/QMessageBox> #include <QtGui/QMessageBox>
/*!
\class VCSBase::BaseCheckoutWizard
\brief A Core::IWizard implementing a wizard for initially checking out a project using
a version control system.
Implements all of Core::IWizard with the exception of
name()/description() and icon().
Pops up a QWizard consisting of a Parameter Page which is created
by a virtual factory function and a progress
page containing a log text. The factory function createJob()
creates a job with the output connected to the log window,
returning the path to the checkout.
On success, the wizard tries to locate a project file
and open it.
\sa VCSBase::BaseCheckoutWizardPage
*/
namespace VCSBase { namespace VCSBase {
struct BaseCheckoutWizardPrivate { struct BaseCheckoutWizardPrivate {
......
...@@ -49,20 +49,6 @@ namespace VCSBase { ...@@ -49,20 +49,6 @@ namespace VCSBase {
class AbstractCheckoutJob; class AbstractCheckoutJob;
struct BaseCheckoutWizardPrivate; struct BaseCheckoutWizardPrivate;
/* A Core::IWizard implementing a wizard for initially checking
* out a project using a version control system.
* Implements all of Core::IWizard with the exception of
* name()/description() and icon().
* Pops up a QWizard consisting of a Parameter Page which is created
* by a virtual factory function and a progress
* page containing a log text. The factory function createJob()
* creates a job with the output connected to the log window,
* returning the path to the checkout.
* On success, the wizard tries to locate a project file
* and open it.
* BaseCheckoutWizardPage is provided as a convenience base class
* for parameter wizard pages. */
class VCSBASE_EXPORT BaseCheckoutWizard : public Core::IWizard class VCSBASE_EXPORT BaseCheckoutWizard : public Core::IWizard
{ {
Q_OBJECT Q_OBJECT
......
...@@ -36,6 +36,18 @@ ...@@ -36,6 +36,18 @@
#include <QtGui/QIcon> #include <QtGui/QIcon>
/*!
\class VCSBase::BaseCheckoutWizardPage
\brief Base class for a parameter page of a checkout wizard.
Lets the user specify the repository, a checkout directory and
the path. Contains a virtual to derive the checkout directory
from the repository as it is entered.
\sa VCSBase::BaseCheckoutWizard
*/
namespace VCSBase { namespace VCSBase {
struct BaseCheckoutWizardPagePrivate { struct BaseCheckoutWizardPagePrivate {
......
...@@ -46,11 +46,6 @@ namespace Ui { ...@@ -46,11 +46,6 @@ namespace Ui {
struct BaseCheckoutWizardPagePrivate; struct BaseCheckoutWizardPagePrivate;
/* Base class for a parameter page of a checkout wizard.
* Let's the user specify the repository, a checkout directory and
* the path. Contains a virtual to derive the checkout directory
* from the repository as it is entered. */
class VCSBASE_EXPORT BaseCheckoutWizardPage : public QWizardPage { class VCSBASE_EXPORT BaseCheckoutWizardPage : public QWizardPage {
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool isBranchSelectorVisible READ isBranchSelectorVisible WRITE setBranchSelectorVisible) Q_PROPERTY(bool isBranchSelectorVisible READ isBranchSelectorVisible WRITE setBranchSelectorVisible)
......
...@@ -41,6 +41,14 @@ ...@@ -41,6 +41,14 @@
#include <QtCore/QCoreApplication> #include <QtCore/QCoreApplication>
/*!
\class VCSBase::BaseVCSEditorFactory
\brief Base class for editor factories creating instances of VCSBaseEditor subclasses.
\sa VCSBase::VCSBaseEditorWidget
*/
namespace VCSBase { namespace VCSBase {
struct BaseVCSEditorFactoryPrivate struct BaseVCSEditorFactoryPrivate
......
...@@ -45,8 +45,6 @@ namespace VCSBase { ...@@ -45,8 +45,6 @@ namespace VCSBase {
struct BaseVCSEditorFactoryPrivate; struct BaseVCSEditorFactoryPrivate;
// Base class for editor factories creating instances of VCSBaseEditor
// subclasses.
class VCSBASE_EXPORT BaseVCSEditorFactory : public Core::IEditorFactory class VCSBASE_EXPORT BaseVCSEditorFactory : public Core::IEditorFactory
{ {
Q_OBJECT Q_OBJECT
......
...@@ -43,6 +43,16 @@ ...@@ -43,6 +43,16 @@
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
enum { debug = 0 }; enum { debug = 0 };
/*!
\class VCSBase::AbstractCheckoutJob
\brief Abstract base class for a job creating an initial project checkout.
It should be something that runs in the background producing log messages.
\sa VCSBase::BaseCheckoutWizard
*/
namespace VCSBase { namespace VCSBase {
AbstractCheckoutJob::AbstractCheckoutJob(QObject *parent) : AbstractCheckoutJob::AbstractCheckoutJob(QObject *parent) :
...@@ -82,6 +92,12 @@ static inline QSharedPointer<QProcess> createProcess() ...@@ -82,6 +92,12 @@ static inline QSharedPointer<QProcess> createProcess()
return Utils::SynchronousProcess::createProcess(flags); return Utils::SynchronousProcess::createProcess(flags);
} }
/*!
\class VCSBase::ProcessCheckoutJob
\brief Convenience implementation of a VCSBase::AbstractCheckoutJob using a QProcess.
*/
ProcessCheckoutJobPrivate::ProcessCheckoutJobPrivate() : ProcessCheckoutJobPrivate::ProcessCheckoutJobPrivate() :
process(createProcess()) process(createProcess())
{ {
......
...@@ -70,8 +70,6 @@ signals: ...@@ -70,8 +70,6 @@ signals:
void output(const QString &what); void output(const QString &what);
}; };
/* Convenience implementation using a QProcess. */
class VCSBASE_EXPORT ProcessCheckoutJob : public AbstractCheckoutJob class VCSBASE_EXPORT ProcessCheckoutJob : public AbstractCheckoutJob
{ {
Q_OBJECT Q_OBJECT
......
...@@ -40,6 +40,15 @@ ...@@ -40,6 +40,15 @@
#include <QtGui/QApplication> #include <QtGui/QApplication>
#include <QtGui/QCursor> #include <QtGui/QCursor>
/*!
\class VCSBase::CheckoutProgressWizardPage
\brief Page showing the progress of an initial project checkout. Turns complete when the job
succeeds.
\sa VCSBase::BaseCheckoutWizard
*/
namespace VCSBase { namespace VCSBase {
namespace Internal { namespace Internal {
......
...@@ -46,9 +46,6 @@ namespace Ui { ...@@ -46,9 +46,6 @@ namespace Ui {
class CheckoutProgressWizardPage; class CheckoutProgressWizardPage;
} }
/* Page showing the progress of an initial project
* checkout. Turns complete when the job succeeds. */
class CheckoutProgressWizardPage : public QWizardPage { class CheckoutProgressWizardPage : public QWizardPage {
Q_OBJECT Q_OBJECT
Q_DISABLE_COPY(CheckoutProgressWizardPage) Q_DISABLE_COPY(CheckoutProgressWizardPage)
......
...@@ -40,6 +40,13 @@ ...@@ -40,6 +40,13 @@
#include <QtGui/QPushButton> #include <QtGui/QPushButton>
/*!
\class VCSBase::Internal::CheckoutWizardDialog
Dialog used by \sa VCSBase::BaseCheckoutWizard. Overwrites reject() to first
kill the checkout and then close.
*/
namespace VCSBase { namespace VCSBase {
namespace Internal { namespace Internal {
......
...@@ -44,10 +44,6 @@ class AbstractCheckoutJob; ...@@ -44,10 +44,6 @@ class AbstractCheckoutJob;
namespace Internal { namespace Internal {
class CheckoutProgressWizardPage; class CheckoutProgressWizardPage;
/* See BaseCheckoutWizard.
* Overwrites reject() to first kill the checkout
* and then close. */
class CheckoutWizardDialog : public Utils::Wizard { class CheckoutWizardDialog : public Utils::Wizard {
Q_OBJECT Q_OBJECT
public: public:
......
...@@ -53,6 +53,17 @@ ...@@ -53,6 +53,17 @@
#include <QtCore/QFuture> #include <QtCore/QFuture>
#include <QtCore/QtConcurrentRun> #include <QtCore/QtConcurrentRun>
/*!
\class VCSBase::CleanDialog
\brief File selector dialog for files not under version control.
Completely clean a directory under version control
from all files that are not under version control based on a list
generated from the version control system. Presents the user with
a checkable list of files and/or directories. Double click opens a file.
*/
enum { nameColumn, columnCount }; enum { nameColumn, columnCount };
enum { fileNameRole = Qt::UserRole, isDirectoryRole = Qt::UserRole + 1 }; enum { fileNameRole = Qt::UserRole, isDirectoryRole = Qt::UserRole + 1 };
......
...@@ -45,11 +45,6 @@ QT_END_NAMESPACE ...@@ -45,11 +45,6 @@ QT_END_NAMESPACE
namespace VCSBase { namespace VCSBase {
struct CleanDialogPrivate; struct CleanDialogPrivate;
/* CleanDialog: Completely clean a directory under version control
* from all files that are not under version control based on a list
* generated from the version control system. Presents the user with
* a checkable list of files and/or directories. Double click opens a file. */
class VCSBASE_EXPORT CleanDialog : public QDialog { class VCSBASE_EXPORT CleanDialog : public QDialog {
Q_OBJECT Q_OBJECT
public: public:
......
...@@ -34,6 +34,17 @@ ...@@ -34,6 +34,17 @@
#include "corelistener.h" #include "corelistener.h"
#include "vcsbasesubmiteditor.h" #include "vcsbasesubmiteditor.h"
/*!
\class VCSBase::Internal::CoreListener
\brief CoreListener catching closing of a submit editor.
Catch the closing of a submit editor to trigger the submit.
One instance of this class exists, connected to the instances
of VCSBasePlugin, which dispatch if the editor kind matches theirs
(which is why the approach of passing the bool result was chosen).
*/
namespace VCSBase { namespace VCSBase {
namespace Internal { namespace Internal {
......
...@@ -42,11 +42,6 @@ class VCSBaseSubmitEditor; ...@@ -42,11 +42,6 @@ class VCSBaseSubmitEditor;
namespace Internal { namespace Internal {
// Catch the closing of a submit editor to trigger the submit.
// One instance of this class exists, connected to the instances
// of VCSBasePlugin, which dispatch if the editor kind matches theirs
// (which is why the approach of passing the bool result was chosen).
class CoreListener : public Core::ICoreListener class CoreListener : public Core::ICoreListener
{ {
Q_OBJECT Q_OBJECT
...@@ -58,6 +53,6 @@ signals: ...@@ -58,6 +53,6 @@ signals:
void submitEditorAboutToClose(VCSBaseSubmitEditor *e, bool *result); void submitEditorAboutToClose(VCSBaseSubmitEditor *e, bool *result);
}; };
} } // Internal
} } // VCSBase
#endif // CORELISTENER_H #endif // CORELISTENER_H
...@@ -42,6 +42,28 @@ ...@@ -42,6 +42,28 @@
#include <QtCore/QRegExp> #include <QtCore/QRegExp>
#include <QtGui/QBrush> #include <QtGui/QBrush>
/*!
\class VCSBase::DiffHighlighter
\brief A highlighter for diffs.
Parametrizable by the file indicator, which is for example '^====' in case of p4:
\code
==== //depot/research/main/qdynamicmainwindow3/qdynamicdockwidgetlayout_p.h#34 (text) ====
\endcode
Or '--- a/|'+++ b/' in case of git:
\code
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
index 9401ee7..ef35c3b 100644
--- a/src/plugins/plugins.pro
+++ b/src/plugins/plugins.pro
@@ -10,6 +10,7 @@ SUBDIRS = plugin_coreplugin
\endcode
Also highlights trailing blanks.
*/
static const int BASE_LEVEL = 0; static const int BASE_LEVEL = 0;
static const int FILE_LEVEL = 1; static const int FILE_LEVEL = 1;
static const int LOCATION_LEVEL = 2; static const int LOCATION_LEVEL = 2;
......
...@@ -56,21 +56,6 @@ namespace Internal { ...@@ -56,21 +56,6 @@ namespace Internal {
class DiffHighlighterPrivate; class DiffHighlighterPrivate;
} // namespace Internal } // namespace Internal
/* A highlighter for diffs. Parametrizable by the file indicator,
* which is for example '^====' in case of p4:
* \code
==== //depot/research/main/qdynamicmainwindow3/qdynamicdockwidgetlayout_p.h#34 (text) ====
* \endcode
* Or '--- a/|'+++ b/' in case of git:
* \code
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
index 9401ee7..ef35c3b 100644
--- a/src/plugins/plugins.pro
+++ b/src/plugins/plugins.pro
@@ -10,6 +10,7 @@ SUBDIRS = plugin_coreplugin \
* \endcode
* */
class VCSBASE_EXPORT DiffHighlighter : public TextEditor::SyntaxHighlighter class VCSBASE_EXPORT DiffHighlighter : public TextEditor::SyntaxHighlighter
{ {
Q_OBJECT Q_OBJECT
......
...@@ -43,6 +43,18 @@ ...@@ -43,6 +43,18 @@
enum { NickNameRole = Qt::UserRole + 1 }; enum { NickNameRole = Qt::UserRole + 1 };
/*!
\class VCSBase::Internal::NickNameDialog
\brief Show users from mail cap file.
Manages a list of users read from an extended
mail cap file, consisting of 4 columns: "Name Mail [AliasName [AliasMail]]".
The names can be used for insertion into "RevBy:" fields; aliases will
be preferred.
*/
namespace VCSBase { namespace VCSBase {
namespace Internal { namespace Internal {
......
...@@ -49,12 +49,6 @@ QT_END_NAMESPACE ...@@ -49,12 +49,6 @@ QT_END_NAMESPACE
namespace VCSBase { namespace VCSBase {
namespace Internal { namespace Internal {
/* Nick name dialog: Manages a list of users read from an extended
* mail cap file, consisting of 4 columns:
* "Name Mail [AliasName [AliasMail]]".
* The names can be used for insertion into "RevBy:" fields; aliases will
* be preferred. */
class NickNameDialog : public QDialog { class NickNameDialog : public QDialog {
Q_OBJECT Q_OBJECT
public: public:
......
...@@ -36,6 +36,12 @@ ...@@ -36,6 +36,12 @@
using namespace VCSBase; using namespace VCSBase;
using namespace VCSBase::Internal; using namespace VCSBase::Internal;
/*!
\class VCSBase::Internal::SubmitEditorFile
\brief A non-saveable IFile for submit editor files.
*/
SubmitEditorFile::SubmitEditorFile(const QString &mimeType, QObject *parent) : SubmitEditorFile::SubmitEditorFile(const QString &mimeType, QObject *parent) :
Core::IFile(parent), Core::IFile(parent),
m_mimeType(mimeType), m_mimeType(mimeType),
......
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
namespace VCSBase { namespace VCSBase {
namespace Internal { namespace Internal {
// A non-saveable IFile for submit editor files.
class SubmitEditorFile : public Core::IFile class SubmitEditorFile : public Core::IFile
{ {
Q_OBJECT Q_OBJECT
......
...@@ -39,6 +39,13 @@ ...@@ -39,6 +39,13 @@
namespace VCSBase { namespace VCSBase {
/*!
\class VCSBase::SubmitFileModel
\brief A 2-column (checkable, state, file name) model to be used to list the files
in the submit editor. Provides header items and a convience to add files.
*/
SubmitFileModel::SubmitFileModel(QObject *parent) : SubmitFileModel::SubmitFileModel(QObject *parent) :
QStandardItemModel(0, 2, parent) QStandardItemModel(0, 2, parent)
{ {
......
...@@ -40,9 +40,6 @@ ...@@ -40,9 +40,6 @@
namespace VCSBase { namespace VCSBase {
/* A 2-column (checkable, state, file name) model to be used to list the files-
* in the submit editor. Provides header items and a convience to add files. */
class VCSBASE_EXPORT SubmitFileModel : public QStandardItemModel class VCSBASE_EXPORT SubmitFileModel : public QStandardItemModel
{ {
Q_OBJECT Q_OBJECT
......
...@@ -56,6 +56,16 @@ ...@@ -56,6 +56,16 @@
#include <QtCore/QByteArray> #include <QtCore/QByteArray>
#include <QtCore/QMetaType> #include <QtCore/QMetaType>
/*!
\class VCSBase::VCSBaseClient
\brief Base class for Mercurial and Bazaar 'clients'.
Provides base functionality for common commands (diff, log, etc).
\sa VCSBase::VCSJobRunner
*/
Q_DECLARE_METATYPE(QVariant) Q_DECLARE_METATYPE(QVariant)
inline Core::IEditor *locateEditor(const Core::ICore *core, const char