|
CenGen - Генератор ценников
1.1
|
00001 #ifndef CEN_VIEWER_H 00002 #define CEN_VIEWER_H 00003 00004 #include <QFile> 00005 #include <QGraphicsScene> 00006 #include <QGraphicsItemGroup> 00007 #include <QTextCodec> 00008 #include <QString> 00009 #include <QtXml> 00010 #include "barcode.h" 00011 #include "tovar.h" 00012 #include "graph.h" 00013 #include "imagebox.h" 00014 00015 class Cennic : public ImageBox { 00016 public: 00017 00018 Cennic(Tovar * tovar, const QDomNode& shablon); 00019 Cennic(); 00020 ~Cennic(); 00021 00022 public slots: 00023 void create(Tovar * tovar, const QDomNode& shablon); 00024 QGraphicsItemGroup *render(QGraphicsScene * scene, float X, float Y); 00025 QString money_format(float price, QString rub, QString kop); 00026 QPoint lastCorner(); 00027 00028 private slots: 00029 QStringList split_text(float maxlen, QString text, QFont font, QGraphicsScene *scene); 00030 void set_preview_mode(bool mode); 00031 bool preview_mode(); 00032 00033 private: 00034 //QFile file; 00035 QDomNode domNode; 00036 QDomElement domElement; 00037 bool preview; //флаг для указания, что будет просто превью 00038 QString text; 00039 QRectF* rect; //для указания области, в которой будет рисоваться элемент 00040 QTextCodec *codec; //для перекодирования 00041 00042 Barcode* barcode; 00043 Tovar * ctovar; 00044 00045 QGraphicsItemGroup *items; 00046 00047 QPoint point; 00048 00049 }; 00050 00051 #endif // CEN_VIEWER_H