lib Library API Documentation

koDocumentInfo.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 1998, 1999, 2000 Torben Weis <weis@kde.org>
00003    Copyright (C) 2004 David Faure <faure@kde.org>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library 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 GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018    Boston, MA 02111-1307, USA.
00019 */
00020 
00021 #ifndef KO_DOCUMENT_INFO_H
00022 #define KO_DOCUMENT_INFO_H
00023 
00024 #include <qobject.h>
00025 #include <kconfig.h>
00026 #include <koffice_export.h>
00027 
00028 class QString;
00029 class QStringList;
00030 class QDomDocument;
00031 class QDomElement;
00032 class QDomNode;
00033 class KoStore;
00034 class KoDocumentInfoPage;
00035 class KoXmlWriter;
00036 
00037 class KOFFICECORE_EXPORT KoDocumentInfo : public QObject
00038 {
00039     Q_OBJECT
00040 public:
00041     KoDocumentInfo( QObject* parent = 0, const char* name = 0 );
00042     virtual ~KoDocumentInfo();
00043 
00044     bool load( const QDomDocument& doc );
00045     bool loadOasis( const QDomDocument& metaDoc );
00046 
00047     QDomDocument save();
00048     bool saveOasis( KoStore* store );
00049 
00054     QString title() const;
00055 
00056     KoDocumentInfoPage* page( const QString& name ) const;
00057     QStringList pages() const;
00058     void documentInfochanged() { emit sigDocumentInfoModifed();}
00059  signals:
00060     void sigDocumentInfoModifed();
00061 };
00062 
00063 class KOFFICECORE_EXPORT KoDocumentInfoPage : public QObject
00064 {
00065 public:
00066     KoDocumentInfoPage( QObject *parent, const char* name );
00067 
00068     virtual bool load( const QDomElement& e ) = 0;
00069     virtual QDomElement save( QDomDocument& doc ) = 0;
00070     virtual bool loadOasis( const QDomNode& metaDoc ) = 0;
00071     virtual bool saveOasis( KoXmlWriter &xmlWriter ) = 0;
00072 
00073 };
00074 
00075 class KOFFICECORE_EXPORT KoDocumentInfoAuthor : public KoDocumentInfoPage
00076 {
00077     Q_OBJECT
00078 public:
00079     KoDocumentInfoAuthor( KoDocumentInfo* info );
00080     ~KoDocumentInfoAuthor();
00081 
00082     virtual bool load( const QDomElement& e );
00083     virtual QDomElement save( QDomDocument& doc );
00084     virtual bool loadOasis( const QDomNode& metaDoc );
00085     virtual bool saveOasis( KoXmlWriter &xmlWriter );
00086 
00087     QString fullName() const;
00088     QString initial() const;
00089     QString title() const;
00090     QString company() const;
00091     QString email() const;
00092     QString telephoneHome() const;
00093     QString telephoneWork() const;
00094     QString fax() const;
00095     QString country() const;
00096     QString postalCode() const;
00097     QString city() const;
00098     QString street() const;
00099     QString position() const;
00100 
00101     void setFullName( const QString& n );
00102     void setTitle( const QString& n );
00103     void setCompany( const QString& n );
00104     void setEmail( const QString& n );
00105     void setTelephoneHome( const QString& n );
00106     void setTelephoneWork( const QString& n );
00107     void setFax( const QString& n );
00108     void setCountry( const QString& n );
00109     void setPostalCode( const QString& n );
00110     void setCity( const QString& n );
00111     void setStreet( const QString& n );
00112     void setInitial( const QString& n );
00113     void setPosition( const QString& n );
00114     void initParameters();
00115 
00116 private:
00117     QString m_fullName;
00118     QString m_title;
00119     QString m_company;
00120     QString m_email;
00121     QString m_telephoneHome;
00122     QString m_telephoneWork;
00123     QString m_fax;
00124     QString m_country;
00125     QString m_postalCode;
00126     QString m_city;
00127     QString m_street;
00128     QString m_initial;
00129     QString m_position;
00130     KConfig *m_emailCfg;
00131 };
00132 
00133 class KOFFICECORE_EXPORT KoDocumentInfoAbout : public KoDocumentInfoPage
00134 {
00135     Q_OBJECT
00136 public:
00137     KoDocumentInfoAbout( KoDocumentInfo* info );
00138 
00139     virtual bool load( const QDomElement& e );
00140     virtual QDomElement save( QDomDocument& doc );
00141     virtual bool loadOasis( const QDomNode& metaDoc );
00142     virtual bool saveOasis( KoXmlWriter &xmlWriter );
00143 
00144     QString title() const;
00145     QString abstract() const;
00146     QString subject() const;
00147     QString keywords() const;
00148 
00149     void setKeywords( const QString &n );
00150     void setSubject( const QString& n );
00151 
00152     void setTitle( const QString& n );
00153     void setAbstract( const QString& n );
00154 
00155 private:
00156     QString m_title;
00157     QString m_abstract;
00158     QString m_keywords;
00159     QString m_subject;
00160 };
00161 
00162 #endif
KDE Logo
This file is part of the documentation for lib Library Version 1.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Feb 13 09:40:00 2006 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003