kmail
kmcommands.cpp
Go to the documentation of this file.
175 kWarning() << "There is no GUI delegate set for a kjob, and it failed with error:" << job->errorString();
309 // TODO once the message list is based on ETM and we get the more advanced caching we need to make that check a bit more clever
316 connect( fetch, SIGNAL(itemsReceived(Akonadi::Item::List)), SLOT(slotMsgTransfered(Akonadi::Item::List)) );
398 QSharedPointer<FolderCollection> fd = FolderCollection::forCollection( mMessage.parentCollection(), false );
429 MessageFactory factory( msg, item.id(), MailCommon::Util::updatedCollection(item.parentCollection()) );
437 rmsg->to()->fromUnicodeString( KPIMUtils::decodeMailtoUrl( mUrl ), "utf-8" ); //TODO Check the UTF-8
442 KMail::Composer * win = KMail::makeComposer( rmsg, lastSign, lastEncrypt, KMail::Composer::Reply, 0, mSelection );
465 MessageFactory factory( msg, item.id(), MailCommon::Util::updatedCollection(item.parentCollection()) );
469 fmsg->to()->fromUnicodeString( KPIMUtils::decodeMailtoUrl( mUrl ).toLower(), "utf-8" ); //TODO check the utf-8
474 KMail::Composer * win = KMail::makeComposer( fmsg, lastSign, lastEncrypt, KMail::Composer::Forward );
488 const QString filename = KStandardDirs::locateLocal( "data", QString::fromLatin1("konqueror/bookmarks.xml") );
489 KBookmarkManager *bookManager = KBookmarkManager::managerForFile( filename, QLatin1String("konqueror") );
559 KMEditItemCommand::KMEditItemCommand( QWidget *parent, const Akonadi::Item&msg, bool deleteFromSource )
598 const MailTransport::TransportAttribute *transportAttribute = item.attribute<MailTransport::TransportAttribute>();
602 int transportId = msg->headerByType( "X-KMail-Transport" ) ? msg->headerByType( "X-KMail-Transport" )->asUnicodeString().toInt() : -1;
614 const MailTransport::SentBehaviourAttribute *sentAttribute = item.attribute<MailTransport::SentBehaviourAttribute>();
615 if ( sentAttribute && ( sentAttribute->sentBehaviour() == MailTransport::SentBehaviourAttribute::MoveToCollection ) )
678 fetchScope().fetchFullPayload( true ); // ### unless we call the corresponding KMCommand ctor, this has no effect
781 msg->setContent( KMime::CRLFtoLF( mMsgString.mid( startOfMessage,endOfMessage - startOfMessage ).toUtf8() ) );
803 KMReplyCommand::KMReplyCommand( QWidget *parent, const Akonadi::Item &msg, MessageComposer::ReplyStrategy replyStrategy,
828 MessageFactory factory( msg, item.id(), MailCommon::Util::updatedCollection(item.parentCollection()) );
845 KMail::Composer * win = KMail::makeComposer( KMime::Message::Ptr( reply.msg ), lastSign, lastEncrypt, replyContext( reply ), 0,
882 MessageFactory factory( msg, item.id(), MailCommon::Util::updatedCollection(item.parentCollection()) );
889 uint id = msg->headerByType( "X-KMail-Identity" ) ? msg->headerByType("X-KMail-Identity")->asUnicodeString().trimmed().toUInt() : 0;
898 KMail::Composer * win = KMail::makeComposer( fwdMsg, lastSign, lastEncrypt, KMail::Composer::Forward, id,QString(), mTemplate );
921 MessageFactory factory( KMime::Message::Ptr( new KMime::Message ), firstItem.id(), MailCommon::Util::updatedCollection(firstItem.parentCollection()) );
925 QPair< KMime::Message::Ptr, KMime::Content* > fwdMsg = factory.createForwardDigestMIME(msgList );
926 KMail::Composer * win = KMail::makeComposer( fwdMsg.first, false, false, KMail::Composer::Forward, mIdentity );
975 MessageFactory factory( KMime::Message::Ptr( new KMime::Message ), firstItem.id(), MailCommon::Util::updatedCollection(firstItem.parentCollection()) );
979 QPair< KMime::Message::Ptr, QList< KMime::Content* > > fwdMsg = factory.createAttachedForward( msgList );
1014 const MailCommon::RedirectDialog::SendMode sendMode = MessageComposer::MessageComposerSettings::self()->sendImmediate()
1018 MessageViewer::AutoQPointer<MailCommon::RedirectDialog> dlg( new MailCommon::RedirectDialog( sendMode, parentWidget() ) );
1023 if ( !TransportManager::self()->showTransportCreationDialog( parentWidget(), TransportManager::IfNoTransportExists ) )
1027 const MessageComposer::MessageSender::SendMethod method = (dlg->sendMode() == MailCommon::RedirectDialog::SendNow)
1041 MessageFactory factory( msg, item.id(), MailCommon::Util::updatedCollection(item.parentCollection()) );
1046 const MailTransport::TransportAttribute *transportAttribute = item.attribute<MailTransport::TransportAttribute>();
1049 const MailTransport::Transport *transport = MailTransport::TransportManager::self()->transportById( transportId );
1056 const MailTransport::SentBehaviourAttribute *sentAttribute = item.attribute<MailTransport::SentBehaviourAttribute>();
1058 if ( sentAttribute && ( sentAttribute->sentBehaviour() == MailTransport::SentBehaviourAttribute::MoveToCollection ) )
1061 const KMime::Message::Ptr newMsg = factory.createRedirect( to, cc, bcc, transportId, fcc, identity );
1109 void KMPrintCommand::setAttachmentStrategy( const MessageViewer::AttachmentStrategy *strategy )
1218 KMSetTagCommand::KMSetTagCommand( const Akonadi::Tag::List &tags, const QList<Akonadi::Item> &item,
1397 Akonadi::ItemCopyJob *job = new Akonadi::ItemCopyJob( listItem, Akonadi::Collection(mDestFolder.id()),this );
1453 std::sort( items.begin(), items.end(), boost::bind( &Akonadi::Item::storageCollectionId, _1 ) <
1478 mDestFolder.isValid() ? i18n( "Moving messages" ) : i18n( "Deleting messages" ), QString(), true, KPIM::ProgressItem::Unknown );
1511 KMTrashMsgCommand::KMTrashMsgCommand( const Akonadi::Collection& srcFolder, const Akonadi::Item & msg,MessageList::Core::MessageItemSetReference ref )
1528 KMSaveAttachmentsCommand::KMSaveAttachmentsCommand(QWidget *parent, const Akonadi::Item& msg , MessageViewer::Viewer *viewer)
1535 KMSaveAttachmentsCommand::KMSaveAttachmentsCommand( QWidget *parent, const QList<Akonadi::Item>& msgs )
1547 contentsToSave += MessageViewer::Util::extractAttachments( item.payload<KMime::Message::Ptr>().get() );
1577 MessageFactory factory( msg, item.id(), MailCommon::Util::updatedCollection(item.parentCollection()) );
1627 Akonadi::ItemFetchJob *KMFetchMessageCommand::createFetchJob( const Akonadi::Item::List &items )
void messagesTransfered(KMCommand::Result result)
virtual void setFocusToSubject()=0
Sets the focus to the subject line edit.
void clear()
void moveDone(KMMoveCommand *)
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
KMForwardCommand(QWidget *parent, const QList< Akonadi::Item > &msgList, uint identity=0, const QString &templateName=QString())
Definition: kmcommands.cpp:854
KMMailtoForwardCommand(QWidget *parent, const KUrl &url, const Akonadi::Item &msg)
Definition: kmcommands.cpp:450
QString & append(QChar ch)
void showMessage(const QString &encoding, const Akonadi::Item &msg, const Akonadi::Collection &parentCollection=Akonadi::Collection())
take ownership of and show
Definition: kmreadermainwin.cpp:136
void slotModifyItemDone(KJob *job)
Definition: kmcommands.cpp:1294
KMOpenMsgCommand(QWidget *parent, const KUrl &url=KUrl(), const QString &encoding=QString(), KMMainWidget *main=0)
Definition: kmcommands.cpp:690
This class implements a "reader window", that is a window used for reading or viewing messages...
Definition: kmreaderwin.h:49
static BroadcastStatus * instance()
QStringList split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
KMUseTemplateCommand(QWidget *parent, const Akonadi::Item &msg)
Definition: kmcommands.cpp:638
Akonadi::Item::Id putRepliesInSameFolder(const Akonadi::Item &item)
Whether or not the mail item has the keep-reply-in-folder attribute set.
Definition: util.cpp:76
bool contains(const QString &str, Qt::CaseSensitivity cs) const
bool isEmpty() const
CollectionPane * messageListPane() const
Access to the header list pane.
Definition: kmmainwidget.h:124
Definition: kmcommands.h:523
void updateProgress()
T * data() const
virtual void setMessage(const KMime::Message::Ptr &newMsg, bool lastSignState=false, bool lastEncryptState=false, bool mayAutoSign=true, bool allowDecryption=false, bool isModified=false)=0
Set the message the composer shall work with.
Definition: kmcommands.h:461
void setResult(Result result)
Use this to set the result of the command.
Definition: kmcommands.h:116
KMPrintCommand(QWidget *parent, const Akonadi::Item &msg, MessageViewer::HeaderStyle *headerStyle=0, MessageViewer::HeaderStrategy *headerStrategy=0, MessageViewer::Viewer::DisplayFormatMessage format=MessageViewer::Viewer::UseGlobalSetting, bool htmlLoadExtOverride=false, bool useFixedFont=false, const QString &encoding=QString())
Definition: kmcommands.cpp:1081
void setHeaderStyleAndStrategy(MessageViewer::HeaderStyle *style, MessageViewer::HeaderStrategy *strategy)
Set the header style and strategy.
Definition: kmreaderwin.cpp:283
void incCompletedItems(unsigned int v=1)
KMFilterActionCommand(QWidget *parent, const QVector< qlonglong > &msgListId, const QString &filterId)
Definition: kmcommands.cpp:1302
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
Definition: composer.h:46
Definition: composer.h:39
KMime::Types::Mailbox::List mailingListsFromMessage(const Akonadi::Item &item)
Returns any mailing list post addresses set on the parent collection (the mail folder) of the item...
Definition: util.cpp:61
void setOverrideEncoding(const QString &encoding)
Set the override character encoding.
Definition: kmreaderwin.cpp:288
void setStatusMsg(const QString &message)
Definition: composer.h:46
KMMetaFilterActionCommand(const QString &filterId, KMMainWidget *main)
Definition: kmcommands.cpp:1343
virtual void setFcc(const QString &idString)=0
virtual Akonadi::ItemFetchJob * createFetchJob(const Akonadi::Item::List &items)
Definition: kmcommands.cpp:277
Definition: kmcommands.h:441
virtual void addAttachment(const KUrl &url, const QString &comment)=0
const char * name() const
KMMailtoReplyCommand(QWidget *parent, const KUrl &url, const Akonadi::Item &msg, const QString &selection)
Definition: kmcommands.cpp:415
KMMoveCommand(const Akonadi::Collection &destFolder, const QList< Akonadi::Item > &msgList, MessageList::Core::MessageItemSetReference ref)
Definition: kmcommands.cpp:1413
QString number(int n, int base)
int count(const T &value) const
void append(const T &value)
bool empty() const
virtual void addAttach(KMime::Content *msgPart)=0
Add an attachment to the list.
Small helper structure which encapsulates the KMMessage created when creating a reply, and.
Definition: kmcommands.h:48
virtual void setFolder(const Akonadi::Collection &)=0
If this folder is set, the original message is inserted back after canceling.
void setDecryptMessageOverwrite(bool overwrite=true)
Enforce message decryption.
Definition: kmreaderwin.cpp:598
void setDeletesItself(bool deletesItself)
Specify whether the subclass takes care of the deletion of the object.
Definition: kmcommands.h:100
Window class for secondary KMail window like the composer window and the separate message window...
Definition: secondarywindow.h:44
void setDisplayFormatMessageOverwrite(MessageViewer::Viewer::DisplayFormatMessage format)
Definition: kmreaderwin.cpp:466
static KMail::Composer::TemplateContext replyContext(MessageFactory::MessageReply reply)
Small helper function to get the composer context from a reply.
Definition: kmcommands.cpp:157
KMReplyCommand(QWidget *parent, const Akonadi::Item &msg, MessageComposer::ReplyStrategy replyStrategy, const QString &selection=QString(), bool noquote=false, const QString &templateName=QString())
Definition: kmcommands.cpp:803
Definition: kmcommands.h:53
void slotModifyItemDone(KJob *job)
Definition: kmcommands.cpp:1210
void setComplete()
bool isEmpty() const
bool isEmpty() const
void setAttachmentStrategy(const MessageViewer::AttachmentStrategy *strategy)
Definition: kmreaderwin.cpp:279
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
void setEmitsCompletedItself(bool emitsCompletedItself)
Specify whether the subclass takes care of emitting the completed() signal.
Definition: kmcommands.h:110
static void showJobError(KJob *job)
Helper to sanely show an error message for a job.
Definition: kmcommands.cpp:166
QString to() const
void setHtmlLoadExtOverride(bool override)
Definition: kmreaderwin.cpp:473
KMTrashMsgCommand(const Akonadi::Collection &srcFolder, const QList< Akonadi::Item > &msgList, MessageList::Core::MessageItemSetReference ref)
Definition: kmcommands.cpp:1505
KMUrlSaveCommand(const KUrl &url, QWidget *parent)
Definition: kmcommands.cpp:499
KMEditMessageCommand(QWidget *parent, const KMime::Message::Ptr &msg)
Definition: kmcommands.cpp:539
const QList< Akonadi::Item > retrievedMsgs() const
Definition: kmcommands.cpp:214
virtual void setModified(bool modified)=0
Definition: kmmainwidget.h:91
KMSetTagCommand(const Akonadi::Tag::List &tags, const QList< Akonadi::Item > &item, SetTagMode mode=AddIfNotExisting)
Definition: kmcommands.cpp:1218
KMRedirectCommand(QWidget *parent, const Akonadi::Item &msg)
Definition: kmcommands.cpp:1001
void deleteLater()
T & first()
virtual void setCurrentReplyTo(const QString &replyTo)=0
void clear()
Definition: kmcommands.h:53
void setAttachmentStrategy(const MessageViewer::AttachmentStrategy *strategy)
Definition: kmcommands.cpp:1109
Definition: composer.h:46
KMResendMessageCommand(QWidget *parent, const Akonadi::Item &msg=Akonadi::Item())
Definition: kmcommands.cpp:1562
KMSaveAttachmentsCommand(QWidget *parent, const Akonadi::Item &msg, MessageViewer::Viewer *viewer)
Use this to save all attachments of the given message.
Definition: kmcommands.cpp:1528
KMForwardAttachedCommand(QWidget *parent, const QList< Akonadi::Item > &msgList, uint identity=0, KMail::Composer *win=0)
Definition: kmcommands.cpp:953
KMAddBookmarksCommand(const KUrl &url, QWidget *parent)
Definition: kmcommands.cpp:481
void setUsesBusyIndicator(bool useBusyIndicator)
KMSetStatusCommand(const MessageStatus &status, const Akonadi::Item::List &items, bool invert=false)
Definition: kmcommands.cpp:1143
KMFetchMessageCommand(QWidget *parent, const Akonadi::Item &item)
Definition: kmcommands.cpp:1620
KMMailtoComposeCommand(const KUrl &url, const Akonadi::Item &msg=Akonadi::Item())
Definition: kmcommands.cpp:386
QString mid(int position, int n) const
T takeFirst()
Definition: kmcommands.h:53
virtual void setCurrentTransport(int transportId)=0
Akonadi::ItemFetchScope & fetchScope()
Allows to configure how much data should be retrieved of the messages.
Definition: kmcommands.h:85
Definition: kmreadermainwin.h:34
int count(const T &value) const
int length() const
Definition: kmcommands.h:53
char * data()
void lastEncryptAndSignState(bool &lastEncrypt, bool &lastSign, const KMime::Message::Ptr &msg)
Definition: util.cpp:185
KMCopyCommand(const Akonadi::Collection &destFolder, const QList< Akonadi::Item > &msgList)
Definition: kmcommands.cpp:1381
virtual void setFocusToEditor()=0
Sets the focus to the edit-widget and the cursor below the "On ... you wrote" line when hasMessage is...
QString fromLatin1(const char *str, int size)
void setTotalItems(unsigned int v)
Definition: composer.h:46
const_iterator constEnd() const
const_iterator constBegin() const
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QObject * parent() const
iterator begin()
KMSaveMsgCommand(QWidget *parent, const QList< Akonadi::Item > &msgList)
Definition: kmcommands.cpp:672
KMEditItemCommand(QWidget *parent, const Akonadi::Item &msg, bool deleteFromSource=true)
Definition: kmcommands.cpp:559
KMMailingListFilterCommand(QWidget *parent, const Akonadi::Item &msg)
Definition: kmcommands.cpp:1358
QByteArray toUtf8() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:33 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:33 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.