123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- #ifndef QWORD_H
- #define QWORD_H
- #include <QtGlobal>
- #ifdef Q_OS_WIN
- #define _WIN32_DCOM
- #include <QMainWindow>
- #include "qmainwindow.h"
- #include <QString>
- #include <QVariant>
- #include <ActiveQt/QAxObject>
- #include <ActiveQt/QAxWidget>
- #include "objbase.h"
- class QWord : public QObject
- {
- Q_OBJECT
- public:
- QWord(QObject *parent = 0);
- ~QWord();
- public:
- QAxObject *getDocuments() { return m_documents; }
- QAxObject *getDocument() { return m_document; }
- QAxObject *getWordApp() { return m_word; }
- public:
-
-
-
- void save();
- void close();
- void saveAs();
- bool createWord(QString reportname);
- void openWord();
- bool createNewWord(const QString &filePath);
- void setTableAutoFitBehavior(int flag);
- void setPageOrientation(int flag);
- void setWordPageView(
- int flag);
- void setFontSize(int fontsize);
- void setFontName(const QString &fontName);
- void setFontBold(bool flag);
- void setParagraphAlignment(int flag);
- void setRowAlignment(int tableIndex, int row, int flag);
-
- void setColumnWidth(int column, int width);
- void setColumnHeight(int column, int height);
- void setRowHeight(int nTable, int Row, int height);
- void setCellString(int row, int column, const QString &text);
- void setCellFontBold(int row, int column, bool isBold);
- void setCellFontSize(int row, int column, int size);
- void setOptionCheckSpell(bool flags);
- QString GetText();
- void getUsedRange(int *topLeftRow, int *topLeftColumn, int *bottomRightRow, int *bottomRightColumn);
- void setSelectionRange(int start, int end);
- QVariant getCellValue(int row, int column);
- int getTableCount();
- QString getStrErrorInfo()
- {
- return m_strError;
- }
- void deleteSelectColumn(int column);
- void moveForEnd();
- void insertCellPic(int row, int column, const QString &picPath);
- void intsertTable(int row, int column);
- void insertMoveDown();
- void insertText(const QString &text);
- void insertTable(int tableIndex, int row, int column);
-
-
- void MergeCells(int tableIndex, int nStartRow, int nStartCol, int nEndRow, int nEndCol);
- bool open(const QString &strFilePath, bool bVisable);
- bool openword(bool bVisable);
- bool isOpen();
- void setColumnWidth(int nTable, int column, int width);
- void setCellString(int nTable, int row, int column, const QString &text);
- void insertCellPic(int nTable, int row, int column, const QString &picPath);
- void setCellFontBold(int nTable, int row, int column, bool isBold);
- void setCellFontSize(int nTable, int row, int column, int size);
-
- void addTableRow(int tableIndex, int nRow, int rowCount);
- void setColumnHeight(int nTable, int column, int height);
- void intsertTable(int tableIndex, int row, int column);
- public:
- void setVisible(bool isVisible);
- private:
- QAxObject *m_word;
- QAxObject *m_documents;
- QAxObject *m_document;
- QString m_fileName;
- QString m_saveName;
- QString m_strError;
- QString m_strFilePath;
- bool m_bOpened;
- };
- #endif
- #endif
|