efacturabf.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2006 by Arturo Martin Llado                             *
00003  *   amartin@conetxia.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 #include <QMenu>
00022 #include <QAction>
00023 #include <QObject>
00024 #include <QMessageBox>
00025 #include <QToolButton>
00026 
00027 #include <stdio.h>
00028 
00029 #include "efacturabf.h"
00030 #include "efactura.h"
00031 // #include "efacturaenvio.h"
00032 #include "efacturarecepcion.h"
00033 #include "company.h"
00034 #include "funcaux.h"
00035 // Exportacion
00036 #include "facturaview.h"
00037 #include "efqtoolbutton.h"
00038 // Importacion
00039 #include "facturasplist.h"
00040 #include "efqtoolbutton_importar.h"
00041 
00042 
00044 
00046 efacturabf::efacturabf() {
00047     _depura("efacturabf::efacturabf", 0);
00048     _depura("END efacturabf::efacturabf", 0);
00049 }
00050 
00051 
00053 
00055 efacturabf::~efacturabf() {
00056     _depura("efacturabf::~efacturabf", 0);
00057     _depura("efacturabf::~efacturabf", 0);
00058 }
00059 
00060 
00062 
00064 void efacturabf::elslot() {
00065         _depura("efacturabf::elslot", 0);
00066         EFactura *ef = new EFactura((Company *)empresaBase());
00067         ef->show();
00068         
00069 //      EFacturaEnvio *efv = new EFacturaEnvio(empresaBase());
00070 //      efv->show();
00071         
00072 //      EFacturaRecepcion *efr = new EFacturaRecepcion(empresaBase());
00073 //      efr->show();
00074         
00075 //     fprintf(stderr,"Sa ha activado el slot\n");
00076 //     QMessageBox::warning(0,
00077 //                          "Titulo de la ventana",
00078 //                          "Mensaje.",
00079 //                          QMessageBox::Ok,
00080 //                          QMessageBox::Cancel);
00081         _depura("END efacturabf::elslot", 0);
00082 }
00083 
00084 
00086 
00088 void efacturabf::elslot1() {
00089         _depura("efacturabf::elslot1", 0);
00090         EFacturaRecepcion *efr = new EFacturaRecepcion((Company *)empresaBase());
00091         efr->show();
00092         _depura("END efacturabf::elslot1", 0);
00093 }
00094 
00095 
00097 
00100 void efacturabf::inicializa(Bulmafact *bges) {
00101         _depura("efacturabf::inicializa", 0);
00103         setEmpresaBase(bges->getcompany());
00104         
00106 //      QMenu *pPluginMenu = new QMenu("&Factura Electronica");
00107 //      
00108 //      QAction *accion = new QAction("&Configuracion de e-factura", 0);
00109 //      accion->setStatusTip("Muestra statustip");
00110 //      accion->setWhatsThis("Muestra que es esto");
00111 //      
00112 //      QAction *accion1 = new QAction("&Recepcion de e-facturas", 0);
00113 //      accion1->setStatusTip("Muestra statustip");
00114 //      accion1->setWhatsThis("Muestra que es esto");
00115 // 
00116 //      connect(accion, SIGNAL(activated()), this, SLOT(elslot()));
00117 //      connect(accion1, SIGNAL(activated()), this, SLOT(elslot1()));
00118 //      
00119 //      /// Anyadimos los submenus al menu de efactura
00120 //      pPluginMenu->addAction(accion);
00121 //      pPluginMenu->addAction(accion1);
00122 // 
00123 //      /// Anyadimos la nueva opcion al menu principal del programa.
00124 //      bges->menuBar()->addMenu(pPluginMenu);
00125         _depura("END efacturabf::inicializa", 0);
00126 }
00127 
00128 
00130 
00133 void entryPoint(Bulmafact *bges) {
00134         _depura("Estoy dentro del plugin de e-factura", 0);
00135         
00136         efacturabf *efact = new efacturabf();
00137         efact->inicializa(bges);
00140         bges->setWindowTitle("Prueba de plugin e-factura.");
00141         
00142         _depura("Acaba el entry point de e-factura", 0);
00143 }
00144 
00145 
00147 
00151 int FacturaView_FacturaView(FacturaView *fac) {
00152         _depura("FacturaView_FacturaView", 0);
00153         
00154         EFQToolButton *mui_exporta_efactura = new EFQToolButton(fac, fac->mui_plugbotones);
00155         mui_exporta_efactura->setObjectName(QString::fromUtf8("exporta"));
00156         mui_exporta_efactura->setMinimumSize(QSize(32, 32));
00157         mui_exporta_efactura->setIcon(QIcon(QString::fromUtf8("/usr/share/bulmages/efactura/efactura.png")));
00158         mui_exporta_efactura->setIconSize(QSize(22, 22));
00159         mui_exporta_efactura->setStatusTip("Exportar eFactura");
00160         mui_exporta_efactura->setToolTip("Exportar eFactura");
00161 
00162        QHBoxLayout *m_hboxLayout1 = fac->mui_plugbotones->findChild<QHBoxLayout *>("hboxLayout1");
00163        if (!m_hboxLayout1) {
00164                 m_hboxLayout1 = new QHBoxLayout(fac->mui_plugbotones);
00165                 m_hboxLayout1->setSpacing(5);
00166                 m_hboxLayout1->setMargin(5);
00167                 m_hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
00168        } // end if
00169 
00170         m_hboxLayout1->addWidget(mui_exporta_efactura);
00171         
00172         _depura("END FacturaView_FacturaView", 0);
00173         
00174         return 0;
00175 }
00176 
00177 
00179 
00183 int FacturasProveedorList_FacturasProveedorList_Post(FacturasProveedorList *listfac) {
00184         _depura("FacturasProveedorList_FacturasProveedorList_Post", 0);
00185         
00186         EFQToolButtonImportar *mui_importa_efactura = new EFQToolButtonImportar(listfac, listfac->mui_plugbotones);
00187         mui_importa_efactura->setObjectName(QString::fromUtf8("importa"));
00188         mui_importa_efactura->setMinimumSize(QSize(32, 32));
00189         mui_importa_efactura->setIcon(QIcon(QString::fromUtf8("/usr/share/bulmages/efactura/efactura.png")));
00190         mui_importa_efactura->setIconSize(QSize(22, 22));
00191         mui_importa_efactura->setStatusTip("Importar eFactura");
00192         mui_importa_efactura->setToolTip("Importar eFactura");
00193 
00194        QHBoxLayout *m_hboxLayout1 = listfac->mui_plugbotones->findChild<QHBoxLayout *>("hboxLayout1");
00195        if (!m_hboxLayout1) {
00196                 m_hboxLayout1 = new QHBoxLayout(listfac->mui_plugbotones);
00197                 m_hboxLayout1->setSpacing(5);
00198                 m_hboxLayout1->setMargin(5);
00199                 m_hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
00200        } // end if
00201         m_hboxLayout1->addWidget(mui_importa_efactura);
00202 
00203         _depura("END FacturasProveedorList_FacturasProveedorList_Post", 0);
00204         
00205         return 0;
00206 }

Generated on Sat Dec 15 00:01:05 2007 for BulmaGes by  doxygen 1.5.1