2007-12-01 10:47:15 +00:00
/*
2010-01-03 16:25:37 +00:00
Copyright 2006 - 2010 Xavier Guerrin
2007-12-01 10:47:15 +00:00
This file is part of QElectroTech .
QElectroTech is free software : you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 2 of the License , or
( at your option ) any later version .
QElectroTech is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
along with QElectroTech . If not , see < http : //www.gnu.org/licenses/>.
*/
2010-12-20 02:45:36 +00:00
# ifndef TITLEBLOCK_PROPERTIES_H
# define TITLEBLOCK_PROPERTIES_H
2009-04-03 19:30:25 +00:00
# include <QtCore>
# include <QtXml>
2007-10-10 17:50:26 +00:00
/**
Cette classe est un conteneur pour les proprietes d ' un cartouche de schema
: titre , auteur , date , nom de fichier et folio
*/
2010-12-20 02:45:36 +00:00
class TitleBlockProperties {
2007-09-28 17:39:30 +00:00
public :
2010-12-20 02:45:36 +00:00
TitleBlockProperties ( ) ;
virtual ~ TitleBlockProperties ( ) ;
2007-12-05 21:16:01 +00:00
/// Specifie comment gerer la date
2007-12-01 10:29:03 +00:00
enum DateManagement {
UseDateValue , ///< utilise l'attribut date
CurrentDate ///< utilise la date courante
} ;
2010-12-20 02:45:36 +00:00
bool operator = = ( const TitleBlockProperties & ) ;
bool operator ! = ( const TitleBlockProperties & ) ;
2009-04-03 19:30:25 +00:00
void toXml ( QDomElement & ) const ;
void fromXml ( QDomElement & ) ;
void toSettings ( QSettings & , const QString & = QString ( ) ) const ;
void fromSettings ( QSettings & , const QString & = QString ( ) ) ;
2007-12-01 10:29:03 +00:00
QDate finalDate ( ) const ;
2007-09-28 17:39:30 +00:00
// attributs
2007-12-01 10:29:03 +00:00
QString title ; ///< Titre affiche par le cartouche
QString author ; ///< Auteur affiche par le cartouche
QDate date ; ///< Date affichee par le cartouche ; si la date est nulle, le champ reste vide
QString filename ; ///< Nom de fichier affiche par le cartouche
QString folio ; ///< Folio affiche par le cartouche
DateManagement useDate ; ///< Indique s'il faut utiliser ou non l'attribut date
2010-12-24 23:35:40 +00:00
QString template_name ; ///< Name of the template used to render the title block - an empty string means "the default template provided by the application"
2009-04-03 19:30:25 +00:00
private :
QString exportDate ( ) const ;
void setDateFromString ( const QString & ) ;
2007-09-28 17:39:30 +00:00
} ;
# endif