155 lines
4.4 KiB
C++
155 lines
4.4 KiB
C++
#ifndef TEXTEDITOPTION_H
|
|
#define TEXTEDITOPTION_H
|
|
|
|
#include <QWidget>
|
|
#include <QTextEdit>
|
|
#include <QMessageBox>
|
|
#include <QFileDialog>
|
|
#include <QTextCharFormat>
|
|
#include "ParaSettingUI.h"
|
|
#include "MyFileDialog.h"
|
|
#include <QComboBox>
|
|
#include <QPushButton>
|
|
#include <QCheckBox>
|
|
#include "DialogFileOperation.h"
|
|
#include "DialogInsertVari.h"
|
|
#include "DialogFontSize.h"
|
|
#include "DialogLineSpace.h"
|
|
#include "PicWidget.h"
|
|
#include <QtGui/QStackedWidget>
|
|
#include "dlgQrCode.h"
|
|
#include "QBarCode.h"
|
|
#include "DialogSaveFile.h"
|
|
namespace Ui {
|
|
class TextEditOption;
|
|
}
|
|
|
|
class TextEditOption : public QWidget,public ParaSettingUI
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit TextEditOption(QWidget *parent = 0);
|
|
~TextEditOption();
|
|
void updateSysParaToUI();
|
|
void bindText(QTextEdit *textEdit);
|
|
|
|
QLabel *getLabelFontSize();
|
|
QPushButton *getPushButtonPreview();
|
|
QCheckBox *getCheckBoxBold();
|
|
void setFontFormat();
|
|
void onbuttonOpenclicked();
|
|
void bindPicWidget(PicWidget *picwidget);
|
|
void editItemModeDone();
|
|
|
|
void bindStackWidget(QStackedWidget *stackedWidgetOption,QStackedWidget *stackedWidgetText);
|
|
int editMode;
|
|
bool sceneEditItem;
|
|
QString fileName;
|
|
void InsertBarCodeToEdit(QString barCodeName,int width,int height);
|
|
void InsertBarCodeToEdit(QString barCodeName,int width,int height,int EnSave);
|
|
void InsertQRCodeToEdit(QString barCodeName,int width,int height );
|
|
void InsertQRCodeToEdit(QString barCodeName,int width,int height ,int EnSave);
|
|
void modbus_insert_pic(QString filename);
|
|
dlgQrCode *dlgQrcode;
|
|
QBarCode *barcode;
|
|
QLabel * getLabelFontFamily();
|
|
int barVarHeight,barVarWidth;
|
|
QFont barVarFont;
|
|
QTextCharFormat fmt;
|
|
QTextEdit *textEdit;
|
|
|
|
void bindSysPara(SysPara *sysPara);
|
|
DialogFontSize *dialogFontSize;
|
|
void updateFileVariWidth(QString &str);
|
|
int getSingleDigitWidth(int);
|
|
int getVariableHight(int);
|
|
void updateNormalVarWidth(QString&,const QString&);
|
|
void updateProduceDateVarWidth(QString &,const QString,int);
|
|
int getDateVarWidth(int height,int);
|
|
public slots:
|
|
void on_bottonSave_clicked();
|
|
void currentCharFormatChanged(const QTextCharFormat &format);
|
|
void onMbSetLineAndChar(int line_space, int char_space);
|
|
void onOpenNewFile();
|
|
void updateSysParaToZero();
|
|
void SetHiddenValue(bool);
|
|
void onFileOpen(QString filePath,bool insertFlag);
|
|
private slots:
|
|
void onQRCodeClose();
|
|
void onBarCodeClose(); // barDlgClose
|
|
void showDlg();
|
|
|
|
void enableButtonSave();
|
|
/*--------------因为按钮被取消,功能消失-------------------------*/
|
|
void onbottonInsertImgclicked();
|
|
void onInsertImgFIle_select(); //选则文件后
|
|
void onbottonInsertTextclicked();
|
|
void onInsertTextFIle_select(); //选则文件后
|
|
|
|
void onOpenFIle_select(); //选则文件后
|
|
/*-----------------------------------------------------------*/
|
|
void on_buttonSaveAS_clicked();
|
|
void onSaveAS_FIle_select(); //选则文件后
|
|
|
|
void onSave_File_reject();
|
|
void on_bottonNew_pressed();
|
|
|
|
void on_buttonInsertVari_pressed();
|
|
|
|
void on_pushButtonFile_pressed();
|
|
|
|
void on_buttonSelectFont_pressed();
|
|
|
|
void on_checkBoxBold_released();
|
|
void on_buttonLineSpace_clicked();
|
|
#ifdef EnableArabic
|
|
void changeArabicPage(int);
|
|
void swithchEnglisOrArabic(bool);
|
|
#endif
|
|
Q_SIGNALS:
|
|
void fileNameChanged(QString);
|
|
void PicfileNameOpen(QString,bool);
|
|
void scenefileOpen(QString,bool);
|
|
void editItemDone();
|
|
void fontSizeChange(int);
|
|
void switchBengalLanguage(bool);
|
|
|
|
signals:
|
|
#ifdef EnableArabic
|
|
void fontSizeArabicSelect(bool);
|
|
void EnableSwitchArabicFlag(bool);
|
|
#endif
|
|
protected slots:
|
|
void onSaveASFile(QString filename, bool Flag);
|
|
void onEditItemMode();
|
|
private:
|
|
Ui::TextEditOption *ui;
|
|
QStackedWidget *stackedWidgetOption;
|
|
QStackedWidget *stackedWidgetText;
|
|
|
|
// QTextEdit *textEdit;
|
|
PicWidget *picwidget;
|
|
|
|
void saveFile();
|
|
MyFileDialog *fileDialog;
|
|
bool maybeSave();
|
|
void openFIle(QString fileName);
|
|
void mergeFormatOnWordOrSelection(const QTextCharFormat &format);
|
|
|
|
|
|
bool newFileAppending;
|
|
void checkNewFileAppending();
|
|
void onDialogLineSpaceAccepted();
|
|
|
|
DialogFileOperation *dialogFileOperation;
|
|
DialogInsertVari *dialogInsertVari;
|
|
DialogLineSpace *dialogLineSpace;
|
|
#ifdef MYSAVEFILEDLG
|
|
DialogSaveFile *dialogSaveFile;
|
|
#endif
|
|
};
|
|
|
|
#endif // TEXTEDITOPTION_H
|