formcube.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. #ifndef FORMCUBE_H
  2. #define FORMCUBE_H
  3. #include <QtGui>
  4. #include <QWidget>
  5. #include <QMovie>
  6. #include "SNCCube_global.h"
  7. #include "snccore.h"
  8. #include "numberlistmodel.h"
  9. #include "advertisement.h"
  10. #include "cachewebview.h"
  11. #include "importproxy.h"
  12. #include "numbercreate.h"
  13. #include "numberoutorder.h"
  14. #include "numberprocessorproxy.h"
  15. #include "numberexport.h"
  16. #include "numbercopy.h"
  17. #include "numbermoveproxy.h"
  18. #include "dragdroplistview.h"
  19. #include "imagebutton.h"
  20. namespace Ui {
  21. class FormCube;
  22. }
  23. class SNCCUBESHARED_EXPORT FormCube : public QWidget
  24. {
  25. Q_OBJECT
  26. public:
  27. explicit FormCube(QWidget *parent = 0);
  28. ~FormCube();
  29. private:
  30. Ui::FormCube *ui;
  31. NumberListModel *sourceModel;
  32. NumberListModel *destModel;
  33. NumberListModel *blackListModel;
  34. Advertisement *ad;
  35. QTime execTime;
  36. QMutex mutex;
  37. bool threadsFinished;
  38. NumberMoveDirection moveDirection;
  39. NumberModelType modelType;
  40. QMovie *movie;
  41. CacheWebView *cacheViewSource;
  42. CacheWebView *cacheViewDest;
  43. NumberCreate* numberCreate;
  44. ImportProxy* fileImportProxy;
  45. NumberOutOrder* outOrder;
  46. NumberProcessorProxy* numberProcess;
  47. NumberExport* numberExport;
  48. NumberCopy* numberCopy;
  49. NumberMoveProxy* numberMove;
  50. DragDropListView* ddListView;
  51. QMenu *menuPopup;
  52. //QList<ImageButton*> buttons;
  53. QList<QPushButton*> buttons;
  54. QMap<QString,QString> page_ads;
  55. protected:
  56. void dragEnterEvent(QDragEnterEvent *event);
  57. private:
  58. void buildFromFile(NumberBuildType buildType);
  59. void buildFromSegments(QStringList segments);
  60. void buildFromExtract();
  61. void buildFromInputSegment();
  62. void buildFromImportSegment();
  63. void buildFromPaste();
  64. QStringList extractSegmentFromTxtFile(QString fileName);
  65. void copy();
  66. void copy2();
  67. void clearNumberListModel(NumberListModel *model);
  68. void processNumbers(NumberListModel *model,NumberProcessType processType);
  69. void moveNumberByValue(NumberListModel *fromModel,NumberListModel *toModel,NumberMoveDirection moveDirection);
  70. void moveNumberByType(NumberListModel *fromModel,NumberListModel *toModel,NumberMoveDirection moveDirection);
  71. void moveNumerByAll(NumberListModel *fromModel,NumberListModel *toModel,NumberMoveDirection moveDirection);
  72. void moveNumberByCombo(NumberListModel *fromModel,NumberListModel *toModel,NumberMoveDirection moveDirection);
  73. void filterNumberByRegExp(NumberListModel *fromModel,NumberListModel *toModel,QList<QRegExp> regExpList);
  74. void filterNumberByRange(NumberListModel *fromModel,NumberListModel *toModel,QString start,QString end);
  75. void exportNumbersByALL(NumberListModel *model);
  76. void exportNumbersByBatch(NumberListModel *model);
  77. void exportNumbersByCorp(NumberListModel *model);
  78. void exportNumbersBySegment(NumberListModel *model);
  79. void exportNumbersByTimes(NumberListModel *model);
  80. void exportNumbersByCity(NumberListModel *model);
  81. QString number2Thousandth(int number);
  82. void displayStatistics();
  83. bool checkThreadFinished();
  84. bool checkModel(NumberListModel *model);
  85. void initAD();
  86. void initListView();
  87. void initButton();
  88. bool checkCurrentSystemAvailable(int todo);
  89. bool checkCurrentSystemAvailable(QStringList files);
  90. bool checkCurrentSystemAvailable(QString content);
  91. QString getOpenFileName();
  92. QStringList getOpenFileNames();
  93. QString getSaveFileNamePrefix();
  94. QStringList extractNumbers(QString content);
  95. void createPopmenu();
  96. protected:
  97. void resizeEvent(QResizeEvent *);
  98. private slots:
  99. void onFileDnD(QStringList files);
  100. void onNumberProcessed(NumberListModel *model);
  101. void onNumberCopy(QString content);
  102. void onNumberBuilt(NumberListModel *model);
  103. void onBlackListNumberBuilt(NumberListModel *model);
  104. void onNumberMoved(NumberListModel *fromModel,NumberListModel *toModel);
  105. void onExportFinished();
  106. void onJoinSource(QStringList files);
  107. void onProgressMaxUpdated(int max);
  108. void onProgressUpdated(int current);
  109. void onBlackListProgressMaxUpdated(int max);
  110. void onBlackProgressUpdated(int current);
  111. void onAdUpdated(QString adText,QString adUrl);
  112. void onLinkActivated(QString url);
  113. void onLinkClicked(QUrl url);
  114. void on_inputnumsegPB_clicked();
  115. void slot_downbyallPB_clicked();
  116. void slot_upbyallPB_clicked();
  117. void slot_upbycomboPB_clicked();
  118. void slot_downbycomboPB_clicked();
  119. void on_clearoriPB_clicked();
  120. void on_cleardestPB_clicked();
  121. void slot_downbyvaluePB_clicked();
  122. void slot_downbytypePB_clicked();
  123. void slot_upbyvaluePB_clicked();
  124. void slot_upbytypePB_clicked();
  125. void on_sortPB_clicked();
  126. void on_noorderPB_clicked();
  127. void on_removeDuplicatesPB_clicked();
  128. void on_importSegmentsPB_clicked();
  129. void on_exportByALLPB_clicked();
  130. void on_exportByBatchPB_clicked();
  131. void on_exportByCorpPB_clicked();
  132. void on_exportBySegmentPB_clicked();
  133. void on_importFilePB_clicked();
  134. void on_extractPB_clicked();
  135. void on_blacklistPB_clicked();
  136. void on_copyPB_clicked();
  137. void on_pastePB_clicked();
  138. void on_sort2PB_clicked();
  139. void on_dissort2PB_clicked();
  140. void on_blacklist2PB_clicked();
  141. void on_removeDuplicate2PB_clicked();
  142. void on_exportByTimesPB_clicked();
  143. void on_exportByRegionPB_clicked();
  144. void on_comparePB_clicked();
  145. void on_removeNotPhonePB_clicked();
  146. void on_pushButtonCopy2_clicked();
  147. void onImportNumFileActionTriggered();
  148. void onImportSegFileActionTriggered();
  149. void onPreFileActionTriggered();
  150. void on_pushButtonHelpme_clicked();
  151. };
  152. #endif // FORMCUBE_H