coreapplicationuis/SysAp/Src/CenRepObservers/sysapcenrepmsgwaitingobserver.h
changeset 0 2e3d3ce01487
equal deleted inserted replaced
-1:000000000000 0:2e3d3ce01487
       
     1 /*
       
     2 * Copyright (c) 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:  CSysApCenRepMsgWaitingObserver class definition. 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef SYSAPCENREPMSGWAITINGOBSERVER_H
       
    20 #define SYSAPCENREPMSGWAITINGOBSERVER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <ctsydomaincrkeys.h>
       
    24 #include <centralrepository.h>
       
    25 #include <cenrepnotifyhandler.h>
       
    26 
       
    27 class CSysApAppUi;
       
    28 
       
    29 /**
       
    30 *  CSysApCenRepMsgWaitingObserver class observes for changes in
       
    31 *  message waiting display sstatus CenRep key.
       
    32 *
       
    33 *  @lib None.
       
    34 *  @since S60 3.2
       
    35 */
       
    36 
       
    37 class CSysApCenRepMsgWaitingObserver : public CBase, public MCenRepNotifyHandlerCallback
       
    38     {
       
    39     
       
    40 public:
       
    41     
       
    42     /**
       
    43     * Values for voice mail waiting state.
       
    44     *
       
    45     * @since S60 3.2
       
    46     */
       
    47     enum TVoiceMailWaitingState
       
    48         {
       
    49         ENoVoiceMails, /// no voice mails
       
    50         EWaiting, /// voice mail waiting on primary line (ALS not supported)
       
    51         EWaitingOnLine1, /// voice mail waiting on primary line
       
    52         EWaitingOnLine2, /// voice mail waiting on secondary line
       
    53         EWaitingOnBothLines /// voice mail waiting on both primary and secondary line
       
    54         };
       
    55 
       
    56 public:
       
    57     /**
       
    58     * Symbian two-phased constructor.
       
    59     *
       
    60     * @param aSysApAppUi reference to SysAp's application class
       
    61     */
       
    62     static CSysApCenRepMsgWaitingObserver* NewL( CSysApAppUi& aSysApAppUi );
       
    63 
       
    64     /**
       
    65     * Destructor.
       
    66     */
       
    67     virtual ~CSysApCenRepMsgWaitingObserver();
       
    68 
       
    69     /**
       
    70     * Updates message waiting indicators.
       
    71     *
       
    72     * @since S60 3.2
       
    73     */
       
    74     void UpdateMessageWaitingIndicatorsL();
       
    75 
       
    76 public: // From MCenRepNotifyHandlerCallback
       
    77     void HandleNotifyInt( TUint32 aId, TInt aNewValue );
       
    78     void HandleNotifyError( TUint32 aId, TInt error, CCenRepNotifyHandler* aHandler );
       
    79 
       
    80 private:
       
    81 
       
    82     /**
       
    83     * Symbian 2nd-phase constructor.
       
    84     */
       
    85     void ConstructL();
       
    86 
       
    87     /**
       
    88     * C++ default constructor.
       
    89     * Prohibited.
       
    90     */
       
    91     CSysApCenRepMsgWaitingObserver();
       
    92     
       
    93     /**
       
    94     * Constructor.
       
    95     *
       
    96     * @param aSysApAppUi reference to SysAp's application class
       
    97     */         
       
    98     CSysApCenRepMsgWaitingObserver( CSysApAppUi& aSysApAppUi );
       
    99 
       
   100     
       
   101     /** 
       
   102     * Copy constructor.
       
   103     * Prohibited.
       
   104     */
       
   105     CSysApCenRepMsgWaitingObserver( const CSysApCenRepMsgWaitingObserver& );
       
   106 
       
   107     /**
       
   108     * Assigment operator
       
   109     * Prohibited.
       
   110     */
       
   111     CSysApCenRepMsgWaitingObserver& operator= ( const CSysApCenRepMsgWaitingObserver& );
       
   112     
       
   113     /**
       
   114     * Updates message waiting indicators. Only indicators whose status have changed
       
   115     * are updated.
       
   116     *
       
   117     * @since S60 3.2
       
   118     */
       
   119     void UpdateMessageWaitingIndicatorsIfNeededL() const;
       
   120     
       
   121     /**
       
   122     * Updates voice mail waiting indicators.
       
   123     *
       
   124     * @since S60 3.2
       
   125     */
       
   126     void UpdateVoiceMailWaitingIndicatorsL() const;
       
   127 
       
   128     /**
       
   129     * Updates fax mail waiting indicator.
       
   130     *
       
   131     * @since S60 3.2
       
   132     */
       
   133     void UpdateFaxMessageWaitingIndicatorL() const;
       
   134 
       
   135     /**
       
   136     * Updates e-mail waiting indicator.
       
   137     *
       
   138     * @since S60 3.2
       
   139     */
       
   140     void UpdateEmailMessageWaitingIndicatorL() const;
       
   141     
       
   142     /**
       
   143     * Updates other message waiting indicator.
       
   144     *
       
   145     * @since S60 3.2
       
   146     */
       
   147     void UpdateOtherMessageWaitingIndicatorL() const;
       
   148     
       
   149     /**
       
   150     * Resolves current voice mail indicator state.
       
   151     *
       
   152     * @since S60 3.2
       
   153     * @return current voice mail state
       
   154     */
       
   155     TVoiceMailWaitingState ResolveVoiceMailState() const;
       
   156 
       
   157 private:
       
   158     
       
   159     /**
       
   160     * SysAp's application class.
       
   161     */
       
   162     CSysApAppUi& iSysApAppUi;
       
   163     
       
   164     /**
       
   165     * CenRep session.
       
   166     * Own.
       
   167     */ 
       
   168     CRepository* iSession;
       
   169     
       
   170     /**
       
   171     * CenRep notification handler.
       
   172     * Own.
       
   173     */
       
   174     CCenRepNotifyHandler* iMessageWaitingHandler;
       
   175     
       
   176     /**
       
   177     * Bitmask containing MWIS information.
       
   178     */
       
   179     TInt iMessageWaitingDisplayStatus;
       
   180     
       
   181     /**
       
   182     * Bitmask containing MWIS information.
       
   183     */
       
   184     TInt iOldDisplayStatus;
       
   185     
       
   186     /**
       
   187     * Set to ETrue when indicators can be updated to UI.
       
   188     */
       
   189     TBool iUiReady;
       
   190     };
       
   191 
       
   192 #endif      // SYSAPCENREPMSGWAITINGOBSERVER_H
       
   193             
       
   194 // End of File