OpenAlbum 1.0.b

/home/manuel/PFC/open-album/OpenAlbum-Unix/Pagina.h

00001 /*
00002     Copyright © 2011 Manuel Jesús de la Calle Brihuega
00003   
00004     This file is part of open Album.
00005 
00006     Open Album is free software: you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation, either version 3 of the License, or
00009     (at your option) any later version.
00010 
00011     Open Album is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with open Album.  If not, see <http://www.gnu.org/licenses/>.
00018 */
00019 
00020 #ifndef PAGINA_H
00021 #define PAGINA_H
00022 
00023 #include <string>
00024 #include "parser.h"
00025 #include <QPainter>
00026 #include <QPaintEvent>
00027 #include <QString>
00028 #include <QGraphicsView>
00029 #include "Portada.h"
00030 #include <QWidget>
00031 #include "dialogmarcos.h"
00032 
00034 
00068 class Pagina{
00069 
00070 public:
00080     Pagina(int width=0, int height=0, QWidget *parent_=0);
00081     
00088     ~Pagina();
00089     
00097     void LoadNumTextos(int num);
00098     
00111     void LoadFoto(QString filename, int width, int height, int x, int y, std::string pos);
00112     
00124     void LoadTexto(bool cur, bool neg, bool sub, QString text, QFont f);
00125     
00138     void LoadTexto(bool cur, bool neg, bool sub, QString text, QFont f, QColor c);
00139     
00153     void LoadTextoResto(unsigned i, int weight, int pt, int x, int y, std::string ver, std::string cen);
00154     
00162     void LoadFondo(QString f);
00163     
00171     void LoadFondoColor(QColor c);
00172     
00178     void ActivarColordefondo();
00179     
00185     void DesactivarColordefondo();
00186     
00195     void LoadDimensiones(int height, int weight);
00196     
00202     void SetPaginaLLena();
00203     
00211     void LoadRutaPlantilla(QString ruta);
00212     
00220     void setObjetosPagina(QList <QGraphicsItem*> lista);
00221     
00231     void setPosicionObjeto(unsigned indice, int posx, int posy);
00232     
00240     void activarMascara(QString ruta);
00241     
00247     void LimpiarListaObjetos();
00248     
00254     void SetPaginaEditada();
00255     
00264     void SetMarcos(QList<marco> marcos_);
00265     
00273     bool ContieneTextos();
00274     
00282     bool ContieneMarcos();
00283     
00291     bool ColordeFondo();
00292     
00300     bool GetPaginaVacia();
00301     
00311     bool VerticalTexto(ATexto texto);
00312     
00322     bool CursivaTexto(ATexto texto);
00323     
00333     bool NegritaTexto(ATexto texto);
00334     
00344     bool SubrayadoTexto(ATexto texto);
00345     
00355     bool CentradoTexto(ATexto texto);
00356     
00364     bool activadaMascara();
00365     
00373     bool GetPaginaEditada();
00374     
00383     bool getImagenPosVertical(unsigned indice);
00384     
00392     QList<marco> getMarcos();
00393     
00401     int GetNumTextos();
00402     
00412     int DimensionWImagen(AImagen imagen);
00413     
00423     int DimensionHImagen(AImagen imagen);
00424     
00434     int PosicionXImagen(AImagen imagen);
00435     
00445     int PosicionYImagen(AImagen imagen);
00446     
00456     int WTexto(ATexto texto);
00457     
00467     int PosXTexto(ATexto texto);
00468     
00478     int PosYTexto(ATexto texto);
00479     
00489     int TamTexto(ATexto texto);
00490     
00498     int GetW();
00499     
00507     int GetH();
00508     
00516     QString GetFondoImagen();
00517     
00527     QString Texto(ATexto textot);
00528     
00538     QString RutaFoto(AImagen imagen);
00539     
00547     QString RutaPlantilla();
00548     
00556     QString getMascara();
00557     
00565     QColor GetFondoColor();
00566     
00576     QColor ColorTexto(ATexto texto);
00577     
00587     QFont FuenteTexto(ATexto texto);
00588     
00596     QList <QGraphicsItem*> GetObjetosPagina();
00597     
00605     std::vector<AImagen> GetVectorImagenes();
00606     
00614     std::vector<ATexto> GetVectorTextos();
00615     
00619     QGraphicsView *versionFinal;
00620     
00624     QGraphicsView *versionReducida;
00625     
00626 private:
00627     std::vector<AImagen> Imagenes;
00628     std::vector<ATexto> Textos;
00629     bool usaMascara;
00630     QString rutaMascara;
00631     QColor *colorfondopagina;
00632     bool colorpagina;
00633     QString *fondopagina;
00634     QString *pathPlantillapagina;
00635     int w, h, numTextos;
00636     float factorAumentoW, factorAumentoH, factorAumentoWPDF, factorAumentoHPDF;
00637     QList <QGraphicsItem*> objetosPagina;
00638     bool PaginaVacia;
00639     bool PaginaEditada;
00640     bool contieneTextos, contieneMarcos;
00641     QWidget *parent;
00642     QList<marco> marcos;
00643 };
00644 #endif // PAGINA_H
 Todo Clases Archivos Funciones Variables