1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 //USER INCLUDES |
|
19 #include "unieditormmsplugin.h" |
|
20 #include "unieditormmsplugin_p.h" |
|
21 #include "debugtraces.h" |
|
22 |
|
23 //--------------------------------------------------------------- |
|
24 // UniEditorMmsPlugin::UniEditorMmsPlugin() |
|
25 // @see header |
|
26 //--------------------------------------------------------------- |
|
27 UniEditorMmsPlugin::UniEditorMmsPlugin(QObject* parent) : |
|
28 QObject(parent) |
|
29 { |
|
30 int error; |
|
31 TRAP( error, d_ptr = CUniEditorMmsPluginPrivate::NewL()); |
|
32 QDEBUG_WRITE_FORMAT("UniEditorMmsPlugin returning with ",error); |
|
33 } |
|
34 |
|
35 //--------------------------------------------------------------- |
|
36 // UniEditorMmsPlugin::~UniEditorMmsPlugin() |
|
37 // @see header |
|
38 //--------------------------------------------------------------- |
|
39 UniEditorMmsPlugin::~UniEditorMmsPlugin() |
|
40 { |
|
41 delete d_ptr; |
|
42 } |
|
43 |
|
44 //--------------------------------------------------------------- |
|
45 // UniEditorMmsPlugin::messageType() |
|
46 // @see header |
|
47 //--------------------------------------------------------------- |
|
48 ConvergedMessage::MessageType UniEditorMmsPlugin::messageType() |
|
49 { |
|
50 return ConvergedMessage::Mms; |
|
51 } |
|
52 |
|
53 //--------------------------------------------------------------- |
|
54 // UniEditorMmsPlugin::convertFrom() |
|
55 // @see header |
|
56 //--------------------------------------------------------------- |
|
57 ConvergedMessage* UniEditorMmsPlugin::convertFrom( TMsvId aId ) |
|
58 { |
|
59 int error; |
|
60 ConvergedMessage* msg = NULL; |
|
61 TRAP( error, msg = d_ptr->convertFromL(aId)); |
|
62 QDEBUG_WRITE_FORMAT("Exiting convertFrom with error = ",error); |
|
63 return msg; |
|
64 } |
|
65 |
|
66 //--------------------------------------------------------------- |
|
67 // UniEditorMmsPlugin::deleteDraftsEntry() |
|
68 // @see header |
|
69 //--------------------------------------------------------------- |
|
70 void UniEditorMmsPlugin::deleteDraftsEntry( TMsvId aId ) |
|
71 { |
|
72 int error; |
|
73 TRAP( error, d_ptr->deleteDraftsEntryL(aId)); |
|
74 QDEBUG_WRITE_FORMAT("Exiting deleteDraftsEntry with error = ",error); |
|
75 } |
|
76 |
|
77 //--------------------------------------------------------------- |
|
78 // UniEditorMmsPlugin::convertTo() |
|
79 // @see header |
|
80 //--------------------------------------------------------------- |
|
81 TMsvId UniEditorMmsPlugin::convertTo( ConvergedMessage *aMessage ) |
|
82 { |
|
83 int error; |
|
84 TMsvId id = -1; |
|
85 TRAP( error, id = d_ptr->convertToL(aMessage)); |
|
86 QDEBUG_WRITE_FORMAT("Exiting convertTo and msgId = ",id); |
|
87 return id; |
|
88 } |
|
89 |
|
90 //--------------------------------------------------------------- |
|
91 // UniEditorMmsPlugin::send() |
|
92 // @see header |
|
93 //--------------------------------------------------------------- |
|
94 bool UniEditorMmsPlugin::send(TMsvId aId) |
|
95 { |
|
96 int error = KErrNone; |
|
97 TRAP( error, d_ptr->sendL(aId)); |
|
98 QDEBUG_WRITE_FORMAT("send returning with error= ",error); |
|
99 |
|
100 return (error != KErrNone) ? false : true; |
|
101 } |
|
102 |
|
103 //--------------------------------------------------------------- |
|
104 // UniEditorMmsPlugin::isServiceValid() |
|
105 // @see header |
|
106 //--------------------------------------------------------------- |
|
107 TBool UniEditorMmsPlugin::isServiceValid() |
|
108 { |
|
109 int error; |
|
110 TBool valid = false; |
|
111 TRAP( error, valid = d_ptr->isServiceValidL()); |
|
112 QDEBUG_WRITE_FORMAT("Exiting isServiceValid with validity= ",valid); |
|
113 return valid; |
|
114 } |
|
115 |
|
116 //--------------------------------------------------------------- |
|
117 // UniEditorMmsPlugin::validateService() |
|
118 // @see header |
|
119 //--------------------------------------------------------------- |
|
120 TBool UniEditorMmsPlugin::validateService( TBool aEmailOverSms) |
|
121 { |
|
122 int error; |
|
123 TBool valid = false; |
|
124 TRAP( error, valid = d_ptr->validateServiceL(aEmailOverSms)); |
|
125 QDEBUG_WRITE_FORMAT("Exiting validateService with validity= ",valid); |
|
126 return valid; |
|
127 } |
|
128 |
|
129 Q_EXPORT_PLUGIN2(unieditormmsplugin, UniEditorMmsPlugin) |
|
130 |
|