Make it possible to use a distinct selection model in the foldertreewidget.
[kdepim.git] / messagecomposer / composer.h
blob43956568b732b7b87c4ea8e77c7fffd1594d7f69
1 /*
2 Copyright (c) 2009 Constantin Berzan <exit3219@gmail.com>
4 This library is free software; you can redistribute it and/or modify it
5 under the terms of the GNU Library General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or (at your
7 option) any later version.
9 This library is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to the
16 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 02110-1301, USA.
20 #ifndef MESSAGECOMPOSER_COMPOSER_H
21 #define MESSAGECOMPOSER_COMPOSER_H
23 #include "jobbase.h"
24 #include "kleo/enum.h"
26 #include "messagecomposer_export.h"
27 #include <QtCore/QByteArray>
28 #include <QtCore/QStringList>
30 #include <kmime/kmime_message.h>
32 #include <messagecore/attachmentpart.h>
34 #include <vector>
35 #include <gpgme++/key.h>
37 namespace boost {
38 template <typename T> class shared_ptr;
41 namespace Message {
43 class ComposerPrivate;
44 class GlobalPart;
45 class InfoPart;
46 class TextPart;
48 /**
49 The message composer.
51 class MESSAGECOMPOSER_EXPORT Composer : public JobBase
53 Q_OBJECT
55 public:
56 explicit Composer( QObject *parent = 0 );
57 virtual ~Composer();
59 QList<KMime::Message::Ptr> resultMessages() const;
61 GlobalPart *globalPart();
62 InfoPart *infoPart();
63 TextPart *textPart();
64 KPIM::AttachmentPart::List attachmentParts();
65 void addAttachmentPart( KPIM::AttachmentPart::Ptr part );
66 void addAttachmentParts( const KPIM::AttachmentPart::List &parts );
67 void removeAttachmentPart( KPIM::AttachmentPart::Ptr part );
69 // if the message and attachments should not be encrypted regardless of settings
70 void setNoCrypto( bool noCrypto );
71 void setSignAndEncrypt( const bool doSign, const bool doEncrypt );
72 void setMessageCryptoFormat( Kleo::CryptoMessageFormat format );
73 void setSigningKeys( std::vector<GpgME::Key>& signers );
74 void setEncryptionKeys(QList<QPair<QStringList, std::vector<GpgME::Key> > > data );
76 public Q_SLOTS:
77 virtual void start();
79 private:
80 Q_DECLARE_PRIVATE( Composer )
82 Q_PRIVATE_SLOT( d_func(), void doStart() )
83 Q_PRIVATE_SLOT( d_func(), void skeletonJobFinished(KJob*) )
84 Q_PRIVATE_SLOT( d_func(), void contentJobFinished(KJob*) )
85 Q_PRIVATE_SLOT( d_func(), void contentJobPreCryptFinished(KJob*) )
86 Q_PRIVATE_SLOT( d_func(), void contentJobPreInlineFinished(KJob*) )
87 Q_PRIVATE_SLOT( d_func(), void signBeforeEncryptJobFinished(KJob*) )
88 Q_PRIVATE_SLOT( d_func(), void attachmentsFinished(KJob*) )
93 #endif