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();
|
|
|
|
|
2020-10-03 15:42:14 +03:00
|
|
|
void closeEvent(QCloseEvent *) override;
|
2017-07-03 13:45:58 -04:00
|
|
|
|
2009-10-24 16:15:28 +00:00
|
|
|
private Q_SLOTS:
|
|
|
|
///
|
|
|
|
void slotOK();
|
|
|
|
///
|
|
|
|
void slotCancel();
|
|
|
|
///
|
2018-07-08 16:35:38 +02:00
|
|
|
void slotButtonBox(QAbstractButton *);
|
|
|
|
///
|
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
|
|
|
///
|
2020-10-31 15:09:46 +02:00
|
|
|
void setStatusMessage(QString const &);
|
2009-10-24 16:15:28 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
void updateContents() override;
|
2009-10-24 16:15:28 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
bool isValid() override;
|
2009-10-24 16:15:28 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
bool initialiseParams(std::string const &) override;
|
2009-10-24 16:15:28 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
bool isBufferDependent() const override { return false; }
|
2009-10-24 16:15:28 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
void clearParams() override {}
|
2009-10-24 16:15:28 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
void dispatchParams() override {}
|
2009-10-24 16:15:28 +00:00
|
|
|
///
|
2020-10-01 10:42:11 +03:00
|
|
|
void apply() override {}
|
2009-10-24 16:15:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
/// 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 13:45:58 -04: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
|
2020-11-13 20:58:20 +13:00
|
|
|
/// if blocking_mode is true, run should execute so that the caller can block to wait for the results
|
|
|
|
int run(bool blocking_mode = false);
|
2009-10-24 16:15:28 +00:00
|
|
|
|
|
|
|
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
|