phonebookui/Phonebook2/GroupExtension/inc/CPguSendMessageGroupCmd.h
branchRCL_3
changeset 63 f4a778e096c2
child 64 c1e8ba0c2b16
equal deleted inserted replaced
62:5b6f26637ad3 63:f4a778e096c2
       
     1 /*
       
     2 * Copyright (c) 2005-2007 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:  Phonebook 2 Group UI Extension send message command.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPGUSENDMESSAGEGROUPCMD_H
       
    20 #define CPGUSENDMESSAGEGROUPCMD_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <TSendingCapabilities.h>
       
    25 #include <MPbk2Command.h>
       
    26 #include <MVPbkSingleContactOperationObserver.h>
       
    27 #include <RVPbkContactFieldDefaultPriorities.h>
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CPbk2FieldPropertyArray;
       
    31 class MPbk2ContactUiControl;
       
    32 class MPbk2CommandObserver;
       
    33 class MVPbkStoreContact;
       
    34 class MVPbkContactOperationBase;
       
    35 class MVPbkStoreContactField;
       
    36 class MVPbkContactLink;
       
    37 class MVPbkContactLinkArray;
       
    38 class CMessageData;
       
    39 class CPguUIExtensionPlugin;
       
    40 
       
    41 // CLASS DECLARATION
       
    42 
       
    43 /**
       
    44  * Phonebook 2 Group UI Extension send message command.
       
    45  * Responsible for:
       
    46  * - displaying select message type query
       
    47  * - performing address select to the contacts of the selected group
       
    48  * - utilizing SendUI to send the message
       
    49  */
       
    50 class CPguSendMessageGroupCmd : 
       
    51     public CActive,
       
    52     public MPbk2Command,
       
    53     private MVPbkSingleContactOperationObserver
       
    54     {
       
    55     public: // Constructor and destructor
       
    56         /**
       
    57          * Creates a new instance of this class.
       
    58          *
       
    59          * @param aUiControl    Contact UI control
       
    60          * @return  A new instance of this class.
       
    61          */
       
    62         static CPguSendMessageGroupCmd* NewL (
       
    63                    MPbk2ContactUiControl& aUiControl, 
       
    64                    CPguUIExtensionPlugin* iPguUIExtensionPlugin );
       
    65 
       
    66         /**
       
    67          * Destructor.
       
    68          */
       
    69         ~CPguSendMessageGroupCmd();
       
    70 
       
    71     public: // From MPbk2Command
       
    72         void ExecuteLD();
       
    73         void AddObserver( MPbk2CommandObserver& aObserver );
       
    74         void ResetUiControl(MPbk2ContactUiControl& aUiControl);
       
    75 
       
    76     private: // From CActive
       
    77         void DoCancel();
       
    78         void RunL();
       
    79         TInt RunError( TInt aError );
       
    80 
       
    81     private: // From MVPbkSingleContactOperationObserver
       
    82         void VPbkSingleContactOperationComplete(
       
    83                 MVPbkContactOperationBase& aOperation,
       
    84                 MVPbkStoreContact* aContact );
       
    85         void VPbkSingleContactOperationFailed(
       
    86                 MVPbkContactOperationBase& aOperation,
       
    87                 TInt aError );
       
    88 
       
    89     private: // Implementation
       
    90         CPguSendMessageGroupCmd (
       
    91             MPbk2ContactUiControl& aUiControl,
       
    92             CPguUIExtensionPlugin* iPguUIExtensionPlugin );
       
    93         void ConstructL();
       
    94         TUid ShowWriteQueryL();
       
    95         void RetrieveContactL(
       
    96                 const MVPbkContactLink& aContactLink );
       
    97         void DoSendMessageL();
       
    98         void ResolveGroupL();
       
    99         void ResolveUrlL();
       
   100         TInt PrepareAddressSelectL(
       
   101                 RVPbkContactFieldDefaultPriorities& aPriorities,
       
   102                 TUid aTechType );
       
   103         void SetAddressFromFieldL(
       
   104                 MVPbkStoreContactField& aField );
       
   105         void ProcessDismissed(
       
   106                 TInt aCancelCode );
       
   107         TInt FilterErrors(
       
   108                 TInt aErrorCode );
       
   109         void IssueRequest();
       
   110         void IssueStopRequest();
       
   111 
       
   112     private: // Data structures
       
   113         /// Process states
       
   114         enum TProcessState
       
   115             {
       
   116             ERetrieving,
       
   117             EResolveGroup,
       
   118             EResolveURL,
       
   119             EShowWriteQuery,
       
   120             EStarting,
       
   121             ELaunching,
       
   122             EStopping
       
   123             };
       
   124 
       
   125     private: // Data
       
   126         /// Ref: UI control
       
   127         MPbk2ContactUiControl* iUiControl;
       
   128         /// Own: Selected contacts
       
   129         MVPbkContactLinkArray* iSelectedContacts;
       
   130         /// Own: MTM filter
       
   131         CArrayFixFlat<TUid>* iMtmFilter;
       
   132         /// Own: Send MTM uid
       
   133         TUid iMtmUid;
       
   134         /// Own: Sending capabilities
       
   135         TSendingCapabilities iSendingCapabilities;
       
   136         /// Own: The contact to send message to
       
   137         MVPbkStoreContact* iStoreContact;
       
   138         /// Own: Contact retrieve operation
       
   139         MVPbkContactOperationBase* iRetrieveOperation;
       
   140         /// Ref: Phonebook 2 field property array
       
   141         CPbk2FieldPropertyArray* iFieldPropertyArray;
       
   142         /// Ref: Focused field
       
   143         const MVPbkStoreContactField* iFocusedField;
       
   144         /// Ref: Command observer
       
   145         MPbk2CommandObserver* iCommandObserver;
       
   146         /// Own: Message data
       
   147         CMessageData* iMessageData;
       
   148         /// Own: Current index of contact in array
       
   149         TInt iCurrentContactLinkIndex;
       
   150         /// Own: Current state of process
       
   151         TProcessState iState;
       
   152         /// Ref: Group UI extension
       
   153         CPguUIExtensionPlugin* iPguUIExtensionPlugin;
       
   154         /// Own: Send Message indicator
       
   155         TBool iSendMessage;
       
   156     };
       
   157 
       
   158 #endif // CPGUSENDMESSAGEGROUPCMD_H
       
   159 
       
   160 // End of File