Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
PIM
Mail-related libraries
Commits
b994bb43
Commit
b994bb43
authored
Mar 22, 2016
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start to create email object
parent
cc27e9e9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
93 additions
and
0 deletions
+93
-0
kaddressbookgrantlee/src/CMakeLists.txt
kaddressbookgrantlee/src/CMakeLists.txt
+1
-0
kaddressbookgrantlee/src/printing/contactgrantleeprintemail.cpp
...ssbookgrantlee/src/printing/contactgrantleeprintemail.cpp
+48
-0
kaddressbookgrantlee/src/printing/contactgrantleeprintemail.h
...ressbookgrantlee/src/printing/contactgrantleeprintemail.h
+44
-0
No files found.
kaddressbookgrantlee/src/CMakeLists.txt
View file @
b994bb43
...
...
@@ -21,6 +21,7 @@ set(kaddressbook_grantlee_printing_LIB_SRCS
printing/contactgrantleeprintobject.cpp
printing/contactgrantleeprintphoneobject.cpp
printing/contactgrantleeprintwebsite.cpp
printing/contactgrantleeprintemail.cpp
printing/grantleeprint.cpp
)
...
...
kaddressbookgrantlee/src/printing/contactgrantleeprintemail.cpp
0 → 100644
View file @
b994bb43
/*
Copyright (c) 2016 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "contactgrantleeprintemail.h"
using
namespace
KAddressBookGrantlee
;
ContactGrantleePrintEmail
::
ContactGrantleePrintEmail
(
const
KContacts
::
Addressee
&
addressee
,
const
KContacts
::
Email
&
email
,
QObject
*
parent
)
:
QObject
(
parent
),
mEmail
(
email
),
mAddressee
(
addressee
)
{
}
ContactGrantleePrintEmail
::~
ContactGrantleePrintEmail
()
{
}
QString
ContactGrantleePrintEmail
::
email
()
const
{
//TODO
return
{};
}
QString
ContactGrantleePrintEmail
::
emailFormatted
()
const
{
const
QString
email
=
mEmail
.
mail
();
const
QString
fullEmail
=
QString
::
fromLatin1
(
QUrl
::
toPercentEncoding
(
mAddressee
.
fullEmail
(
email
)));
const
QString
url
=
QStringLiteral
(
"<a href=
\"
mailto:%1
\"
>%2</a>"
)
.
arg
(
fullEmail
,
email
);
return
url
;
}
kaddressbookgrantlee/src/printing/contactgrantleeprintemail.h
0 → 100644
View file @
b994bb43
/*
Copyright (c) 2016 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef CONTACTGRANTLEEPRINTEMAIL_H
#define CONTACTGRANTLEEPRINTEMAIL_H
#include <QObject>
#include <KContacts/Addressee>
#include <KContacts/Email>
namespace
KAddressBookGrantlee
{
class
ContactGrantleePrintEmail
:
public
QObject
{
Q_OBJECT
Q_PROPERTY
(
QString
emailFormatted
READ
emailFormatted
)
Q_PROPERTY
(
QString
email
READ
email
)
public:
explicit
ContactGrantleePrintEmail
(
const
KContacts
::
Addressee
&
addressee
,
const
KContacts
::
Email
&
email
,
QObject
*
parent
=
Q_NULLPTR
);
~
ContactGrantleePrintEmail
();
QString
emailFormatted
()
const
;
QString
email
()
const
;
private:
KContacts
::
Email
mEmail
;
KContacts
::
Addressee
mAddressee
;
};
}
#endif // CONTACTGRANTLEEPRINTEMAIL_H
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment