2007-12-01 10:47:15 +00:00
/*
2021-02-20 12:13:46 +01:00
Copyright 2006 - 2021 The QElectroTech Team
2020-10-17 20:25:30 +02: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/>.
2007-12-01 10:47:15 +00:00
*/
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 <QtXml>
2011-01-09 15:16:51 +00:00
# include "diagramcontext.h"
2015-04-17 11:36:28 +00:00
# include "qet.h"
2020-04-12 18:51:38 +02:00
2007-10-10 17:50:26 +00:00
/**
2020-10-17 20:25:30 +02:00
This class provides a container for the properties of a particular title
block , i . e . title , author , date , filename , folio , template , custom
properties , . . .
2007-10-10 17:50:26 +00:00
*/
2021-03-11 19:52:50 +01:00
class TitleBlockProperties {
2020-10-17 20:25:30 +02:00
public :
TitleBlockProperties ( ) ;
virtual ~ TitleBlockProperties ( ) ;
/// Lists the various ways to handle the date
enum DateManagement {
UseDateValue , ///< use the date attribute
CurrentDate ///< use the current date
} ;
bool operator = = ( const TitleBlockProperties & ) ;
bool operator ! = ( const TitleBlockProperties & ) ;
2021-03-11 19:52:50 +01:00
void toXml ( QDomElement & ) const ;
void fromXml ( const QDomElement & ) ;
void toSettings ( QSettings & , const QString & = QString ( ) ) const ;
void fromSettings ( QSettings & , const QString & = QString ( ) ) ;
2014-10-26 11:57:38 +00:00
2020-10-17 20:25:30 +02:00
void setAutoPageNum ( QString autonum ) { auto_page_num = autonum ; }
2016-07-13 14:57:27 +00:00
2020-10-17 20:25:30 +02:00
static TitleBlockProperties defaultProperties ( ) ;
QDate finalDate ( ) const ;
// attributes
2021-03-11 19:52:50 +01:00
QString title ; ///< Folio title (displayed by the default template)
QString author ; ///< Author of the diagram/folio (displayed by the default template)
QDate date ; ///< Date (displayed by the default template)
QString filename ; ///< Filename (displayed by the default template)
QString plant ; ///< Plant (displayed by the default template)
QString locmach ; ///< Location(displayed by the default template)
QString indexrev ; ///< Revision Index (displayed by the default template)
QString version ; ///< Version (displayed by the default template)
QString folio ; ///< Folio information (displayed by the default template)
2020-10-17 20:25:30 +02:00
QString auto_page_num ;
2021-03-11 19:52:50 +01:00
DateManagement useDate ; ///< Wheter to use the date attribute
QString template_name ; ///< Name of the template used to render the title block - an empty string means "the default template provided by the application"
2020-10-17 20:25:30 +02:00
DiagramContext context ; ///< Container for the additional, user-defined fields
2021-03-11 19:52:50 +01:00
Qt : : Edge display_at ; ///< Edge to display the titleblock
QET : : QetCollection collection ; ///<Specify the location of the title block
2016-07-13 14:57:27 +00:00
2020-10-17 20:25:30 +02:00
private :
QString exportDate ( ) const ;
void setDateFromString ( const QString & ) ;
2007-09-28 17:39:30 +00:00
} ;
# endif