/vp_plugins/auth_net_server/server.h

http://cupsfilter.googlecode.com/ · C Header · 228 lines · 105 code · 29 blank · 94 comment · 0 complexity · 1d514d983fd5ab84165f3942a0fffb74 MD5 · raw file

  1. #ifndef SERVER_H
  2. #define SERVER_H
  3. #define DEBUG_MODE
  4. #include "servergears.h"
  5. #include "auth_plugin.h"
  6. #include "inet_plugin.h"
  7. #include "igs_plugin.h"
  8. #include "itmpl_sql_plugin.h"
  9. #include "mytypes.h"
  10. #include <QDialog>
  11. #include <QtGui/QSystemTrayIcon>
  12. #include <QtGui/QErrorMessage>
  13. QT_BEGIN_NAMESPACE
  14. class QLabel;
  15. class QPushButton;
  16. class QGroupBox;
  17. class QFormLayout;
  18. class QLineEdit;
  19. class QLocalServer;
  20. class QComboBox;
  21. class QMenu;
  22. class QPlainTextEdit;
  23. class QDialogButtonBox;
  24. class QGridLayout;
  25. class QCheckBox;
  26. class QErrorMessage;
  27. QT_END_NAMESPACE
  28. using namespace VPrn;
  29. class Server : public QDialog
  30. {
  31. Q_OBJECT
  32. public:
  33. Server(QWidget *parent = 0);
  34. void setVisible(bool visible);
  35. /**
  36. * @fn bool isReady();
  37. * @brief ????????? ?????? GateKeeper ????? ?? ?? ? ?????? ??? ???
  38. */
  39. bool isReady(){return m_GateKeeperReady;}
  40. /**
  41. * @fn QString lastError();
  42. * @brief ?????????? ????????? ????????? ??????
  43. */
  44. QString lastError(){return m_lastError;}
  45. /**
  46. * @fn void showCriticalInfo(constQStrin & info)
  47. * @brief ?????????? ??????????? ?????? ? ????????? ?????? ?????????
  48. */
  49. void showCriticalInfo(const QString & info);
  50. protected:
  51. void closeEvent(QCloseEvent *event);
  52. public slots:
  53. /**
  54. @fn void appendStartMsg(const QString & msg);
  55. @brief ?????? ??? ????????? ????????? ??? ?????? ?????? ????? ?????????
  56. */
  57. void appendStartMsg(const QString & msg);
  58. /**
  59. * @fn void showBaloonMessage(int m_Type,const QString &b_msg)
  60. * @brief ?????????? ????????? ? ????
  61. * @param m_Type ??? ????????? critical,warning,information
  62. * @param b_msg ???? ?????????
  63. */
  64. //void showBaloonMessage(int m_Type,const QString &b_msg);
  65. /**
  66. * @fn void showTrayMessage(trayIcons msg_type,
  67. * const QString & msg_title,
  68. * const QString & msg_body);
  69. * @brief ?????????? ? ???? ????????? ????????? ????
  70. */
  71. void showTrayMessage(trayIcons msg_type,
  72. const QString & msg_title,
  73. const QString & msg_body);
  74. private slots:
  75. void iconActivated(QSystemTrayIcon::ActivationReason reason);
  76. void errorInfo(VPrn::AppErrorType eCode,QString e_msg);
  77. /**
  78. * @fn void setUserName(const QString & login,const QString &mandat);
  79. * @brief ?????????? ?????????? ?????????? ????????????
  80. */
  81. void setUserName(QString & login,QString &mandat);
  82. /**
  83. * @fn void runTEditor()
  84. * @brief ?????? ????????? ???????? ??? ?????????? ??????????
  85. */
  86. void runTEditor();
  87. /**
  88. * @fn void do_ChekPointChanged(MyCheckPoints m_scheckPoint);
  89. * @brief ??? ?????? ????????? ?????? ??????????, ??? ???? ??????????
  90. */
  91. void do_ChekPointChanged(MyCheckPoints m_scheckPoint);
  92. /**
  93. * @fn void dead_hands();
  94. * @brief ??????? ???? ????????? ???????? ???????? ??????????? ????????,
  95. * ? ????????? ??????????.
  96. */
  97. void dead_hands();
  98. /**
  99. * @fn void clearClientSpool( const QString &client_uuid );
  100. * @brief ?????? ??????????, ?????? ????? ????????? gs ??? ?????? ?? ?????,
  101. * ???????? ???????, ?? ??????? ?????????
  102. */
  103. void clearClientSpool( const QString &client_uuid );
  104. private:
  105. void createActions();
  106. void createTrayIcon();
  107. /**
  108. * @fn void init();
  109. * @brief ?????????? ?????????????? ???????? ??????????,
  110. */
  111. void init();
  112. /**
  113. * @fn bool loadPlugins()
  114. * @brief ???????? ????????
  115. */
  116. bool loadPlugins();
  117. /**
  118. * @fn void setTrayStatus(trayStatus t_stat,const QString & t_msg);
  119. * @brief ???????????? ?????? ? ????????? ? ??????????? ?? ???????
  120. */
  121. void setTrayStatus (trayStatus t_stat, const QString &t_msg);
  122. /**
  123. * @fn bool readConfig();
  124. * @brief ?????? ini ????
  125. */
  126. bool readConfig();
  127. /**
  128. * @var mainGear; ???????? ?????? ?????????
  129. * @var myNet_plugin; ????????? ?? ??????? ??????
  130. * @var myAuth_plugin; ????????? ?? ?????? ?????????? @todo (????? ?? ?)
  131. * @var myGs_plugin; ????????? ?? ?????? ?????? ghostscript
  132. * @var myTmpl_plugin; ????????? ?? ?????? ?????? ? ????????
  133. * @var currentStatus; ??????? ????????? ?????????
  134. * @var m_GateKeeperReady; ???? ????? ? ?????? ??? ???
  135. * @var m_lastError; ????????? ????????? ?? ??????
  136. */
  137. serverGears *myServerGears;
  138. Inet_plugin *myNet_plugin;
  139. Auth_plugin *myAuth_plugin;
  140. Igs_plugin *myGs_plugin;
  141. Itmpl_sql_plugin *myTmpl_plugin;
  142. bool m_GateKeeperReady;
  143. QString m_lastError;
  144. QString currentStatus;
  145. /**
  146. * @brief --------- ???? ?????????? ?? ini ????? ------------------------
  147. * @var serverHostName; ??????? ??? ?????? ??? IP ?????
  148. * @var serverPort; ???? ??? ????? c ???????
  149. * @var localSrvName; ??? ?????????? ???????
  150. * @var ticket_fname; ??? ????? ? ??????? ????????? ????????? ??????????? UNIX only
  151. * @var gsBin; ???? ? ???????????? ????? gs
  152. * @var pdftkBin; ???? ? ???????????? ????? pdfTk
  153. * @var spoolDir; ???? ? ???????? ????????? ??????
  154. * @var local_t_path; ???? ? ????????? ????????
  155. * @var global_t_path; ???? ? ?????????? ????????
  156. * @var tEditor_bin; ???? ? ????? ????????? ????????
  157. *------------------------------------------------------------------------
  158. */
  159. QString serverHostName;
  160. int serverPort;
  161. QString localSrvName;
  162. QString ticket_fname;
  163. QString gsBin;
  164. QString pdftkBin;
  165. QString gsprintBin;
  166. QString spoolDir;
  167. QString local_t_path;
  168. QString global_t_path;
  169. QString tEditor_bin;
  170. // ????? ??????????? ?????????
  171. QGroupBox *groupBox;
  172. QFormLayout *formLayout;
  173. QLabel *login_label;
  174. QLineEdit *login_LE;
  175. QLabel *mandat_label;
  176. QLineEdit *mandat_LE;
  177. QGroupBox *groupBox_2;
  178. QLineEdit *demonState_LE;
  179. QPushButton *quitButton;
  180. QGridLayout *gridLayout;
  181. QCheckBox *authCheckBox;
  182. QCheckBox *netCheckBox;
  183. QCheckBox *tmplCheckBox;
  184. QCheckBox *gsCheckBox;
  185. // ????????
  186. QAction *minimizeAction;
  187. QAction *restoreAction;
  188. QAction *quitAction;
  189. QAction *runEditorAction;
  190. QSystemTrayIcon *trayIcon;
  191. QMenu *trayIconMenu;
  192. // ???????? ?????? ??????
  193. QErrorMessage * myEMsgBox;
  194. QObjectList pluginList;
  195. #ifdef DEBUG_MODE
  196. PrinterList printer_list; //?????? ????????? ? ??????? (name,ip,p_qqueue)
  197. #endif
  198. };
  199. #endif