Debian Codegraph @

src/libs/widgets/KoDocumentInfoDlg.h

raw
1 /* This file is part of the KDE project
2 SPDX-FileCopyrightText: 2000 Simon Hausmann <[email protected]>
3 2006 Martin Pfeiffer <[email protected]>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7
8 #ifndef __koDocumentInfoDlg_h__
9 #define __koDocumentInfoDlg_h__
10
11 #include <KPageDialog>
12
13 class KoDocumentInfo;
14 class KPageWidgetItem;
15 class KoPageWidgetItem;
16
17 #include "kowidgets_export.h"
18
19 /**
20 * @short The dialog that shows information about the document
21 * @author Simon Hausmann <[email protected]>
22 * @author Martin Pfeiffer <[email protected]>
23 * @see KoDocumentInfo
24 *
25 * This dialog is invoked by KoMainWindow and shows the content
26 * of the given KoDocumentInfo class. It consists of several pages,
27 * one showing general information about the document and an other
28 * showing information about the author.
29 * This dialog implements only things that are stored in the OASIS
30 * meta.xml file and therefore available through the KoDocumentInfo
31 * class.
32 * The widgets shown in the tabs are koDocumentInfoAboutWidget and
33 * koDocumentInfoAuthorWidget. This class here is derived from
34 * KPageDialog and uses the face type Tabbed.
35 */
36
37 class KOWIDGETS_EXPORT KoDocumentInfoDlg : public KPageDialog
38 {
39 Q_OBJECT
40
41 public:
42 /**
43 * The constructor
44 * @param parent a pointer to the parent widget
45 * @param docInfo a pointer to the shown KoDocumentInfo
46 */
47 KoDocumentInfoDlg(QWidget *parent, KoDocumentInfo* docInfo);
48
49 /** The destructor */
50 ~KoDocumentInfoDlg() override;
51
52 QList<KPageWidgetItem*> pages() const;
53
54 /** Returns true if the document was saved when the dialog was closed */
55 bool isDocumentSaved();
56
57 /** Sets all fields to read-only mode. Used by the property dialog. */
58 void setReadOnly(bool ro);
59
60 void addPageItem(KoPageWidgetItem *item);
61
62 public Q_SLOTS: // QDialog API
63 void accept() override;
64
65 protected: // QWidget API
66 void hideEvent(QHideEvent * event) override;
67
68 private Q_SLOTS:
69 /** Connected with clicked() from pbReset - Reset parts of the metadata */
70 void slotResetMetaData();
71 /** Connected with clicked() from pbEncrypt - Toggle the encryption of the document */
72 void slotToggleEncryption();
73
74 Q_SIGNALS:
75 void saveRequested(bool saveas, bool silent, int specialOutputFlag);
76
77 private:
78 /** Sets up the aboutWidget and fills the widgets with content */
79 void initAboutTab();
80 /** Sets up the authorWidget and fills the widgets with content */
81 void initAuthorTab();
82 /** Saves the changed data back to the KoDocumentInfo class */
83 void saveAboutData();
84 /** Saves the document with changed encryption */
85 void saveEncryption();
86
87 class KoDocumentInfoDlgPrivate;
88 KoDocumentInfoDlgPrivate * const d;
89 };
90
91 #endif