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
20 #ifndef MESSAGECOMPOSER_COMPOSER_H
21 #define MESSAGECOMPOSER_COMPOSER_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>
35 #include <gpgme++/key.h>
38 template <typename T
> class shared_ptr
;
43 class ComposerPrivate
;
51 class MESSAGECOMPOSER_EXPORT Composer
: public JobBase
56 explicit Composer( QObject
*parent
= 0 );
59 QList
<KMime::Message::Ptr
> resultMessages() const;
61 GlobalPart
*globalPart();
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
);
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
*) )