messagingappbase/ncnlist/inc/CVoiceMailManager.h
changeset 0 72b543305e3a
child 25 fa1df4b99609
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2004 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:   Handles the notifications for voice mail messages
       
    15 *			   : Keeps track about the number of voice mail messages
       
    16 *			   : Has support for alternative line (ALS)
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 #ifndef NCNVOICEMAILMANAGER_H
       
    23 #define NCNVOICEMAILMANAGER_H
       
    24 
       
    25 // INCLUDES
       
    26 #include "NcnSubscribeHandler.h"
       
    27 #include "MNcnMsgWaitingManager.h"
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CNcnSubscriber;
       
    31 class CNcnCRHandler;
       
    32 class MNcnNotifier;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 /**
       
    37 * Class implementing a voice mail management responsibility
       
    38 * All the methods since 3.1 if other not specified 
       
    39 * @since Series60 3.1
       
    40 */
       
    41 class CVoiceMailManager : public CBase, public MNcnSubscribeHandler
       
    42 {
       
    43     public:
       
    44     
       
    45     /**
       
    46      * Voice mail count can be a number telling the exact count of the messages
       
    47      * if the exact count is not known ECountNotKnown is used.
       
    48      * ENoVoiceMails is used to signify that no voice mails exists.
       
    49      */
       
    50     enum TVoiceMailCount
       
    51         {
       
    52         /* No voice mails exist */
       
    53     	ENoVoiceMails = 0,
       
    54     	
       
    55         /* Maximum number of voice mails */
       
    56     	EVMMaximumNumber = 0xfe,
       
    57     	
       
    58     	/* Voice mails exist but the exact count is not known */
       
    59     	EVMExistsButCountNotKnown = 0xff
       
    60         };
       
    61             
       
    62         /**
       
    63          * Two-phased constructor.
       
    64          */
       
    65         static CVoiceMailManager* NewL( CNcnModelBase& aModel );
       
    66 
       
    67         /**
       
    68          * Destructor.
       
    69          */
       
    70         ~CVoiceMailManager();
       
    71 
       
    72         /**
       
    73          * Received a voice mail message to line 1
       
    74          * Messages are SET(default) and CLEAR message. There is three ways
       
    75          * how voice mail messages can arrive. CPHS, DCS and "special SMS"
       
    76          * these messages are handled by NCN session observer. 
       
    77          * Use TVoiceMailCount values in case the message is a clear message or
       
    78          * the amount is not exactly know. Otherwise give the exact count.
       
    79 		 * @param aAmount How many voice mails we received to line 1
       
    80          */
       
    81         void VMMessageReceived( MNcnMsgWaitingManager::TNcnMessageType aLineType, TUint aAmount );
       
    82  
       
    83         /**
       
    84          * Check the SIM status at the boot up phase. If the SIM contains
       
    85          * voice mails the PS key has been updated by some other component.
       
    86          * The internal number that we maintain about the voice message count
       
    87          * is now over written by a general notification about "New voice mail(s)"
       
    88          * Reason for this is that SIM card does not apparantly hold the exact amount
       
    89          * of received voice mails so only a general notification is desired.
       
    90          * @return True if SIM contains voice mail messages
       
    91          */
       
    92         TBool CheckForSIMVoiceMailMessages();
       
    93         
       
    94         /**
       
    95          * SIM has changed so we will need to erase old notes.
       
    96          * Model uses this method to notify voice mail manager
       
    97          * We also use this in the constructL if we notice that
       
    98          * the SIM has changed in boot-up
       
    99          */
       
   100 		void NotifyAboutSIMChange();
       
   101 		
       
   102     private:
       
   103 
       
   104         /**
       
   105          * C++ default constructor.
       
   106          */
       
   107         CVoiceMailManager( CNcnModelBase& aModel );
       
   108 
       
   109         /**
       
   110          * By default Symbian 2nd phase constructor is private.
       
   111          */
       
   112         void ConstructL();
       
   113 
       
   114 	public: //from MNcnSubscribeHandler
       
   115 
       
   116 		/**
       
   117         * Through this method the Property subscribers notify of Property changes
       
   118         * @param aCategory The category of the property to be observed
       
   119 		* @param aKey The subkey of the property to be observed
       
   120 		*/
       
   121         void HandlePropertyChangedL( const TUid& aCategory, TInt aKey );
       
   122         
       
   123         /**
       
   124          * ALS indication and note update
       
   125          * 
       
   126          * Indication and note must be updated for line 1 and line 2
       
   127          * whenever state for either of the line changes.
       
   128          * 
       
   129          */
       
   130         void UpdateNoteAndIndicationWithALS( TInt aMsgOnLine1,  TInt aMsgOnLine2 );
       
   131         
       
   132 		/**
       
   133         * Update soft notification and trigger icon drawing to
       
   134         * reflect the current state of the lines
       
   135 		*/
       
   136         void UpdateVMNotifications();
       
   137 
       
   138 
       
   139     private: // Own methods
       
   140     
       
   141         /**
       
   142         * Clear existing voice mail notes
       
   143         */
       
   144         void ClearVoiceMailSoftNotes();     
       
   145 
       
   146 		/**
       
   147         * Find out is alternative line subscription active in the terminal
       
   148 		*/
       
   149         TBool UpdateALSStatus();
       
   150         
       
   151     private: // data
       
   152 
       
   153     	/**
       
   154          * The current state of the ALS support
       
   155          */
       
   156         TBool iIsALSSupported;
       
   157         
       
   158         
       
   159 		/* 107-18696: Handling of EF-CFIS and EF-MWIS in telephony area
       
   160 		 * No need to keep voice mail count anymore. ETEL MM will take 
       
   161 		 * care of that.
       
   162 		 */
       
   163     	/**
       
   164          * Number of voice mails we have active in line 1
       
   165          */
       
   166         //TUint iVoiceMailCountInLine1;
       
   167 
       
   168     	/**
       
   169          * Number of voice mails we have active in line 2
       
   170          */
       
   171         //TUint iVoiceMailCountInLine2;
       
   172               
       
   173     	/**
       
   174          * Value of the PS key KNcnVoiceMailStatusValue, which
       
   175          * is currently mapped to KPSUidVoiceMailStatusValue
       
   176          */
       
   177         //TInt iPSKeyForVoiceMailStatus;
       
   178 
       
   179      	/**
       
   180          * CR keys are updated through the ncn CR handler
       
   181          * Not owned only referenced.
       
   182          */       
       
   183         //CNcnCRHandler& iNcnCRHandler;
       
   184         
       
   185      	/**
       
   186          * Used to display soft notification
       
   187          * Not owned only referenced.
       
   188          */                
       
   189         //MNcnNotifier& iNcnNotifier;
       
   190         
       
   191      	/**
       
   192          * Reference to model which is used to display
       
   193          * soft notes and manage indicators and message counts. 
       
   194          */                
       
   195         CNcnModelBase& iModel;
       
   196 };
       
   197 
       
   198 
       
   199 #endif // NCNVOICEMAILMANAGER_H
       
   200 
       
   201 // End of File