SVN_SILENT made messages (after extraction)
[kdepim.git] / ktnef / ktnefmain.h
blob1a70cde67f9877d2b149bd772a1ee6a31cc63dbd
1 /*
2 This file is part of KTnef.
4 Copyright (C) 2002 Michael Goffioul <kdeprint@swing.be>
5 Copyright (c) 2012 Allen Winter <winter@kde.org>
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 You should have received a copy of the GNU General Public License
13 along with this program; if not, write to the Free Software Foundation,
14 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
17 #ifndef KTNEFMAIN_H
18 #define KTNEFMAIN_H
20 #include <KXmlGuiWindow>
21 #include <KService>
22 class QActionGroup;
23 class QAction;
24 class QContextMenuEvent;
25 class QTreeWidgetItem;
26 class KRecentFilesAction;
27 class QUrl;
29 namespace KTnef
31 class KTNEFParser;
32 class KTNEFAttach;
34 using namespace KTnef;
36 class KTNEFView;
38 class KTNEFMain : public KXmlGuiWindow
40 Q_OBJECT
42 public:
43 explicit KTNEFMain(QWidget *parent = Q_NULLPTR);
44 ~KTNEFMain();
46 void loadFile(const QString &filename);
48 protected:
49 void contextMenuEvent(QContextMenuEvent *event) Q_DECL_OVERRIDE;
51 protected Q_SLOTS:
52 void openFile();
53 void viewFile();
54 void viewFileAs();
55 void extractFile();
56 void extractFileTo();
57 void propertiesFile();
58 void optionDefaultDir();
59 void extractAllFiles();
60 void slotEditToolbars();
61 void slotNewToolbarConfig();
62 void slotShowMessageProperties();
63 void slotShowMessageText();
64 void slotSaveMessageText();
66 void viewSelectionChanged();
67 void viewDoubleClicked(QTreeWidgetItem *);
68 void viewDragRequested(const QList<KTNEFAttach *> &list);
69 void slotConfigureKeys();
70 void openRecentFile(const QUrl &);
72 private Q_SLOTS:
73 void slotOpenWithAction(QAction *act);
75 private:
76 void addRecentFile(const QUrl &url);
77 void setupStatusbar();
78 void setupActions();
79 void setupTNEF();
80 void enableExtractAll(bool on = true);
81 void enableSingleAction(bool on = true);
82 void cleanup();
84 void extractTo(const QString &dirname);
85 QString extractTemp(KTNEFAttach *att);
87 void openWith(const KService::Ptr &offer);
88 void createOpenWithMenu(QMenu *topMenu);
89 QAction *createAppAction(const KService::Ptr &service, bool singleOffer, QActionGroup *actionGroup, QObject *parent);
91 private:
92 KTNEFView *mView;
93 KTNEFParser *mParser;
94 QString mFilename;
95 QString mDefaultDir;
96 QString mLastDir;
97 KRecentFilesAction *mOpenRecentFileAction;
99 Q_DECLARE_METATYPE(KService::Ptr)
100 #endif