1
/* ============================================================
3
* This file is a part of kipi-plugins project
4
* http://www.kipi-plugins.org
7
* Description : e-mail settings container.
9
* Copyright (C) 2007-2010 by Gilles Caulier <caulier dot gilles at gmail dot com>
10
* Copyright (C) 2010 by Andi Clemens <andi dot clemens at gmx dot net>
12
* This program is free software; you can redistribute it
13
* and/or modify it under the terms of the GNU General
14
* Public License as published by the Free Software Foundation;
15
* either version 2, or (at your option) any later version.
17
* This program is distributed in the hope that it will be useful,
18
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
* GNU General Public License for more details.
22
* ============================================================ */
24
#ifndef EMAILSETTINGSCONTAINER_H
25
#define EMAILSETTINGSCONTAINER_H
31
#include <QStringList>
37
namespace KIPISendimagesPlugin
45
int rating; // Image Rating from Kipi host.
47
QString comments; // Image comments from Kipi host.
49
QStringList tags; // List of keywords from Kipi host.
51
KUrl orgUrl; // Url of original image.
52
KUrl emailUrl; // Url of attached image in e-mail (can be resized).
55
class EmailSettingsContainer
62
DEFAULT = 0, // Default e-mail settings from KDE control panel.
92
EmailSettingsContainer()
94
addCommentsAndTags = false;
95
imagesChangeProp = false;
96
attachmentLimitInMbytes = 17;
97
imageCompression = 75;
103
~EmailSettingsContainer(){};
107
if(imageSize == SMALL)
109
else if(imageSize == MEDIUM)
111
else if(imageSize == BIG)
113
else if(imageSize == VERYBIG)
115
else if(imageSize == HUGE)
118
return 320; // VERYSMALL
123
if (imageFormat == JPEG)
124
return QString("JPEG");
126
return QString("PNG");
129
void setEmailUrl(const KUrl& orgUrl, const KUrl& emailUrl)
131
for (QList<EmailItem>::iterator it = itemsList.begin();
132
it != itemsList.end(); ++it)
134
if ((*it).orgUrl == orgUrl)
136
(*it).emailUrl = emailUrl;
142
KUrl emailUrl(const KUrl& orgUrl)
144
for (QList<EmailItem>::iterator it = itemsList.begin();
145
it != itemsList.end(); ++it)
147
if ((*it).orgUrl == orgUrl)
149
return (*it).emailUrl;
154
qint64 attachementLimitInBytes()
156
qint64 val = attachmentLimitInMbytes * 1024 * 1024;
162
bool addCommentsAndTags;
163
bool imagesChangeProp;
165
int imageCompression;
167
int attachmentLimitInMbytes;
170
QString tempFolderName;
172
EmailClient emailProgram;
176
ImageFormat imageFormat;
178
QList<EmailItem> itemsList;
181
} // namespace KIPISendimagesPlugin
183
#endif // EMAILSETTINGSCONTAINER_H