parts/diff/diffpart.h
Go to the documentation of this file.00001 /*************************************************************************** 00002 * Copyright (C) 2001 by Harald Fernengel * 00003 * harry@kdevelop.org * 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 _DIFFPART_H_ 00013 #define _DIFFPART_H_ 00014 00015 #include <qguardedptr.h> 00016 #include <qcstring.h> 00017 00018 #include "kdevplugin.h" 00019 #include "kdevdifffrontend.h" 00020 00021 class KProcess; 00022 class DiffWidget; 00023 class QCString; 00024 00025 class DiffPart : public KDevDiffFrontend 00026 { 00027 Q_OBJECT 00028 00029 public: 00030 DiffPart( QObject *parent, const char *name, const QStringList & ); 00031 virtual ~DiffPart(); 00032 00033 void openURL( const KURL& url ); 00034 void showDiff( const QString& diff ); 00035 void showDiff( const KURL &, const KURL & ) { } 00036 00037 public slots: 00038 void slotExecDiff(); 00039 00040 private slots: 00041 void contextMenu( QPopupMenu* popup, const Context* context ); 00042 void localDiff(); 00043 void processExited( KProcess* p ); 00044 void receivedStdout( KProcess* p, char* buf, int buflen ); 00045 void receivedStderr( KProcess* p, char* buf, int buflen ); 00046 void wroteStdin( KProcess* p ); 00047 00048 private: 00049 QGuardedPtr<DiffWidget> diffWidget; 00050 KURL popupFile; 00051 KProcess* proc; 00052 QCString buffer; 00053 QString resultBuffer; 00054 QString resultErr; 00055 }; 00056 00057 #endif