OpenAlbum 1.0.b

/home/manuel/PFC/open-album/OpenAlbum-Unix/Portada.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 
00021 #ifndef PORTADA_H
00022 #define PORTADA_H
00023 
00024 #include <string>
00025 #include "parser.h"
00026 #include <QPainter>
00027 #include <QPaintEvent>
00028 #include <QString>
00029 #include <QGraphicsView>
00030 
00032 
00036 typedef struct {
00037     
00038     QString texto; 
00039     QFont fuente; 
00040     QColor color; 
00041     int w; 
00042     int pos_x; 
00043     int pos_y; 
00044     int puntos; 
00045     bool vertical; 
00046     bool negrita; 
00047     bool cursiva; 
00048     bool subrayado; 
00049     bool centrado; 
00050 }ATexto;
00051 
00053 
00056 typedef struct {
00057     QString ruta; 
00058     QString pos; 
00059     int w; 
00060     int h; 
00061     int pos_x; 
00062     int pos_y; 
00063 }AImagen;
00064 
00066 
00103 class Portada{
00104 
00105 public:
00115     Portada(int width=0, int height=0, QWidget *parent_=0);
00116     
00123     ~Portada();
00124     
00132     void LoadFotoFrontalRuta(QString filename);
00133     
00141     void LoadColorTextoFrontal(QColor color);
00142     
00150     void LoadColorTextoTrasera(QColor color);
00151     
00159     void LoadColorTextoLateral(QColor color);
00160     
00168     void LoadFotoTraseraRuta(QString filename);
00169     
00178     void editPosFotoFrontal(int x, int y);
00179     
00188     void editPosFotoTrasera(int x, int y);
00189     
00198     void editPosTextoLateral(int x, int y);
00199     
00208     void editPosTextoFrontal(int x, int y);
00209     
00218     void editPosTextoTrasero(int x, int y);
00219     
00231     void LoadFotoFrontalResto(int width, int height, int x, int y, std::string pos);
00232     
00244     void LoadFotoTraseraResto(int width, int height, int x, int y, std::string pos);
00245     
00257     void LoadTextoFrontal(bool cur, bool neg, bool sub, QString text, QFont f);
00258     
00270     void LoadTextoTrasero(bool cur, bool neg, bool sub, QString text, QFont f);
00271     
00283     void LoadTextoLateral(bool cur, bool neg, bool sub, QString text, QFont f);
00284     
00297     void LoadTextoFrontalResto(int weight, int pt, int x, int y, std::string ver, std::string cen);
00298     
00311     void LoadTextoLateralResto(int weight, int pt, int x, int y, std::string ver, std::string cen);
00312     
00325     void LoadTextoTraseroResto(int weight, int pt, int x, int y, std::string ver, std::string cen);
00326     
00334     void LoadFondo(QString filename);
00335     
00343     void LoadFondo (QColor color);
00344     
00354     void setPosicionObjeto(unsigned indice, int posx, int posy);
00355     
00361     void ActivarEdicion();
00362     
00368     void ActivarColordefondo();
00369     
00375     void DesactivarColordefondo();
00376     
00385     void LoadDimensiones(int height, int weight);
00386     
00392     void ActivarTexto();
00393     
00399     void ActivarTextoFrontal();
00400     
00406     void DesactivarTextoFrontal();
00407     
00413     void ActivarTextoTrasero();
00414     
00420     void DesactivarTextoTrasero();
00421     
00427     void ActivarTextoLateral();
00428     
00434     void DesactivarTextoLateral();
00435     
00441     void ActivarImagenFrontal();
00442     
00448     void DesactivarImagenFrontal();
00449     
00455     void ActivarImagenTrasera();
00456     
00462     void DesactivarImagenTrasera();
00463     
00469     void DesactivarTexto();
00470     
00478     void LoadRutaPlantilla(QString ruta);
00479     
00487     void setObjetosPortada(QList <QGraphicsItem*> lista);
00488     
00494     void LimpiarListaObjetos();
00495     
00503     void activarMascara(QString ruta);
00504     
00512     int DimensionWImagenTrasera();
00513     
00521     int DimensionHImagenTrasera();
00522     
00530     int PosicionXImagenTrasera();
00531     
00539     int PosicionYImagenTrasera();
00540     
00548     int DimensionWImagenFrontal();
00549     
00557     int DimensionHImagenFrontal();
00558     
00566     int PosicionXImagenFrontal();
00567     
00575     int PosicionYImagenFrontal();
00576     
00584     int WTextoFrontal();
00585     
00593     int WTextoLateral();
00594     
00602     int WTextoTrasera();
00603     
00611     int PosXTextoFrontal();
00612     
00620     int PosXTextoLateral();
00621     
00629     int PosXTextoTrasera();
00630     
00638     int PosYTextoFrontal();
00639     
00647     int PosYTextoLateral();
00648     
00656     int PosYTextoTrasera();
00657     
00665     int TamTextoFrontal();
00666     
00674     int TamTextoLateral();
00675     
00683     int TamTextoTrasera();
00684     
00692     int GetW();
00693     
00701     int GetH();
00702     
00710     QString FondoImg();
00711     
00719     QString TextoFrontal();
00720     
00728     QString TextoLateral();
00729     
00737     QString TextoTrasera();
00738     
00746     QString RutaFotoTrasera();
00747     
00755     QString RutaFotoFrontal();
00756     
00764     QString RutaPlantilla();
00765     
00773     QString getMascara();
00774     
00782     QColor ColorTextoFrontal();
00783     
00791     QColor ColorTextoTrasera();
00792     
00800     QColor ColorTextoLateral();
00801     
00809     QColor FondoClr ();
00810     
00818     QFont FuenteTextoFrontal();
00819     
00827     QFont FuenteTextoLateral();
00828     
00836     QFont FuenteTextoTrasera();
00837     
00845     QList <QGraphicsItem*> getObjetosPortada();
00846     
00854     bool ColordeFondo();
00855     
00863     bool GetEditada();
00864     
00872     bool ContieneTexto();
00873     
00881     bool VerticalTextoFrontal();
00882     
00890     bool VerticalTextoLateral();
00891     
00899     bool VerticalTextoTrasera();
00900     
00908     bool CursivaTextoFrontal();
00909     
00917     bool CursivaTextoLateral();
00918     
00926     bool CursivaTextoTrasera();
00927     
00935     bool NegritaTextoFrontal();
00936     
00944     bool NegritaTextoTrasera();
00945     
00953     bool NegritaTextoLateral();
00954     
00962     bool SubrayadoTextoFrontal();
00963     
00971     bool SubrayadoTextoLateral();
00972     
00980     bool SubrayadoTextoTrasera();
00981     
00989     bool CentradoTextoFrontal();
00990     
00998     bool CentradoTextoLateral();
00999     
01007     bool CentradoTextoTrasera();
01008     
01018     bool getImagenPosVertical(QString posicion);
01019     
01027     bool activadaMascara();
01028     
01036     bool hayTextoFrontal();
01037     
01045     bool hayTextoLateral();
01046     
01054     bool hayTextoTrasero();
01055     
01063     bool hayImagenFrontal();
01064     
01072     bool hayImagenTrasera();
01073     
01077     QGraphicsView *versionFinal;
01078     
01082     QGraphicsView *versionReducida;
01083 
01084 private:
01085 
01086     QColor *colorfondo;
01087     bool color;
01088     bool editada;
01089     bool contieneTexto;
01090     bool usaMascara;
01091     bool tieneTextoFrontal, tieneTextoTrasero, tieneTextoLateral, tieneImagenFrontal, tieneImagenTrasera;
01092     QString rutaMascara;
01093     QString *fondo;
01094     QString *pathPlantilla;
01095     ATexto *area_texto_lateral;
01096     ATexto *area_texto_frontal;
01097     ATexto *area_texto_trasera;
01098     AImagen *area_imagen_frontal;
01099     AImagen *area_imagen_trasera;
01100     int w, h;
01101     QWidget *parent;
01102     QList <QGraphicsItem*> objetosPortada;
01103 
01104 };
01105 #endif
 Todo Clases Archivos Funciones Variables