kgpg
kgpgeditor.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef KGPGEDITOR_H
00019 #define KGPGEDITOR_H
00020
00021
00022 #include <KXmlGuiWindow>
00023 #include <KUrl>
00024 #include <KShortcut>
00025
00026
00027 class QCloseEvent;
00028
00029 class KToggleAction;
00030 class KAction;
00031 class KFind;
00032
00033 class KgpgInterface;
00034 class KgpgView;
00035
00036
00037 class KgpgEditor : public KXmlGuiWindow
00038 {
00039 Q_OBJECT
00040 friend class KgpgView;
00041
00042 public:
00043 explicit KgpgEditor(QWidget *parent = 0, Qt::WFlags f = 0, KShortcut gohome = KShortcut(QKeySequence(Qt::CTRL + Qt::Key_Home)), bool mainwindow = false);
00044 ~KgpgEditor();
00045
00046 void openDocumentFile(const KUrl& url, const QString &encoding = QString());
00047 void openEncryptedDocumentFile(const KUrl& url);
00048
00049 KgpgView *view;
00050
00051 signals:
00052 void refreshImported(QStringList);
00053 void openChangeFont();
00054 void openConfigDialog();
00055 void encryptFiles(KUrl::List fileList);
00056
00057 public slots:
00058 void slotSetFont(QFont myFont);
00059 void closeWindow();
00060
00061 protected:
00062 void saveOptions();
00063 void initActions();
00064 void initView();
00065 void closeEvent(QCloseEvent *e);
00066 bool queryClose();
00067 bool saveBeforeClear();
00068
00069 private slots:
00070
00071 void slotFileNew();
00072 void slotFileOpen();
00073 bool slotFileSave();
00074 bool slotFileSaveAs();
00075 void slotFilePrint();
00076 void slotFilePreEnc();
00077 void slotFilePreDec();
00078 void slotKeyManager();
00079 void slotFileClose();
00080
00081
00082 void slotundo();
00083 void slotredo();
00084 void slotEditCut();
00085 void slotEditCopy();
00086 void slotEditPaste();
00087 void slotSelectAll();
00088 void slotFind();
00089 void slotFindNext();
00090 void slotFindPrev();
00091 void slotFindText();
00092
00093
00094 void slotSetCharset();
00095 void slotResetEncoding(bool enc);
00096 bool checkEncoding(QTextCodec *codec);
00097
00098
00099 void slotPreSignFile();
00100 void slotSignFile(const KUrl &url);
00101 void slotSignFileFin(KgpgInterface *interface);
00102 void slotPreVerifyFile();
00103 void slotVerifyFile(const KUrl &url);
00104 void slotCheckMd5();
00105 void importSignatureKey(const QString &id);
00106
00107
00108 void slotOptions();
00109
00110 void slotUndoAvailable(const bool &v);
00111 void slotRedoAvailable(const bool &v);
00112 void slotCopyAvailable(const bool &v);
00113
00114 void modified();
00115 void newText();
00116
00117 private:
00118 QStringList m_customdecrypt;
00119 QString m_textencoding;
00120
00121 KToggleAction *m_encodingaction;
00122 KAction *m_editundo;
00123 KAction *m_editredo;
00124 KAction *m_editcopy;
00125 KAction *m_editcut;
00126 KShortcut m_godefaultkey;
00127 KFind *m_find;
00128 KUrl m_docname;
00129
00130 bool m_textchanged;
00131 bool m_ismainwindow;
00132 };
00133
00134 #endif // KGPGEDITOR_H