meetingrequest/mrguicommon/inc/cesmrlistquery.h
branchRCL_3
changeset 12 4ce476e64c59
equal deleted inserted replaced
11:0396474f30f5 12:4ce476e64c59
       
     1 /*
       
     2 * Copyright (c) 2007-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:  Definition for mrui list queries
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CESMRLISTQUERY_H
       
    20 #define CESMRLISTQUERY_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 //<cmail>
       
    25 #include "esmrdef.h"
       
    26 //</cmail>
       
    27 
       
    28 // FORWARD DECLARATIONS:
       
    29 class CDesC16ArrayFlat;
       
    30 class CAknPopupList;
       
    31 class CESMRAlarm;
       
    32 class CESMRRecurrence;
       
    33 class CAknSinglePopupMenuStyleListBox;
       
    34 
       
    35 // CLASS DECLARATION
       
    36 class CEikonEnv;
       
    37 /**
       
    38  * CESMRListQuery encapsulates edit before send pop-up list
       
    39  * query for ES MR Utils usage.
       
    40  *
       
    41  * Usage:
       
    42  *
       
    43  * TESMRResponseType resp = (TESMRResponseType)
       
    44  *      CESMRListQuery::ExecuteEditBeforeSendL(EESMRAttendeeStatusTentative);
       
    45  *
       
    46  * @lib esmrgui.lib
       
    47  */
       
    48 NONSHARABLE_CLASS( CESMRListQuery ) : public CBase
       
    49     {
       
    50     public:
       
    51         enum TESMRListQueryType
       
    52             {
       
    53             EESMREditBeforeSendQuery = 0,
       
    54             EESMRSendUpdateToAllQuery,
       
    55             EESMRRecurrenceQuery,
       
    56             EESMRRelativeAlarmTimeQuery,
       
    57             EESMROpenThisOccurenceOrSeriesQuery,
       
    58             EESMRPriorityPopup,
       
    59             EESMRTodoPriorityPopup,
       
    60             EESMRSynchronizationPopup,
       
    61             EESMRDeleteThisOccurenceOrSeriesQuery,
       
    62             EESMREditBeforeSendQueryWithSendOptionsOnly,
       
    63             EESMRUnifiedEditorPopup,
       
    64             EESMRNormalResponseQuery,
       
    65             EESMRRemoveResponseQuery,
       
    66             EESMRMultiCalenQuery,
       
    67             EESMRForwardThisOccurenceOrSeriesQuery
       
    68             };
       
    69         
       
    70     public:
       
    71         /**
       
    72         * Two-phased constructor.
       
    73         */
       
    74         IMPORT_C static CESMRListQuery* NewL(TESMRListQueryType aType);
       
    75         
       
    76         /**
       
    77         * Two-phased constructor.
       
    78         */
       
    79         IMPORT_C static CESMRListQuery* NewL(TESMRListQueryType aType, 
       
    80 						RArray<TInt>& aFilter);
       
    81 
       
    82         /**
       
    83         * Destructor.
       
    84         */
       
    85         ~CESMRListQuery();
       
    86 
       
    87     private: // Constructors
       
    88 
       
    89         CESMRListQuery( TESMRListQueryType aType );
       
    90         CESMRListQuery( TESMRListQueryType aType, RArray<TInt>& aFilter );
       
    91         void ConstructL();
       
    92 
       
    93     public: // Implementation
       
    94 
       
    95          /**
       
    96          * Sets the attendee response status to Edit before send query's
       
    97          * title.
       
    98          * @param aStatus Response status
       
    99          */
       
   100          void SetAttendeeStatus(TESMRAttendeeStatus aStatus);
       
   101 
       
   102 
       
   103          /**
       
   104          * Executes the dialog and destroys itself.
       
   105          * @return TESMRResponseType, or KErrCancel if dialog has
       
   106          *         been cancelled.
       
   107          */
       
   108          IMPORT_C TInt ExecuteLD();
       
   109 
       
   110          /**
       
   111          * Static version of ExecuteLD for edit before send dialog
       
   112          * @param aStatus attendee status.
       
   113          * @return TESMRResponseType, or KErrCancel if dialog has
       
   114          *         been cancelled.
       
   115          */
       
   116          IMPORT_C static TInt ExecuteEditBeforeSendL(
       
   117                  TESMRAttendeeStatus aStatus);
       
   118 
       
   119          /**
       
   120          * Static version of ExecuteLD for edit before send dialog
       
   121          * @param aStatus attendee status.
       
   122          * @return TESMRResponseType, or KErrCancel if dialog has
       
   123          *         been cancelled.
       
   124          */
       
   125          IMPORT_C static TInt ExecuteEditBeforeSendWithSendOptOnlyL(
       
   126                  TESMRAttendeeStatus aStatus );
       
   127 
       
   128          /**
       
   129          * Static version of ExecuteLD for other list querys
       
   130          * @param aStatus attendee status.
       
   131          * @return
       
   132          *         TESMRSendUpdateQueryResponeStatus if the type is EESMRSendUpdateAll
       
   133          *         TESMRGUIAlarmValue if the type is EESMRRelativeAlarmTime
       
   134          *         TESMRGUIRecurrenceValue if the type is EESMRRecurrence
       
   135          *         TESMRThisOccurenceOrSeriesQuery if the type is
       
   136          *              EESMRThisOccurenceOrSeriesQuery
       
   137          *         or KErrCancel if dialog has
       
   138          *         been cancelled.
       
   139          */
       
   140          IMPORT_C static TInt ExecuteL(
       
   141                  TESMRListQueryType aType);
       
   142          
       
   143          /**
       
   144          * Static version of ExecuteLD for other list querys
       
   145          * @param aStatus attendee status.
       
   146          * @param aFilter contains information about items that should be
       
   147          * 		  excluded from popup list.
       
   148          * @return
       
   149          *         TESMRSendUpdateQueryResponeStatus if the type is EESMRSendUpdateAll
       
   150          *         TESMRGUIAlarmValue if the type is EESMRRelativeAlarmTime
       
   151          *         TESMRGUIRecurrenceValue if the type is EESMRRecurrence
       
   152          *         TESMRThisOccurenceOrSeriesQuery if the type is
       
   153          *              EESMRThisOccurenceOrSeriesQuery
       
   154          *         or KErrCancel if dialog has
       
   155          *         been cancelled.
       
   156          */
       
   157          IMPORT_C static TInt ExecuteL(
       
   158                  TESMRListQueryType aType, RArray<TInt>& aFilter);
       
   159          
       
   160          /**
       
   161           * For multi-calendar query
       
   162           * @param aCalenNameList multi-calendar names for display
       
   163           * @return index of user choose 
       
   164           */
       
   165          IMPORT_C TInt ExecuteLD( RArray<TPtrC>& aCalenNameList );
       
   166                   
       
   167          /**
       
   168           * Static version of ExecuteLD for multi-calendar querys
       
   169           * @param aCalenNameList multi-calendar name list
       
   170           * @return index of user choose
       
   171           */
       
   172          IMPORT_C static TInt ExecuteL(
       
   173                  TESMRListQueryType aType, RArray<TPtrC>& aCalenNameList );
       
   174 
       
   175     private: // Implementation:
       
   176 
       
   177         void SetListQueryTextsL(
       
   178                 CDesC16ArrayFlat* aItemArray,
       
   179                 CAknPopupList* aPopupList);
       
   180         TInt MapSelectedIndexToReturnValue(TInt aIndex);
       
   181         TInt MapUnifiedEditorItemTextToIndexL(
       
   182                 CAknSinglePopupMenuStyleListBox& aList );        
       
   183         void LoadTextsFromResourceL();
       
   184 
       
   185     private: // Data
       
   186         /// Own: Attendee status
       
   187         TESMRAttendeeStatus iStatus;
       
   188         /// Own: Resource offset;
       
   189         TInt iResourceOffset;
       
   190         /// Own: List query type
       
   191         TESMRListQueryType iType;
       
   192         /// Own: Array for Alarm items
       
   193         RPointerArray< CESMRAlarm > iAlarmArray;
       
   194         /// Own: Array for Recurrence items
       
   195         RPointerArray< CESMRRecurrence > iRecurrenceArray;
       
   196         /// Ref:
       
   197         CEikonEnv* iEnv;
       
   198         /// Own: Filter for dynamic popup, not showing all items
       
   199         RArray<TInt> iFilter;
       
   200     };
       
   201 
       
   202 #endif // CESMRLISTQUERY_H
       
   203 
       
   204 // End of File