2009-10-24 16:15:28 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file GuiCompare.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Vincent van Ravesteijn
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GUICOMPARE_H
|
|
|
|
#define GUICOMPARE_H
|
|
|
|
|
|
|
|
#include "GuiDialog.h"
|
|
|
|
|
2010-10-18 14:20:03 +00:00
|
|
|
#include "ui_CompareUi.h"
|
2009-10-25 13:41:46 +00:00
|
|
|
|
2009-10-24 16:15:28 +00:00
|
|
|
namespace lyx {
|
2010-10-18 14:20:03 +00:00
|
|
|
|
|
|
|
class Compare;
|
|
|
|
|
2009-10-24 16:15:28 +00:00
|
|
|
namespace frontend {
|
|
|
|
|
|
|
|
|
|
|
|
class GuiCompare : public GuiDialog, public Ui::CompareUi
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
GuiCompare(GuiView & lv);
|
|
|
|
~GuiCompare();
|
|
|
|
|
|
|
|
void closeEvent(QCloseEvent *);
|
2017-07-03 17:45:58 +00:00
|
|
|
|
2009-10-24 16:15:28 +00:00
|
|
|
private Q_SLOTS:
|
|
|
|
///
|
|
|
|
void slotOK();
|
|
|
|
///
|
|
|
|
void slotCancel();
|
|
|
|
///
|
2009-10-24 17:04:09 +00:00
|
|
|
void changeAdaptor();
|
2009-10-24 16:15:28 +00:00
|
|
|
///
|
2009-10-24 17:04:09 +00:00
|
|
|
void selectNewFile();
|
2009-10-24 16:15:28 +00:00
|
|
|
///
|
2009-10-24 17:04:09 +00:00
|
|
|
void selectOldFile();
|
2009-10-24 16:15:28 +00:00
|
|
|
|
2009-10-25 13:41:46 +00:00
|
|
|
///
|
|
|
|
void error();
|
2009-10-24 16:15:28 +00:00
|
|
|
///
|
|
|
|
void finished(bool aborted);
|
|
|
|
///
|
2009-10-25 13:41:46 +00:00
|
|
|
void progress(int);
|
2009-10-24 16:15:28 +00:00
|
|
|
///
|
2009-10-24 17:04:09 +00:00
|
|
|
void progressMax(int) const;
|
2010-01-14 00:41:47 +00:00
|
|
|
///
|
|
|
|
void setStatusMessage(QString);
|
2009-10-24 16:15:28 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
///
|
|
|
|
void updateContents();
|
|
|
|
///
|
|
|
|
bool isValid();
|
|
|
|
///
|
2010-09-07 11:29:02 +00:00
|
|
|
bool initialiseParams(std::string const &);
|
2009-10-24 16:15:28 +00:00
|
|
|
///
|
|
|
|
bool isBufferDependent() const { return false; }
|
|
|
|
///
|
|
|
|
void clearParams() {}
|
|
|
|
///
|
|
|
|
void dispatchParams() {}
|
|
|
|
///
|
|
|
|
void apply() {}
|
|
|
|
|
|
|
|
|
|
|
|
/// enable or disable all controls and rename the Close/Cancel button
|
2010-01-14 01:20:14 +00:00
|
|
|
void enableControls(bool enable);
|
2017-07-03 17:45:58 +00:00
|
|
|
|
2009-10-24 16:15:28 +00:00
|
|
|
/// browse for a file
|
|
|
|
QString browse(QString const & in_name) const;
|
|
|
|
/// retrieve the buffer from the specified filename
|
|
|
|
Buffer const * bufferFromFileName(std::string const & file) const;
|
|
|
|
|
|
|
|
/// create the compare object and run the comparison
|
|
|
|
int run();
|
|
|
|
|
|
|
|
private:
|
2009-10-25 13:41:46 +00:00
|
|
|
/// the object that will do the comparison
|
|
|
|
Compare * compare_;
|
|
|
|
|
2009-10-24 16:15:28 +00:00
|
|
|
/// the buffer that will contain the result
|
|
|
|
Buffer * dest_buffer_;
|
|
|
|
/// the buffer that will contain the result
|
|
|
|
Buffer const * old_buffer_;
|
|
|
|
/// the buffer that will contain the result
|
|
|
|
Buffer const * new_buffer_;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
#endif // GUICOMPARE_H
|