messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/src/unieditormmsplugin.cpp
changeset 25 84d9eb65b26f
child 48 4f501b74aeb1
equal deleted inserted replaced
23:238255e8b033 25:84d9eb65b26f
       
     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     UniEditorPluginInterface::EditorOperation aOperation )
       
    59 {
       
    60     int error;
       
    61     ConvergedMessage* msg = NULL;
       
    62     TRAP( error, msg = d_ptr->convertFromL(aId,aOperation));
       
    63     QDEBUG_WRITE_FORMAT("Exiting convertFrom with error = ",error);
       
    64     return msg;
       
    65 }
       
    66 
       
    67 //---------------------------------------------------------------
       
    68 // UniEditorMmsPlugin::deleteDraftsEntry()
       
    69 // @see header
       
    70 //---------------------------------------------------------------
       
    71 void UniEditorMmsPlugin::deleteDraftsEntry( TMsvId aId )
       
    72 {
       
    73     int error;
       
    74     TRAP( error, d_ptr->deleteDraftsEntryL(aId));
       
    75     QDEBUG_WRITE_FORMAT("Exiting deleteDraftsEntry with error = ",error);
       
    76 }
       
    77 
       
    78 //---------------------------------------------------------------
       
    79 // UniEditorMmsPlugin::convertTo()
       
    80 // @see header
       
    81 //---------------------------------------------------------------
       
    82 TMsvId UniEditorMmsPlugin::convertTo( ConvergedMessage *aMessage )
       
    83 {
       
    84     int error;
       
    85     TMsvId id = -1;
       
    86     TRAP( error, id = d_ptr->convertToL(aMessage));
       
    87     QDEBUG_WRITE_FORMAT("Exiting convertTo and msgId = ",id);
       
    88 	return id;	
       
    89 }    
       
    90 
       
    91 //---------------------------------------------------------------
       
    92 // UniEditorMmsPlugin::send()
       
    93 // @see header
       
    94 //---------------------------------------------------------------
       
    95 bool UniEditorMmsPlugin::send(TMsvId aId)
       
    96 {
       
    97     int error = KErrNone;
       
    98     TRAP( error, d_ptr->sendL(aId));
       
    99     QDEBUG_WRITE_FORMAT("send returning with error= ",error);
       
   100     
       
   101     return (error != KErrNone) ? false : true; 
       
   102 }    
       
   103 
       
   104 //---------------------------------------------------------------
       
   105 // UniEditorMmsPlugin::isServiceValid()
       
   106 // @see header
       
   107 //---------------------------------------------------------------
       
   108 TBool UniEditorMmsPlugin::isServiceValid()
       
   109 {
       
   110     int error;
       
   111     TBool valid = false;
       
   112     TRAP( error, valid = d_ptr->isServiceValidL());
       
   113     QDEBUG_WRITE_FORMAT("Exiting isServiceValid with validity= ",valid);
       
   114     return valid;
       
   115 }    
       
   116 
       
   117 //---------------------------------------------------------------
       
   118 // UniEditorMmsPlugin::validateService()
       
   119 // @see header
       
   120 //---------------------------------------------------------------
       
   121 TBool UniEditorMmsPlugin::validateService( TBool aEmailOverSms)
       
   122 {
       
   123     int error;
       
   124     TBool valid = false;
       
   125     TRAP( error, valid = d_ptr->validateServiceL(aEmailOverSms));
       
   126     QDEBUG_WRITE_FORMAT("Exiting validateService with validity= ",valid);
       
   127     return valid;
       
   128 }		
       
   129 
       
   130 
       
   131 
       
   132 
       
   133 
       
   134 //---------------------------------------------------------------
       
   135 // UniEditorMmsPlugin::setEncodingSettings()
       
   136 // @see header
       
   137 //---------------------------------------------------------------
       
   138 void UniEditorMmsPlugin::setEncodingSettings(TBool /*aUnicodeMode*/,
       
   139     TSmsEncoding /*aAlternativeEncodingType*/, TInt /*charSupportType*/)
       
   140 {
       
   141 
       
   142 }
       
   143 
       
   144 //---------------------------------------------------------------
       
   145 // UniEditorMmsPlugin::getNumPDUs()
       
   146 // @see header
       
   147 //---------------------------------------------------------------
       
   148 bool UniEditorMmsPlugin::getNumPDUs(QString& /*aBuf*/,
       
   149     TInt& /*aNumOfRemainingChars*/, TInt& /*aNumOfPDUs*/,
       
   150     TBool& /*aUnicodeMode*/, TSmsEncoding& /*aAlternativeEncodingType*/)
       
   151 {
       
   152     return true;
       
   153 }
       
   154 
       
   155 Q_EXPORT_PLUGIN2(unieditormmsplugin, UniEditorMmsPlugin)
       
   156