eventsui/eventseditor/inc/evteditor.h
branchRCL_3
changeset 17 1fc85118c3ae
parent 16 8173571d354e
child 18 870918037e16
equal deleted inserted replaced
16:8173571d354e 17:1fc85118c3ae
     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:   Form class for creating events.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef EVTEDITOR_H_
       
    20 #define EVTEDITOR_H_
       
    21 
       
    22 #include <AknForm.h>
       
    23 #include <e32base.h>        // CBase
       
    24 #include <ConeResLoader.h>
       
    25 
       
    26 #include "evtmgmtuieditorcmdhandler.h"
       
    27 #include "evtmgmtuisysofmeasurement.h"
       
    28 #include "evtmgmtuiengine.h"
       
    29 
       
    30 class CAknNavigationControlContainer;
       
    31 class CAknNavigationDecorator;
       
    32 class CEvtEvent;
       
    33 class TCoordinate;
       
    34 class CEvtMgmtUiEditorCmdHandler;
       
    35 class TCoeHelpContext;
       
    36 class CAknIconArray;
       
    37 class TAknsItemID;
       
    38 class CAknListQueryDialog;
       
    39 
       
    40 // Derive the class from CAknForm 
       
    41 class CEvtEditor : public CAknForm,
       
    42                    public MEvtMgmtUiEditorObserver,
       
    43                    public MEvtMgmtUiSOMObserver
       
    44     {   
       
    45     public:  // Constructor and destructor  
       
    46         /**
       
    47          * Static Two phase constructor
       
    48          *         
       
    49          */
       
    50         static CEvtEditor* NewL( TBool                              aIsEditable, 
       
    51                                  CEvtEvent&                         aEvent,
       
    52                                  CEvtMgmtUiEngine&                  aEventEngine,
       
    53                                  TBool                              aDisplayExitMenuItem = ETrue );
       
    54  
       
    55         /**
       
    56          * Virtual destructor
       
    57          */
       
    58         virtual ~CEvtEditor(); 
       
    59         
       
    60     public://new functions
       
    61         /*
       
    62         * It sets help context
       
    63         * 
       
    64         * @since Symbian v9.1
       
    65         * 
       
    66         * @param[in] aContext - help context object  
       
    67         */
       
    68        void SetHelpContext( TCoeHelpContext aContext );
       
    69       
       
    70         
       
    71     private: //new functions
       
    72         /**
       
    73          * Load intial data values
       
    74          */
       
    75         void LoadFormValuesFromDataL();
       
    76         
       
    77         /**
       
    78          * Displays confirmation query dialog
       
    79          * @param aResourceId Text to be displayed on query
       
    80          */
       
    81         TBool DisplayConfirmationQueryDlgL( TInt aResourceId);
       
    82       
       
    83         /**
       
    84          * Set navipane title
       
    85 		 * @param aTitle title for navipane
       
    86          */
       
    87         void SetNavipaneTitleL(const TDesC& aTitle);
       
    88         
       
    89         /**
       
    90 		 * Change RSK caption
       
    91          * 
       
    92          */		 
       
    93         void ChangeRSKCaptionL();
       
    94 
       
    95          /** Change MSK caption
       
    96          * @param aControlId of current focused line
       
    97          */
       
    98            void ChangeMSKCaptionL(TInt  aControlId);
       
    99         
       
   100         /**
       
   101          * Perform the required action when MSK is pressed
       
   102          */
       
   103         void HandleMSKL();
       
   104         
       
   105         /**
       
   106          * Sets default date and time for date-time components of editor
       
   107          */
       
   108         //void SetDefaultDateTime();
       
   109         
       
   110         /**
       
   111          * It deletes dialog line for audio-loop
       
   112          */
       
   113         void RemoveAudioLoopDlgLineL();
       
   114         
       
   115         /**
       
   116         * It inserts dialog line for audio-loop
       
   117         */
       
   118         void InsertAudioLoopDlgLinesL();
       
   119         
       
   120         /**
       
   121         * It inserts dialog line for radius
       
   122         */
       
   123         void InsertRadiusDlgLineL();
       
   124         
       
   125         /**
       
   126          * It removes dialog line for radius
       
   127          */
       
   128         void RemoveRadiusDlgLineL();
       
   129         
       
   130         /**
       
   131          * It inserts dialog line for descriptor
       
   132          */
       
   133         void InsertDesDlgLineL();
       
   134         
       
   135         /**
       
   136          * It removes dialog line for descriptor
       
   137          */
       
   138         void RemoveDesDlgLineL();
       
   139         
       
   140         /**
       
   141         * It sets text to descriptor edwin
       
   142         */
       
   143         void SetDescL();
       
   144         
       
   145         /**
       
   146         * It sets text to place edwin
       
   147         */
       
   148         void SetPlaceL();
       
   149         
       
   150         /**
       
   151         * It sets Status to popup
       
   152         */
       
   153         void SetStatusL();
       
   154         
       
   155         /**
       
   156         * It Checks for the status and dynamically sets the popup list
       
   157         */
       
   158         void CheckStatusL();
       
   159         
       
   160         /**
       
   161         * It sets text to radius editor
       
   162         */
       
   163         void SetRadiusL();
       
   164         
       
   165         /**
       
   166         * It sets text to ringtone editor
       
   167         */
       
   168         void SetRingtoneL();
       
   169         
       
   170        /**
       
   171        * It checks if all mandatory fields are filled
       
   172        *  @return ETrue if all mandatory fields are filled
       
   173        *          KFalse otherwise
       
   174        */
       
   175         TBool MandatoryFieldsFilled();
       
   176         
       
   177 
       
   178 	    /** 
       
   179 	     * Set the Title text
       
   180 	     */ 
       
   181 	    void MakeTitleL( TDesC& aText );
       
   182 	    
       
   183 	   
       
   184 	           
       
   185 	    /**
       
   186          * Opens the nearest localized resourcefile using aResourceLoader. 
       
   187          * aResourceLoader should be opened only once before closing it. 
       
   188          * Otherwise it will raise a panic. Therefore it is better to have 
       
   189          * multiple resource loaders.
       
   190          * 
       
   191          * @param aResourceFileName Drive and name of resource file in format 
       
   192          *                          <path>:<rsc_file_name>
       
   193          * @param aResourceLoader Resource loader for the resource. The loader 
       
   194          *                        must not be opened allready or it will raise 
       
   195          *                        a panic. It is caller's responsibility to 
       
   196          *                        close the resource loader after using the 
       
   197          *                        resource.
       
   198          */
       
   199         void OpenLocalizedResourceFileL( const TDesC& aResourceFileName, 
       
   200                                 RConeResourceLoader&  aResourceLoader );
       
   201 	   
       
   202     public:  // Functions from base class
       
   203         /*
       
   204          *  Inherited from CCoeControl
       
   205          */
       
   206         void SetMopParent( MObjectProvider* aParent );
       
   207        
       
   208         /*
       
   209          * Inherited from CEikDialog
       
   210          */
       
   211         TInt ExecuteLD();
       
   212             
       
   213         /*
       
   214          * Inherited from CCoeControl
       
   215          */
       
   216         void GetHelpContext( TCoeHelpContext& aContext ) const;
       
   217       
       
   218    private:  // Functions from base class
       
   219        
       
   220         /**
       
   221         * Inherited from CAknDialog
       
   222         */
       
   223         void LineChangedL( TInt  aControlId  ); 
       
   224         
       
   225         /**
       
   226          * Inherited from CAknForm
       
   227          */
       
   228         //void HandleControlStateChangeL();
       
   229         void HandleControlStateChangeL(TInt aControlId);
       
   230         
       
   231        
       
   232         /**
       
   233          * Inherited from CAknForm
       
   234          */
       
   235         void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
       
   236          
       
   237        /**
       
   238         * Inherited from CAknForm
       
   239         */
       
   240        void ProcessCommandL(TInt  aCommandId); 
       
   241        
       
   242         /**
       
   243          * Inherited from CEikDialog
       
   244          */
       
   245         TBool OkToExitL( TInt aButtonId );
       
   246          
       
   247         /**
       
   248          * Inherited from CEikDialog
       
   249          */
       
   250         void PreLayoutDynInitL();        
       
   251        
       
   252         /**
       
   253         * Inherited from CEikDialog
       
   254         */
       
   255         void PostLayoutDynInitL();  
       
   256         
       
   257        /**
       
   258          * Inherited from MEvtMgmtUiEditorObserver
       
   259          */
       
   260         void NotifyEditorL(TInt aCommand, TInt aErrorCode);   
       
   261          
       
   262         // Inherited from MEvtMgmtUiSOMObserver
       
   263         void NotifySOMChangeL( );
       
   264                
       
   265         void HandlePointerEventL(const TPointerEvent &aPointerEvent);
       
   266        // void HandleDialogPageEventL( TInt aEventID );
       
   267         
       
   268         TKeyResponse OfferKeyEventL (const TKeyEvent &aKeyEvent, TEventCode aType); 
       
   269         
       
   270     private:  // Constructor
       
   271         /**
       
   272          * C++ Default constructor
       
   273          */       
       
   274          CEvtEditor( TBool                              aIsEditable, 
       
   275                      CEvtEvent&                         aEvent, 
       
   276                      CEvtMgmtUiEngine&                  aEventEngine,
       
   277                      TBool                              aDisplayExitMenuItem = ETrue);
       
   278   
       
   279         /**
       
   280          * Second phase of the two phase constructor
       
   281          */ 
       
   282          void ConstructL();
       
   283          
       
   284     private: //new functions
       
   285         
       
   286         /*
       
   287          * It checks if event is empty.
       
   288          * 
       
   289          * @since Symbian v9.1
       
   290          * 
       
   291          * @ret true if event is empty else false.
       
   292          */
       
   293         TBool IsEmptyEventL();
       
   294         
       
   295         TBool ProcessDoneCommandL();
       
   296         
       
   297        /**
       
   298         * it toggles value of popup field
       
   299         */        
       
   300         void TogglePopupFieldControlL( TInt aControlId );
       
   301         
       
   302     private:
       
   303         /**
       
   304         * owns: It handles all editor commands
       
   305         */
       
   306        CEvtMgmtUiEditorCmdHandler*      iCmdHandler;
       
   307        /*
       
   308         * Owns: It checks unit for radius
       
   309         */
       
   310        CEvtMgmtUiSysOfMeasurement*      iSysOfMeas;
       
   311        /*
       
   312         * Mode in which editor is opened. It can be either view or edit mode.
       
   313         */   
       
   314        TBool                            iIsEditMode;
       
   315        /*
       
   316         *  Ref: The event to be displayed on editor
       
   317         */
       
   318        CEvtEvent&                       iEvent;
       
   319        /*
       
   320         *  help context object
       
   321         */
       
   322        TCoeHelpContext                  iHelpContext;  
       
   323        
       
   324        /**
       
   325        * Resource loader handle
       
   326        * Owns
       
   327        */
       
   328       RConeResourceLoader             iResourceLoader;
       
   329       
       
   330       /**
       
   331        * Reference to the Events UI Engine
       
   332        */
       
   333       CEvtMgmtUiEngine&               iEventEngine;
       
   334 
       
   335       /*
       
   336        * Optimization:It is used in order to avoid repeated check in dynitmenupaneL
       
   337        */
       
   338       TBool                           iDisplayExitMenuItem;
       
   339       
       
   340       /*
       
   341        * It determines which attributes are modified
       
   342        */
       
   343       TEvtEventAttributeMask          iEventAttributeMask;
       
   344       
       
   345       TInt                           iIsDragging;
       
   346  };
       
   347 
       
   348 #endif /*EVTEDITOR_H_*/