convergedconnectionhandler/cchserver/inc/cchnotehandler.h
branchRCL_3
changeset 22 d38647835c2e
parent 0 a4daefaec16c
equal deleted inserted replaced
21:f742655b05bf 22:d38647835c2e
       
     1 /*
       
     2 * Copyright (c) 2008-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:  CCH note handler.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CCHNOTEHANDLER_H
       
    19 #define CCHNOTEHANDLER_H
       
    20 
       
    21 // INCLUDES
       
    22 #include <e32base.h>
       
    23 #include <badesca.h>
       
    24 #include <AknGlobalMsgQuery.h>
       
    25 #include <centralrepository.h>
       
    26 
       
    27 #include "cchclientserverinternal.h"
       
    28 
       
    29 // CLASS DECLARATION
       
    30 class CCCHServerBase;
       
    31 
       
    32 /**
       
    33 *  Global message query information
       
    34 *
       
    35 *  @since Series60 5.0
       
    36 */
       
    37 class TGlobalMsgQueryInfo
       
    38     {
       
    39     public:
       
    40         // Message text resource Id
       
    41         TInt iResourceId;
       
    42         
       
    43         // Softkey Id
       
    44         TInt iSoftkeyId;
       
    45         
       
    46         // Secondary display index
       
    47         TInt iSecondaryDisplayIndex;
       
    48     };
       
    49 
       
    50 /**
       
    51 *  Handles cch global note showing.
       
    52 *
       
    53 *  @since Series60 5.0
       
    54 */
       
    55 class CCchNoteHandler: public CActive
       
    56     {
       
    57     
       
    58     public:  // Constructors and destructor
       
    59         
       
    60         /**
       
    61         * Two-phased constructor.
       
    62         *
       
    63         * @param aCchCenRep cch central repository.
       
    64         * @param aCoverDisplaySupported ETrue if cover display supported.
       
    65         * @return new instance.
       
    66         */
       
    67         static CCchNoteHandler* NewL( CCCHServerBase& aServer );
       
    68             
       
    69         /**
       
    70         * Destructor.
       
    71         */
       
    72         virtual ~CCchNoteHandler();
       
    73        
       
    74     public: // new function
       
    75     
       
    76        /**
       
    77         * Lauches Emergency note.
       
    78         * @since Series60 5.0
       
    79         * 
       
    80         * @param aCchGlobalNoteType cch global note type.
       
    81         * @param aSoftKeyConfig softkey configuration.
       
    82         * @param aType type of confirmation query.
       
    83         * @param aSecondaryDisplayIndex secondary display index.
       
    84         */
       
    85         void LaunchGlobalNoteL(
       
    86             const TInt aResourceID, 
       
    87             const TInt aSoftKeyConfig,
       
    88             const TInt aSecondaryDisplayIndex );
       
    89 
       
    90         /**
       
    91          * detects if query is being displayed
       
    92          */
       
    93         TBool CanBeDestroyed();
       
    94             
       
    95         /**
       
    96         * Return CCH Central Repository reference
       
    97         */
       
    98         CRepository* CchCenRep();
       
    99                     
       
   100     private: //from base class
       
   101     
       
   102         /**
       
   103         * @see CActive.
       
   104         */
       
   105         void RunL();
       
   106 
       
   107         /**
       
   108         * @see CActive.
       
   109         */
       
   110         void DoCancel();
       
   111         
       
   112         /**
       
   113         * @see CActive.
       
   114         */
       
   115         TInt RunError( TInt aError );
       
   116                     
       
   117     private:
       
   118 
       
   119         /**
       
   120         * C++ default constructor.
       
   121         */
       
   122         CCchNoteHandler( CCCHServerBase& aServer );
       
   123 
       
   124         /**
       
   125         * 2nd phase constructor
       
   126         */
       
   127         void ConstructL();
       
   128    
       
   129         /**
       
   130         * Deletes all temporary instances.
       
   131         */
       
   132         void DeleteAllL();
       
   133 
       
   134         /**
       
   135         * Load notification resource
       
   136         */
       
   137         HBufC* LoadResourceL( TInt aResourceID );
       
   138         
       
   139         /**
       
   140         * Scan the file location
       
   141         */
       
   142         HBufC* ScanFileL( const TDesC& aFileName, 
       
   143                         const TDesC& aFilePath );
       
   144                         
       
   145         /**
       
   146         * 
       
   147         */
       
   148         void DoLaunchGlobalNoteL( const TInt aResourceId, 
       
   149                 const TInt aSoftKeyConfig,
       
   150                 const TInt aSecondaryDisplayIndex );                        
       
   151 
       
   152     private:    // Data  
       
   153                         
       
   154         // Akn global message query 
       
   155         CAknGlobalMsgQuery*          iGlobalMsgQuery;
       
   156         
       
   157         // central repository, not own but can be deleted
       
   158         CRepository*      	         iCchCenRep; 
       
   159         
       
   160         // Handle to server
       
   161         CCCHServerBase&             iServer;
       
   162 
       
   163         // do we have secondary display?
       
   164         TBool                        iCoverDisplaySupported;
       
   165         
       
   166         // resource file path + name
       
   167         HBufC*                       iResourceFile;
       
   168         
       
   169         // Current resource Id
       
   170         TInt                         iResourceId;
       
   171         
       
   172         // should I commit suicide
       
   173         TBool                        iDie;       
       
   174         
       
   175         // File session
       
   176         RFs                          iFsSession;
       
   177         
       
   178         // Message query information array
       
   179         RArray<TGlobalMsgQueryInfo> iMsgQueryInfoArray;
       
   180     };
       
   181 
       
   182 #endif      // CCHNOTEHANDLER_H  
       
   183             
       
   184 // End of File