KDevelop API Documentation

cvspartimpl.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2003 by Mario Scalas                                    *
00003  *   mario.scalas@libero.it                                                *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  ***************************************************************************/
00011 
00012 #ifndef CVSPARTIMPL_H
00013 #define CVSPARTIMPL_H
00014 
00015 #include <qobject.h>
00016 #include <qstringlist.h>
00017 #include <qguardedptr.h>
00018 #include <kurl.h>
00019 
00020 #include <kdevversioncontrol.h>
00021 #include <kdevvcsfileinfoprovider.h>
00022 
00023 class CvsServicePart;
00024 class KDialogBase;
00025 class KURL;
00026 class KURL::List;
00027 class CvsProcessWidget;
00028 class KDevMainWindow;
00029 class KDevCore;
00030 class KDevDiffFrontend;
00031 class QDir;
00032 class JobScheduler;
00033 class KDevVCSFileInfoProvider;
00034 class CVSFileInfoProvider;
00035 
00046 class CvsServicePartImpl : public QObject
00047 {
00048     friend class CvsServicePart;
00049 
00050     Q_OBJECT
00051 public:
00053     enum CvsOperation
00054     {
00055         opFakeStub, opAdd, opCommit, opUpdate, opRevert, opRemove, opLog, opDiff, opTag, opUnTag
00056     };
00057 
00063     CvsServicePartImpl( CvsServicePart *part, const char *name=0 );
00067     virtual ~CvsServicePartImpl();
00068 
00073     virtual void login();
00077     virtual void logout();
00083     virtual bool checkout();
00088     virtual void commit( const KURL::List& urlList );
00094     virtual void update( const KURL::List& urlList );
00100     virtual void add( const KURL::List& urlList, bool binary = false );
00105     virtual void remove( const KURL::List& urlList );
00110     virtual void log( const KURL::List& urlList );
00116     virtual void diff( const KURL::List& urlList );
00121     virtual void tag( const KURL::List& urlList );
00126     virtual void unTag( const KURL::List& urlList );
00131     virtual void removeStickyFlag( const KURL::List& urlList );
00136     virtual void addToIgnoreList( const KURL::List& urlList );
00141     virtual void removeFromIgnoreList( const KURL::List& urlList );
00155     virtual void createNewProject( const QString &dirName,
00156         const QString &cvsRsh, const QString &location,
00157         const QString &message, const QString &module, const QString &vendor,
00158         const QString &release, bool mustInitRoot );
00159 
00163     virtual bool isValidDirectory( const QDir &dir ) const;
00167     KDevVCSFileInfoProvider *fileInfoProvider() const;
00168 
00169 
00170 // Helpers
00171 public:
00176     void flushJobs();
00182     CvsProcessWidget *processWidget() const;
00183 
00184 signals:
00185     void warning( const QString &msg );
00191     void checkoutFinished( QString checkedDir );
00192 
00193 private slots:
00194     void slotJobFinished( bool normalExit, int exitStatus );
00195     void slotDiffFinished( bool normalExit, int exitStatus );
00196     void slotCheckoutFinished( bool normalExit, int exitStatus );
00197     void slotProjectOpened();
00198 
00199 private:
00209     bool prepareOperation( const KURL::List &someUrls, CvsOperation op );
00214     void doneOperation( const KURL::List &someUrls = KURL::List(), CvsOperation op = opFakeStub );
00215 
00216     void emitFileStateModified( const KURL::List &urls, VCSFileInfo::FileState &commonState );
00217 
00221     static bool isRegisteredInRepository( const QString &projectDirectory, const KURL &url );
00230     static void validateURLs( const QString &projectDirectory, KURL::List &urls, CvsOperation op );
00231 
00239     static void addToIgnoreList( const QString &projectDirectory, const KURL &url );
00240 
00248     static void addToIgnoreList( const QString &projectDirectory, const KURL::List &urls );
00249 
00259     static void removeFromIgnoreList( const QString &projectDirectory, const KURL &url );
00260 
00270     static void removeFromIgnoreList( const QString &projectDirectory, const KURL::List &urls );
00274     void addFilesToProject( const QStringList &filesToAdd );
00278     void removedFilesFromProject(const QStringList &filesToRemove);
00284     QStringList checkFileListAgainstCVS( const QStringList &filesToCheck ) const;
00285 
00287     static const QString changeLogFileName;
00290     static const QString changeLogPrependString;
00291 
00292     // Internal short-cuts
00293     KDevMainWindow *mainWindow() const;
00294     KDevCore *core() const;
00295     QString projectDirectory() const;
00296     KDevDiffFrontend *diffFrontend() const;
00297 
00299     bool requestCvsService();
00301     void releaseCvsService();
00302 
00303     CvsService_stub *m_cvsService;
00304     Repository_stub *m_repository;
00305 
00307     QString modulePath;
00308 
00309     CVSFileInfoProvider *m_fileInfoProvider;
00310     JobScheduler *m_scheduler;
00312     CvsServicePart *m_part;
00313 
00316     QGuardedPtr<CvsProcessWidget> m_widget;
00317 
00319     const KURL::List &urlList() const;
00326     QStringList fileList( bool relativeToProjectDir = true ) const;
00328     CvsOperation lastOperation() const;
00329 
00330     // Both this data members are set by prepareOperation() method
00331     KURL::List m_urlList;
00332     CvsOperation m_lastOperation;
00333 };
00334 
00335 #endif
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Feb 22 09:22:43 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003