PageRenderTime 61ms CodeModel.GetById 20ms app.highlight 34ms RepoModel.GetById 1ms app.codeStats 0ms

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