• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

mailcommon

  • sources
  • kde-4.12
  • kdepim
  • mailcommon
  • filter
filteractionreplyto.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 1996-1998 Stefan Taferner <taferner@kde.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  *
18  */
19 
20 #include "filteractionreplyto.h"
21 
22 #include <KDE/KLocale>
23 
24 using namespace MailCommon;
25 
26 FilterAction* FilterActionReplyTo::newAction()
27 {
28  return new FilterActionReplyTo;
29 }
30 
31 FilterActionReplyTo::FilterActionReplyTo( QObject *parent )
32  : FilterActionWithAddress( QLatin1String("set Reply-To"), i18n( "Set Reply-To To" ), parent )
33 {
34  mParameter.clear();
35 }
36 
37 FilterAction::ReturnCode FilterActionReplyTo::process(ItemContext &context , bool) const
38 {
39  const KMime::Message::Ptr msg = context.item().payload<KMime::Message::Ptr>();
40  const QByteArray replyTo("Reply-To");
41  KMime::Headers::Base *header = KMime::Headers::createHeader( replyTo );
42  if ( !header ) {
43  header = new KMime::Headers::Generic( replyTo, msg.get(), mParameter, "utf-8" );
44  } else {
45  header->fromUnicodeString( mParameter, "utf-8" );
46  }
47  msg->setHeader( header );
48  msg->assemble();
49 
50  context.setNeedsPayloadStore();
51 
52  return GoOn;
53 }
54 
55 SearchRule::RequiredPart FilterActionReplyTo::requiredPart() const
56 {
57  return SearchRule::CompleteMessage;
58 }
59 
60 
61 #include "filteractionreplyto.moc"
filteractionreplyto.h
MailCommon::FilterAction::GoOn
Go on with applying filter actions.
Definition: filteraction.h:62
MailCommon::ItemContext::setNeedsPayloadStore
void setNeedsPayloadStore()
Marks that the item's payload has been changed and needs to be written back.
Definition: itemcontext.cpp:45
QObject
MailCommon::SearchRule::CompleteMessage
Definition: searchpattern.h:107
MailCommon::FilterAction
Abstract base class for mail filter actions.
Definition: filteraction.h:52
MailCommon::FilterActionReplyTo::FilterActionReplyTo
FilterActionReplyTo(QObject *parent=0)
Definition: filteractionreplyto.cpp:31
MailCommon::SearchRule::RequiredPart
RequiredPart
Definition: searchpattern.h:104
MailCommon::FilterActionReplyTo::process
ReturnCode process(ItemContext &context, bool applyOnOutbound) const
Execute action on given message (inside the item context).
Definition: filteractionreplyto.cpp:37
MailCommon::FilterActionReplyTo::newAction
static FilterAction * newAction()
Definition: filteractionreplyto.cpp:26
MailCommon::FilterActionWithString::mParameter
QString mParameter
Definition: filteractionwithstring.h:91
MailCommon::FilterAction::ReturnCode
ReturnCode
Describes the possible return codes of filter processing:
Definition: filteraction.h:60
MailCommon::FilterActionReplyTo::requiredPart
SearchRule::RequiredPart requiredPart() const
Returns the required part from the item that is needed for the action to operate. ...
Definition: filteractionreplyto.cpp:55
MailCommon::ItemContext::item
Akonadi::Item & item()
Returns the item of the context.
Definition: itemcontext.cpp:30
context
const char * context
Definition: searchpatternedit.cpp:54
MailCommon::FilterActionWithAddress
Abstract base class for filter actions with a mail address as parameter.
Definition: filteractionwithaddress.h:42
MailCommon::ItemContext
A helper class for the filtering process.
Definition: itemcontext.h:39
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:14 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

mailcommon

Skip menu "mailcommon"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal