messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/inc/unieditormmsplugin_p.h
changeset 25 84d9eb65b26f
child 34 84197e66a4bd
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 #ifndef __UNIEDITORMMSPLUGINPRIVATE_H
       
    19 #define __UNIEDITORMMSPLUGINPRIVATE_H
       
    20 
       
    21 #include <msvapi.h>
       
    22 #include <cmsvrecipientlist.h>
       
    23 #include "unieditorplugininterface.h"
       
    24 #include "convergedmessage.h"
       
    25 #include "convergedmessageid.h"
       
    26 #include "UniDataModel.h"
       
    27 // DATA TYPES
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 
       
    31 class CClientMtmRegistry;
       
    32 class CMmsClientMtm;
       
    33 class CMmsHeaders;
       
    34 class CMmsSettings;
       
    35 class CCommsDatabase;
       
    36 class TUniSendingSettings;
       
    37 class UniDataModelPluginInterface;
       
    38 class UniDataModelLoader;
       
    39 class CUniDataModel;
       
    40 class CMsgMediaInfo;
       
    41 class CMDXMLDocument;
       
    42 class MMediaInfoObserver;
       
    43 
       
    44 // CLASS DECLARATION
       
    45 
       
    46 class CUniEditorMmsPluginPrivate : public CBase,
       
    47         public MUniDataModelObserver,
       
    48         public MUniObjectSaveObserver,
       
    49         public MUniSmilComposeObserver,
       
    50         public MMediaInfoObserver,
       
    51 		public MMsvSessionObserver
       
    52 {
       
    53 public:  // Constructors and destructor
       
    54 
       
    55     /**
       
    56      * Two-phased constructor.
       
    57      */
       
    58     static CUniEditorMmsPluginPrivate* NewL();
       
    59 
       
    60     /**
       
    61      * Destructor.
       
    62      */
       
    63     virtual ~CUniEditorMmsPluginPrivate();
       
    64 
       
    65 public: 
       
    66 
       
    67     /**
       
    68      * Converts message from message store into ConvergedMessage 
       
    69      * based on the operation
       
    70      * @param TMsvId id
       
    71      * @param aOperation operation type
       
    72      * @return ConvergedMessage object is returned in successfull cases and 
       
    73      *         NULL is returned in failure cases. The ownership of the object
       
    74      *         is transferred to the caller. 
       
    75      */
       
    76     ConvergedMessage* convertFromL( TMsvId aId,
       
    77         UniEditorPluginInterface::EditorOperation aOperation );
       
    78 
       
    79     /**
       
    80      * delete entry from drafts folder
       
    81      * @param aId TMsvId of the message entry to be deleted
       
    82      */
       
    83     void deleteDraftsEntryL( TMsvId aId );
       
    84 
       
    85     /**
       
    86      * Converts ConvergedMessage message into a message in store
       
    87      * @param ConvergedMessage obj
       
    88      * @return TMsvId id
       
    89      */             
       
    90     TMsvId convertToL( ConvergedMessage *aMessage );
       
    91     
       
    92     /**
       
    93      * Implementation for convertToL which converts ConvergedMessage message 
       
    94      * into a message in store
       
    95      * @param ConvergedMessage obj
       
    96      * @param TMsvEntry
       
    97      */             
       
    98     void DoConvertToL(ConvergedMessage *aMessage,TMsvEntry& entry);
       
    99 
       
   100     /**
       
   101      * Sends the message
       
   102      * @param TMsvId id
       
   103      */                 
       
   104     void sendL( TMsvId aId );
       
   105 
       
   106     /**
       
   107      * Validates the service for send
       
   108      * @param aEmailOverSms
       
   109      * @return true if the service is valid for send
       
   110      */                    
       
   111     TBool validateServiceL( TBool aEmailOverSms = EFalse );
       
   112 
       
   113     /**
       
   114      * isServiceValidL
       
   115      * @return TBool
       
   116      */              
       
   117     TBool isServiceValidL();
       
   118 
       
   119 private: // Constructors
       
   120 
       
   121     /**
       
   122      * C++ default constructor.
       
   123      */
       
   124     CUniEditorMmsPluginPrivate();
       
   125 
       
   126     /**
       
   127      * Returns pointer to iMmsMtm member variable  
       
   128      */
       
   129     CMmsClientMtm* MmsMtmL();
       
   130 
       
   131     /**
       
   132      * Generates details for TMsvEntry object
       
   133      */
       
   134     void MakeDetailsL( TDes& aDetails );
       
   135 
       
   136     /**
       
   137      * Populates address feilds in message from ConvergedMessage
       
   138      */
       
   139     void addRecipientsL(ConvergedMessage *message);
       
   140 
       
   141     /**
       
   142      * Populates address feilds in message from ConvergedMessage
       
   143      */
       
   144     void addRecipientsL(const ConvergedMessageAddressList &array, 
       
   145         TMsvRecipientType recpType);
       
   146 
       
   147     /**
       
   148      * Populates converged message from the drafts entry
       
   149      */
       
   150     void convertFromDraftsL(ConvergedMessage& aMessage );
       
   151 
       
   152     /**
       
   153      * Populates address feilds into converged message
       
   154      */
       
   155     void populateRecipientsL(
       
   156         ConvergedMessage &aMessage);
       
   157 
       
   158     /**
       
   159      * Populates body and attachment list into converged message
       
   160      */
       
   161     void populateMessageBodyL(ConvergedMessage &aMessage);
       
   162     
       
   163     /**
       
   164      * Populates converged message for forward case
       
   165      */
       
   166     void convertFromForwardHandlerL(ConvergedMessage& aMessage);
       
   167 
       
   168     /**
       
   169      * Add object into smil 
       
   170      * @param slide number
       
   171      * @param filepath
       
   172      */
       
   173     void addObjectL(int aSlideNum, const QString& aFilePath);
       
   174 
       
   175     /**
       
   176      * Add attachment 
       
   177      * @param file path
       
   178      */
       
   179     void addAttachmentL(const QString& aFilePath);
       
   180 
       
   181     /**
       
   182      * Add text object into smil 
       
   183      * @param slide number
       
   184      * @param text
       
   185      */
       
   186     void addTextObjectL(int aSlideNum, const QString& aBodyText);
       
   187 
       
   188     /**
       
   189      * @see MUniObjectSaveObserver
       
   190      */
       
   191     void ObjectSaveReady(TInt aError);
       
   192 
       
   193     /**
       
   194      * @see MUniSmilComposeObserver
       
   195      */
       
   196     void SmilComposeEvent(TInt aError);
       
   197 
       
   198     /**
       
   199      * @see MMediaInfoObserver
       
   200      */
       
   201     void MediaInfoParsed();
       
   202 
       
   203     /**
       
   204      * @see MUniDataModelObserver
       
   205      */
       
   206     void RestoreReady(TInt aParseResult, TInt aError);
       
   207     
       
   208     /**
       
   209      * @see MMsvSessionObserver
       
   210      */
       
   211     void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2,
       
   212                              TAny* aArg3);
       
   213 
       
   214 private:
       
   215     // Data
       
   216     CMsvSession* iSession;
       
   217     CClientMtmRegistry* iMtmRegistry;
       
   218     CMmsClientMtm* iMmsMtm;
       
   219     CMmsHeaders* iMmsHeader;
       
   220 
       
   221     // owned
       
   222     UniDataModelLoader* iDataModelPluginLoader;        
       
   223     //Not owned
       
   224     UniDataModelPluginInterface* iMmsDataPlugin;
       
   225     // owned
       
   226     CUniDataModel* iUniDataModel;
       
   227     RFs ifsSession;
       
   228     
       
   229     // not owned
       
   230     CMsgMediaInfo* iInsertingMedia;
       
   231     // owned
       
   232     CEikRichTextEditor* iEditor;
       
   233     // owned
       
   234     CMDXMLDocument* iDom;
       
   235 };
       
   236 
       
   237 #endif   // __UNIEDITORMMSPLUGINPRIVATE_H
       
   238 
       
   239 // End of File