PageRenderTime 35ms CodeModel.GetById 18ms app.highlight 14ms RepoModel.GetById 1ms app.codeStats 0ms

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