1 /***************************************************************************
2 * Copyright (C) 2009 by Peter Penz <peter.penz@gmx.at> *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
20 #ifndef REVISIONCONTROLPLUGIN_H
21 #define REVISIONCONTROLPLUGIN_H
23 #include <libdolphin_export.h>
28 * @brief Base class for revision control plugins.
30 * Enables the file manager to show the revision state
31 * of a revisioned file.
33 class LIBDOLPHINPRIVATE_EXPORT RevisionControlPlugin
50 RevisionControlPlugin();
51 virtual ~RevisionControlPlugin();
54 * Returns the name of the file which stores
55 * the revision control informations.
56 * (e. g. .svn, .cvs, .git).
58 virtual QString
fileName() const = 0;
61 * Is invoked whenever the revision control
62 * information will get retrieved for the directory
63 * \p directory. It is assured that the directory
64 * contains a trailing slash.
66 virtual bool beginRetrieval(const QString
& directory
) = 0;
69 * Is invoked after the revision control information has been
70 * received. It is assured that
71 * RevisionControlPlugin::beginInfoRetrieval() has been
74 virtual void endRetrieval() = 0;
77 * Returns the revision state for the file with the name \p fileName.
78 * It is assured that RevisionControlPlugin::beginInfoRetrieval() has been
79 * invoked before and that the file is part of the directory specified
80 * in beginInfoRetrieval().
82 virtual RevisionState
revisionState(const QString
& name
, ItemType type
) = 0;
89 // TODO: This is just a temporary test class. It will be made available as
90 // plugin outside Dolphin later.
92 #include <QFileInfoList>
95 class LIBDOLPHINPRIVATE_EXPORT SubversionPlugin
: public RevisionControlPlugin
99 virtual ~SubversionPlugin();
100 virtual QString
fileName() const;
101 virtual bool beginRetrieval(const QString
& directory
);
102 virtual void endRetrieval();
103 virtual RevisionControlPlugin::RevisionState
revisionState(const QString
& name
, ItemType type
);
107 QHash
<QString
, QFileInfo
> m_fileInfoHash
;
109 #endif // REVISIONCONTROLPLUGIN_H