/vp_plugins/print_monitor/engine.h

http://cupsfilter.googlecode.com/ · C Header · 171 lines · 86 code · 22 blank · 63 comment · 0 complexity · dd388f6f11e526e295f42a489ec2d304 MD5 · raw file

  1. #ifndef ENGINE_H
  2. #define ENGINE_H
  3. #include <QtCore/QObject>
  4. #include <QtCore/QFileInfo>
  5. QT_FORWARD_DECLARE_CLASS ( QStringList )
  6. QT_FORWARD_DECLARE_CLASS ( QLocalSocket )
  7. QT_FORWARD_DECLARE_CLASS ( QStandardItemModel )
  8. QT_FORWARD_DECLARE_CLASS ( QStringListModel )
  9. class mySocketClient;
  10. class Message;
  11. #include "mytypes.h"
  12. using namespace VPrn;
  13. class Engine :public QObject
  14. {
  15. Q_OBJECT
  16. public:
  17. Engine(QObject*parent = 0,const QString &link = QString(),
  18. const QString &gk_bin = QString());
  19. void needRestart();
  20. /**
  21. * @fn ~Engine();
  22. * @brief ? ??????????? ????????? ??????? ????????? ? ???? ??? ???? ????????? ???
  23. */
  24. ~Engine();
  25. /**
  26. * @fn void setDocCardModel
  27. * @fn void setPrintersModel
  28. * @fn void setStampsModel
  29. * @fn void setTemplatesModel
  30. * @fn void setMandatsModel
  31. * @short ???????? ????????? ?? ??????? ??????
  32. */
  33. void setDocCardModel (QStandardItemModel *pDC_model ) {m_DC_model = pDC_model; }
  34. void setPrintersModel (QStandardItemModel *pPrn_model ) {m_Prn_model = pPrn_model;}
  35. void setTemplatesModel (QStandardItemModel *pTmpl_model ) {m_Tmpl_model = pTmpl_model;}
  36. void setMandatsModel (QStringListModel *pMandats_model ){m_Mandats_model = pMandats_model;}
  37. void setStampsModel (QStringListModel *pStamp_model ) {m_Stamp_model = pStamp_model;}
  38. /**
  39. @fn void prepareFileToPrint(const QString & file_name);
  40. @brief ??????????? ?????? ?? GateKeeper ? ??????????? ?????????????? ps -> pdf
  41. */
  42. void prepareFileToPrint(const QString & file_name);
  43. void markCurrentDocBrack();
  44. void markCurrentDocClear();
  45. signals:
  46. void error(VPrn::AppErrorType eCode,const QString eMsg);
  47. // ????????? ????????? ??????? ?? ????????
  48. void MergeDocWithTemplates( bool flag,const QString &info);
  49. // ?????? ????? ? ?????????????? ????????? ?????????????
  50. void PicturesList (QStringList page_list);
  51. // ?????? ????? ??? ?????????????? ?????????? ??????? ??? ??????
  52. //void ReadyForPrintPages(QByteArray page_list);
  53. // ???????? ?????????? ????????? ??????
  54. void reciveGoodBayMsg(const QString &shutdown_info);
  55. //???????? ??????????????? ? ?? ????? (?????/???????, ??????????? ????????)
  56. void RegisterDocInBase(bool flag,const QString &info);
  57. // ????????? ??????????? ??????? ? ??????????
  58. void authToDevice(bool flag,const QString &info);
  59. void infoMessage(const QString &info);
  60. void gk_notReady(const QString &ext_info); // ????????? ?????? ?? ????? ? ??????
  61. // ????????? ???????????? ???????????? ???? ???, ? ????? ? ???????
  62. void needAuthUser(const QString &login_mandat_list);
  63. void gk_fullReady(const QString &login,const QString &mandat);
  64. // ??????????? ?? ????????? ???????
  65. void LocalSrvRegistr();
  66. void RemoteDemonRegistr();
  67. void ReciveUserName();
  68. void ReciveUserMandat();
  69. //????????? ?????? ?????? ?????? ????????? ????????? ??????? ????????????
  70. void RecivePrintersList();
  71. void ReciveSecLevelList();
  72. // ???????? ??????? ????????????? ? pdf
  73. void doc_converted();
  74. void showInfoMsg(const QString &info_txt);
  75. void UserNeedFlipPages();
  76. void UserNeedCheckLastPage();
  77. void UserNeedMarkCopies(const QString &detail_txt);
  78. public slots:
  79. void do_printCurrentDoc();
  80. /**
  81. * @fn void launchAndConnect();
  82. * @brief ????????? ???? ??????? GateKeeper (????????? ??? ???? ?? ???????)
  83. * ? ???????????? ? ??? ?????? ? ????????????? ?????????
  84. */
  85. void launchAndConnect();
  86. void setAuthData(const QString &login,const QString &mandat);
  87. /**
  88. * @fn void authUserToPrinter();
  89. * @brief ??????????? ???????? ???????????? ?? ????????? ?????????? ??????
  90. */
  91. void authUserToPrinter();
  92. /**
  93. * @fn void checkMB();
  94. * @brief ???????? ?? ???? ?????? ???????? ?? ????? ??
  95. */
  96. void checkMB();
  97. /**
  98. * @fn
  99. * @brief ???????????? ?????? ???? ?? ??????? ?????????????,
  100. * ?????????? ????????? ?????????????? pdf -> png ? ???????? ???
  101. */
  102. void do_select_mode(int mode);
  103. private slots:
  104. void do_checkPointChanged(MyCheckPoints r_cpoint);
  105. /**
  106. * @fn void parseMessage(const Message r_msg);
  107. * @brief ????????? ?????????? ????????? ?? ?????????? ???????
  108. */
  109. void parseMessage(const Message &r_msg);
  110. private:
  111. QStandardItemModel *m_DC_model;
  112. QStandardItemModel *m_Prn_model;
  113. QStandardItemModel *m_Tmpl_model;
  114. QStringListModel *m_Mandats_model;
  115. QStringListModel *m_Stamp_model;
  116. mySocketClient *m_LocalClient;
  117. bool stopLaunch;
  118. QString currentUserName;
  119. QString currentUserMandat;
  120. QString link_name;
  121. QString gatekeeper_bin;
  122. // @var client_uuid; ?????????? ????? ?????????? ?? GateKeeper
  123. QString client_uuid;
  124. //-------------------------------------------------------------------------------------
  125. void sendMessage2LocalSrv(const Message &s_msg);
  126. void afterConnectSteps();
  127. void savePrintersListToModel(const QString &prn_list);
  128. void saveTemplatesListToModel(QByteArray tmpl_list);
  129. void setSecLevelList(QStringList &list );
  130. /**
  131. * @fn void setPageCountInModel(int pCnt);
  132. * @brief ?????? ????? ??????? ? ?????? ????????_?????????
  133. */
  134. void setPageCountInModel(int pCnt);
  135. QString findPrinterInModel();
  136. /**
  137. * @fn void registerMB();
  138. * @brief ??????????? ? ???? ?????? ????????? ? ?????????? ???????????
  139. */
  140. void registerMB();
  141. /**
  142. * @fn QByteArray getAllFieldData();
  143. * @brief ????????? ?? ?????? ????????_????????? ?????? ??????
  144. */
  145. QByteArray getAllFieldData();
  146. QString findTemplatesFilePathInModel ( int id );
  147. QString findStampInModel ( int id );
  148. };
  149. #endif // ENGINE_H