Framework for looking up contacts directly in nepomuk in addition to going through...
[kdepim.git] / messagecomposer / emailaddressresolvejob.h
bloba222cd3772b2303a24c647ddb0fa1acb4c35d32f
2 class Composer;/*
3 * This file is part of KMail.
5 * Copyright (c) 2010 KDAB
7 * Authors: Tobias Koenig <tokoe@kde.org>
8 * Leo Franchi <lfranchi@kde.org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 #ifndef EMAILADDRESSRESOLVEJOB_H
26 #define EMAILADDRESSRESOLVEJOB_H
28 #include "messagecomposer_export.h"
30 #include <kjob.h>
32 #include <QtCore/QStringList>
33 #include <QtCore/QVariant>
35 namespace Message {
36 class Composer;
39 namespace MessageComposer {
41 /**
42 * @short A job to resolve nicknames, distribution lists and email addresses for queued emails.
44 class MESSAGECOMPOSER_EXPORT EmailAddressResolveJob : public KJob
46 Q_OBJECT
48 public:
49 /**
50 * Creates a new email address resolve job.
52 * @param parent The parent object.
54 EmailAddressResolveJob( QObject *parent = 0 );
56 /**
57 * Destroys the email address resolve job.
59 ~EmailAddressResolveJob();
61 /**
62 * Starts the job.
64 virtual void start();
66 /**
67 * Sets the from address to expand.
69 virtual void setFrom( const QString& from );
71 /**
72 * Sets the from address to expand.
74 virtual void setTo( const QStringList& from );
76 /**
77 * Sets the from address to expand.
79 virtual void setCc( const QStringList& from );
81 /**
82 * Sets the from address to expand.
84 virtual void setBcc( const QStringList& from );
86 /**
87 * Returns the expanded From field
89 virtual QString expandedFrom() const;
91 /**
92 * Returns the expanded To field
94 virtual QStringList expandedTo() const;
96 /**
97 * Returns the expanded CC field
99 virtual QStringList expandedCc() const;
102 * Returns the expanded Bcc field
104 virtual QStringList expandedBcc() const;
106 private Q_SLOTS:
107 void slotAliasExpansionDone( KJob* );
109 private:
110 int mJobCount;
111 QVariantMap mResultMap;
112 QString mFrom;
113 QStringList mTo, mCc, mBcc;
118 #endif