Warning, file /office/calligra/libs/widgets/KoDocumentInfoDlg.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /* This file is part of the KDE project
0002    Copyright (c) 2000 Simon Hausmann <hausmann@kde.org>
0003                  2006 Martin Pfeiffer <hubipete@gmx.net>
0004 
0005    This library is free software; you can redistribute it and/or
0006    modify it under the terms of the GNU Library General Public
0007    License as published by the Free Software Foundation; either
0008    version 2 of the License, or (at your option) any later version.
0009 
0010    This library is distributed in the hope that it will be useful,
0011    but WITHOUT ANY WARRANTY; without even the implied warranty of
0012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013    Library General Public License for more details.
0014 
0015    You should have received a copy of the GNU Library General Public License
0016    along with this library; see the file COPYING.LIB.  If not, write to
0017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0018  * Boston, MA 02110-1301, USA.
0019 */
0020 
0021 #ifndef __koDocumentInfoDlg_h__
0022 #define __koDocumentInfoDlg_h__
0023 
0024 #include <kpagedialog.h>
0025 
0026 class KoDocumentInfo;
0027 class KPageWidgetItem;
0028 class KoPageWidgetItem;
0029 
0030 #include "kowidgets_export.h"
0031 
0032 /**
0033  * @short The dialog that shows information about the document
0034  * @author Simon Hausmann <hausmann@kde.org>
0035  * @author Martin Pfeiffer <hubipete@gmx.net>
0036  * @see KoDocumentInfo
0037  *
0038  * This dialog is invoked by KoMainWindow and shows the content
0039  * of the given KoDocumentInfo class. It consists of several pages,
0040  * one showing general information about the document and an other
0041  * showing information about the author.
0042  * This dialog implements only things that are stored in the OASIS
0043  * meta.xml file and therefore available through the KoDocumentInfo
0044  * class.
0045  * The widgets shown in the tabs are koDocumentInfoAboutWidget and
0046  * koDocumentInfoAuthorWidget. This class here is derived from
0047  * KPageDialog and uses the face type Tabbed.
0048  */
0049 
0050 class KOWIDGETS_EXPORT KoDocumentInfoDlg : public KPageDialog
0051 {
0052     Q_OBJECT
0053 
0054 public:
0055     /**
0056      * The constructor
0057      * @param parent a pointer to the parent widget
0058      * @param docInfo a pointer to the shown KoDocumentInfo
0059      */
0060     KoDocumentInfoDlg(QWidget *parent, KoDocumentInfo* docInfo);
0061 
0062     /** The destructor */
0063     ~KoDocumentInfoDlg() override;
0064 
0065     QList<KPageWidgetItem*> pages() const;
0066 
0067     /** Returns true if the document was saved when the dialog was closed */
0068     bool isDocumentSaved();
0069 
0070     /** Sets all fields to read-only mode. Used by the property dialog. */
0071     void setReadOnly(bool ro);
0072 
0073     void addPageItem(KoPageWidgetItem *item);
0074 
0075 public Q_SLOTS:  // QDialog API
0076     void accept() override;
0077 
0078 protected:  // QWidget API
0079     void hideEvent(QHideEvent * event) override;
0080 
0081 private Q_SLOTS:
0082     /** Connected with clicked() from pbReset - Reset parts of the metadata */
0083     void slotResetMetaData();
0084     /** Connected with clicked() from pbEncrypt - Toggle the encryption of the document */
0085     void slotToggleEncryption();
0086 
0087 Q_SIGNALS:
0088     void saveRequested();
0089 
0090 private:
0091     /** Sets up the aboutWidget and fills the widgets with content */
0092     void initAboutTab();
0093     /** Sets up the authorWidget and fills the widgets with content */
0094     void initAuthorTab();
0095     /** Saves the changed data back to the KoDocumentInfo class */
0096     void saveAboutData();
0097     /** Saves the document with changed encryption */
0098     void saveEncryption();
0099 
0100     class KoDocumentInfoDlgPrivate;
0101     KoDocumentInfoDlgPrivate * const d;
0102 };
0103 
0104 #endif