creator/inc/creator_mailbox.h
branchRCL_3
changeset 20 fad26422216a
parent 0 d6fe6244b863
equal deleted inserted replaced
19:b3cee849fa46 20:fad26422216a
       
     1 /*
       
     2 * Copyright (c) 2008 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 
       
    19 
       
    20 
       
    21 #ifndef __CREATORMAILBOXES_H__
       
    22 #define __CREATORMAILBOXES_H__
       
    23 
       
    24 #include "creator_model.h"
       
    25 #include "creator_modulebase.h"
       
    26 
       
    27 
       
    28 #include <e32base.h>
       
    29 #include <SenduiMtmUids.h>
       
    30 #include <smtpset.h>
       
    31 #include <imapset.h>
       
    32 #include <pop3set.h>
       
    33 #include <mtmuibas.h>
       
    34 #include <iapprefs.h>
       
    35 #include <cemailaccounts.h>
       
    36 
       
    37 class CCreatorEngine;
       
    38 class CMailboxesParameters;
       
    39 
       
    40 const TInt KDefaultSmtpPort = 25;
       
    41 
       
    42 enum TMailboxType
       
    43     {
       
    44     EMailboxPOP3,
       
    45     EMailboxIMAP4
       
    46     };
       
    47 
       
    48 class CCreatorMailboxes : public CBase, public MCreatorModuleBase, public MMsvSessionObserver
       
    49     {
       
    50 public: 
       
    51     static CCreatorMailboxes* NewL(CCreatorEngine* aEngine);
       
    52     static CCreatorMailboxes* NewLC(CCreatorEngine* aEngine);
       
    53     ~CCreatorMailboxes();
       
    54 
       
    55 private:
       
    56     CCreatorMailboxes();
       
    57     void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase
       
    58 
       
    59     void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3); // from MMsvSessionObserver
       
    60     void StoreIMEIToEntryL(const TMsvId aMailboxId);
       
    61     void GetIMEIFromThePhoneL();
       
    62     
       
    63     void PopulateSmtpSettingsL( 
       
    64             CEmailAccounts& aEmailAccount, 
       
    65             CImSmtpSettings& aSmtpSettings, 
       
    66             CImIAPPreferences& aIApSettings, 
       
    67             const CMailboxesParameters& aParameters );
       
    68     
       
    69     void PopulateImapSettingsL( 
       
    70             CEmailAccounts& aEmailAccount, 
       
    71             CImImap4Settings& aImapSettings, 
       
    72             CImIAPPreferences& aIApSettings, 
       
    73             const CMailboxesParameters& aParameters );
       
    74     
       
    75     void PopulatePopSettingsL( 
       
    76             CEmailAccounts& aEmailAccount, 
       
    77             CImPop3Settings& aPopSettings, 
       
    78             CImIAPPreferences& aIApSettings, 
       
    79             const CMailboxesParameters& aParameters );
       
    80 
       
    81 
       
    82 public:
       
    83     TBool AskDataFromUserL(TInt aCommand, TInt& aNumberOfEntries); // from MCreatorModuleBase
       
    84     TInt CreateMailboxEntryL(CMailboxesParameters *aParameters);
       
    85     void DeleteAllL();
       
    86     void DeleteAllCreatedByCreatorL();
       
    87 
       
    88 
       
    89 private:
       
    90     CMailboxesParameters* iParameters;
       
    91     TBuf<50> iIMEI;
       
    92     RArray<TInt> iEntryIds;
       
    93 
       
    94 public:
       
    95     };
       
    96 
       
    97 
       
    98 class CMailboxesParameters : public CCreatorModuleBaseParameters
       
    99     {
       
   100 public: 
       
   101 //    HBufC*          iMailboxName;
       
   102 //    HBufC*          iAccessPoint;
       
   103 //    HBufC*          iMyMailAddress;
       
   104 //    HBufC*          iOutgoingMailServer;
       
   105 //    TBool           iSendMessageImmediately;
       
   106 //    TBool           iSendCopyToSelf;
       
   107 //    TBool           iIncludeSignature;
       
   108 //    HBufC*          iUserName;
       
   109 //    HBufC*          iPassword;
       
   110 //    HBufC*          iIncomingMailServer;
       
   111 //    TMailboxType    iMailboxType;  // IMAP4 or POP3
       
   112 //    TBool           iSecurityOn; // SecureSockets
       
   113 //    TBool           iSSLWrapper; // SSL Wrapper
       
   114 //    TBool           iAPOPSecureLogin; // POP3 only
       
   115 //    TBool           iRetrieveAttachment; // IMAP4 only
       
   116 //    TInt32          iRetrieveHeaders;  // IMAP4 only
       
   117 
       
   118     enum TGetEmailOption
       
   119     {
       
   120     EUndef = 0,
       
   121     EGetHeaders,
       
   122     EGetBodyText,
       
   123     EGetBodyTextAndAttachments,
       
   124     EGetAttachments,
       
   125     EGetBodyAlternativeText,
       
   126     EGetEmailOptionLast
       
   127     };
       
   128 
       
   129     HBufC*  iMailboxName;    
       
   130     HBufC*  iIncomingLoginName;
       
   131     HBufC*  iIncomingPassword;
       
   132     HBufC*  iIncomingServerName;
       
   133     HBufC*  iIncomingConnectionMethod;
       
   134     HBufC*  iIncomingFolderPath;
       
   135     HBufC*  iPathSeparator;
       
   136     HBufC*  iOutgoingLoginName;
       
   137     HBufC*  iOutgoingPassword;
       
   138     HBufC*  iOutgoingServerName;
       
   139     HBufC*  iOutgoingConnectionMethod;
       
   140     HBufC*  iOwnEmailAddress;
       
   141     HBufC*  iOwnEmailAlias;
       
   142     HBufC*  iReceiptAddress;
       
   143     HBufC*  iReplyToAddress;
       
   144     
       
   145     TInt    iIncomingPort;
       
   146     TInt    iAttachmentSizeLimit;
       
   147     TInt    iBodyTextSizeLimit;
       
   148     TInt    iAttachmentFetchSize;
       
   149     TInt    iImapIdleTimeout;
       
   150     TInt    iMaxEmailSize;
       
   151     TInt    iSyncRate;
       
   152     TInt    iInboxSyncLimit; // -1 = All
       
   153     TInt    iMailboxSyncLimit; // -1 = All
       
   154     TInt    iOutgoingPort;
       
   155     TInt    iToCCIncludeLimit;
       
   156     
       
   157     TBool   iIncomingSSLWrapper;
       
   158     TBool   iIncomingSecureSockets;
       
   159     TBool   iAcknowledgeReceipts;
       
   160     TBool   iAutoSendOnConnect;
       
   161     TBool   iDeleteEmailsAtDisconnect;
       
   162     TBool   iImapIdleCommand;
       
   163     TBool   iMarkSeenInSync;
       
   164     TBool   iEnableExpungeMode;
       
   165     TBool   iUseApop;
       
   166     TBool   iDisconnectedUserMode;
       
   167     TBool   iOutgoingSSLWrapper;
       
   168     TBool   iOutgoingSecureSockets;
       
   169     TBool   iIncludeSignature;
       
   170     TBool   iAddVCard;
       
   171     TBool   iRequestReceipts;
       
   172     TBool   iSmtpAuth;
       
   173     
       
   174     TGetEmailOption iGetEmailOptions;   
       
   175     TFolderSubscribeType iSubscribeType;    
       
   176     TFolderSyncType iSyncType;  
       
   177     TImSMTPSendCopyToSelf iSendCopyToSelf;
       
   178     TImSMTPSendMessageOption iSendOption;    
       
   179     TMailboxType iMailboxType;  // IMAP4 or POP3
       
   180     
       
   181 public:
       
   182     CMailboxesParameters();
       
   183     ~CMailboxesParameters();
       
   184     };
       
   185 
       
   186 
       
   187 
       
   188 #endif // __CREATORMAILBOXES_H__