00001 /*************************************************************************** 00002 * Copyright (C) 2003 by Josep Burcion * 00003 * josep@burcion.com * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00019 ***************************************************************************/ 00020 00021 //Clase base para rellenar todos los formularios oficiales desde el pdf de www.aeat.es 00022 00023 #ifndef MODGEN_H 00024 #define MODGEN_H 00025 #include <qfile.h> 00026 #include <qthread.h> 00027 #include <qprogressdialog.h> 00028 #include <qevent.h> 00029 00030 enum {sleep10=1001,sleep3=1002,acabado=1003}; 00031 00032 00033 class Genps_thread:public QThread 00034 { 00035 public: 00036 Genps_thread(QString,QString,QProgressDialog *); 00037 void run(); 00038 00039 QString m_pdfname,m_tempname; 00040 QProgressDialog *m_progressdia; 00041 }; 00042 00043 class Psprogressdialog:public QProgressDialog 00044 { 00045 public: 00046 Psprogressdialog(QString,QString,int); 00047 void customEvent(QCustomEvent *); 00048 }; 00049 00054 class Modgenps: public QObject 00055 { 00056 00057 // Q_OBJECT 00058 public: 00059 Modgenps() 00060 {} 00061 ; 00062 ~Modgenps() 00063 {} 00064 ; 00065 void download_form(QWidget *,QString ,QString ); 00066 Genps_thread *convierte_a_postscript; 00067 void formatdigits(QString *,QString *,float); //genera 2 cadenas con parte entera y fraccionaria del float 00068 void escrizq(QString,int,int);//escribe el texto "a la izquierda de" (o sea, alineado a la derecha) 00069 void escrizq(float,int,int);//funcion sobrecargada, igual que antes pero primero convierte float en cadena 00070 void escrder(QString,int,int);//igual que escrizq pero alineado a la izquierda 00071 void escrder(float,int,int);//sobrecargada igual que la anterior 00072 void escrizqder(QString,QString,int,int);//escribe primera cadena a la izquierda y segunda a la derecha del punto dado 00073 void escrizqder(float,int,int); //igual, pero primero convierte float en 2 cadenas con formatdigits 00074 void marca_casilla(QString,int,int); //pone una cruz en la casilla dada por sus coordenadas 00075 void marcadeagua_borrador();//inserta una marca de agua en el documento con la palabra BORRADOR bien grande, que sea vea!! 00076 QFile m_fichlec; 00077 QFile m_fich; 00078 QTextStream m_output; 00079 bool m_es_borrador;//True si el documento a generar es un borrador (mucho mas rapido de generar, pero sin numero de serie valido) 00080 /* 00081 public slots: 00082 void yata(bool); 00083 */ 00084 }; 00085 00086 #endif