messagingappbase/msgavkon/msgindicatorplugin/inc/msgindicatorpluginimplementation.h
changeset 0 72b543305e3a
child 15 52d61119153d
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     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:   Defines the CMsgIndicatorPluginImplementation class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef CMSGINDICATORPLUGINIMPLEMENTATION_H
       
    22 #define CMSGINDICATORPLUGINIMPLEMENTATION_H
       
    23 
       
    24 // Until aknstylusactivatedpopupcontent.h is fixed
       
    25 
       
    26 //  INCLUDES
       
    27 #include <AknLayout2ScalableDef.h>
       
    28 #include <AknIndicatorPlugin.h> // CAknIndicatorPlugin
       
    29 #include <AknPreviewPopUpController.h> // Controlling the preview pop-up component
       
    30 #include <aknstylusactivatedpopupcontent.h> // Stylus activated pop-up conten
       
    31 #include <vmnumber.h> // TPhCltTelephoneNumber, RVmbxNumber
       
    32 #include <etelmm.h> // RMobilePhone
       
    33 #include "MsgWaitingObserver.h" // Observer
       
    34 
       
    35 class TAknWindowComponentLayout; 
       
    36 class CAknIndicatorPlugin;
       
    37 class CAknIndicatorPopupContent;
       
    38 class TAknWindowComponentLayout;
       
    39 class CMsgIndicatorPluginVoiceMail;
       
    40 /**
       
    41 *  MSGIndicator Plug-in implementation
       
    42 *
       
    43 *  @lib MsgIndicatorPlugin
       
    44 *  @since 5.0
       
    45 */
       
    46 class CMsgIndicatorPluginImplementation : public CAknIndicatorPlugin,
       
    47                                          public MAknPreviewPopUpObserver,
       
    48                                          public MEikCommandObserver
       
    49                                          
       
    50     {
       
    51     private:
       
    52     
       
    53         // Voicemail lines
       
    54         enum TMsgLine
       
    55             {
       
    56             EMsgIndicatorGeneral = 0,
       
    57             EMsgIndicatorLine1 = 1,
       
    58             EMsgIndicatorLine2 = 2,
       
    59             EMsgIndicatorLineBoth = 3
       
    60             };
       
    61         // PopUpStrings
       
    62         enum TMsgStrings
       
    63             {
       
    64             ENewItemInInbox = 0, //"1 New message"
       
    65             ENewItemsInInbox, //"%N New messages"
       
    66             ENewItemInOutbox, //"1 message in outbox"
       
    67             ENewItemsInOutbox, //"%N msgs in outbox"
       
    68             ENewOtherMessages, //"New msgs available"
       
    69             
       
    70             ENewEmail, //"New e-mail"
       
    71             ENewVoiceMail, //"New voice msg"
       
    72             ENewVoiceMails, //"%N new voice msgs"
       
    73             ENewUnkVoiceMails, //"New voice msgs"
       
    74             ENewVoiceMailOnLine1, //"New msg, line 1"
       
    75 
       
    76             ENewVoiceMailsOnLine1, //"%N new msgs, line 1"
       
    77             ENewUnkVoiceMailsOnLine1, //"New msgs, line 1"
       
    78             ENewVoiceMailOnLine2, //"New msg, line 2"
       
    79             ENewVoiceMailsOnLine2, //"%N new msgs, line 2"
       
    80             ENewUnkVoiceMailsOnLine2, //"New msgs, line 2"
       
    81 
       
    82             ENewFax, //"1 New fax"
       
    83             ENewFaxes, //"%N New faxes"
       
    84             ENewUknFaxes,//"New Faxes"
       
    85             
       
    86             ESimMemoryFull //"Sim memory full"
       
    87             };
       
    88 
       
    89         
       
    90     public:  // Constructors and destructor
       
    91 
       
    92         /**
       
    93         * Two-phased constructor.
       
    94         */
       
    95         static CMsgIndicatorPluginImplementation* NewL();
       
    96 
       
    97         /**
       
    98         * Destructor.
       
    99         */
       
   100         ~CMsgIndicatorPluginImplementation();
       
   101 
       
   102     private: // From CAknIndicatorPlugin
       
   103         
       
   104         /**
       
   105          * @see CAknIndicatorPlugin
       
   106          */
       
   107         void HandleIndicatorTapL( const TInt aUid );
       
   108 
       
   109         /**
       
   110          * @see CAknIndicatorPlugin
       
   111          */
       
   112         HBufC* TextL( const TInt aUid, TInt& aTextType );
       
   113         
       
   114     public: // From MAknPreviewPopUpObserver
       
   115    
       
   116         /**
       
   117          * @see MAknPreviewPopUpObserver
       
   118          */
       
   119         void HandlePreviewPopUpEventL(
       
   120             CAknPreviewPopUpController* aController,
       
   121             TPreviewPopUpEvent aEvent );
       
   122 
       
   123     public: // From MEikCommandObserver
       
   124     
       
   125         /**
       
   126          * @see MEikCommandObserver
       
   127          */
       
   128     	void ProcessCommandL( TInt aCommandId );
       
   129     	
       
   130     public:    	
       
   131 
       
   132     	/**
       
   133          * The current state of the alternative line subscription 
       
   134          * support
       
   135          * @return ALS status
       
   136          */
       
   137         TBool IsALSSupported();
       
   138     	
       
   139     private:
       
   140 
       
   141         /**
       
   142         * C++ default constructor.
       
   143         */
       
   144         CMsgIndicatorPluginImplementation();
       
   145 
       
   146         /**
       
   147         * By default Symbian 2nd phase constructor is private.
       
   148         */
       
   149         void ConstructL();
       
   150 
       
   151     private: // new functions
       
   152 
       
   153         /**
       
   154          * Create singular or plural content message for the popup
       
   155          * @return constructed text
       
   156          * 
       
   157          * NOTE! Ownership of the text is transferred to caller.
       
   158          */
       
   159         HBufC* CreatePopupContentEnvelopeMessageL(TBool& isMsgCountZero);
       
   160 
       
   161         /**
       
   162          * Create singular or plural content message for the popup
       
   163          * @return constructed text
       
   164          * 
       
   165          * NOTE! Ownership of the text is transferred to caller.
       
   166          */
       
   167         HBufC* CreatePopupContentFaxMessageL();
       
   168 
       
   169         /**
       
   170          * Create singular or plural content message for the popup
       
   171          * @return constructed text
       
   172          * 
       
   173          * NOTE! Ownership of the text is transferred to caller.
       
   174          */
       
   175         HBufC* CreatePopupContentOutboxMessageL(); 
       
   176 
       
   177         /**
       
   178          * Create singular or plural content message for the popup
       
   179          * @return constructed text
       
   180          * 
       
   181          * NOTE! Ownership of the text is transferred to caller.
       
   182          */
       
   183         HBufC* CreatePopupContentOtherMessageL();
       
   184 
       
   185         /**
       
   186          * Create singular or plural content message for the popup
       
   187          * @return constructed text
       
   188          * 
       
   189          * NOTE! Ownership of the text is transferred to caller.
       
   190          */
       
   191         HBufC* CreatePopupContentEmailMessageL();
       
   192 
       
   193         /**
       
   194          * Create singular or plural content message for the popup
       
   195          * @return constructed text
       
   196          * 
       
   197          * NOTE! Ownership of the text is transferred to caller.
       
   198          */
       
   199         HBufC* CreatePopupContentVoiceMailGeneralL();
       
   200 
       
   201         /**
       
   202          * Create singular or plural content message for the popup
       
   203          * @return constructed text
       
   204          * 
       
   205          * NOTE! Ownership of the text is transferred to caller.
       
   206          */
       
   207         HBufC* CreatePopupContentVoiceMailLineOneL();
       
   208 
       
   209         /**
       
   210          * Create singular or plural content message for the popup
       
   211          * @return constructed text
       
   212          * 
       
   213          * NOTE! Ownership of the text is transferred to caller.
       
   214          */
       
   215         HBufC* CreatePopupContentVoiceMailLineTwoL();
       
   216         
       
   217         /**
       
   218          * Check the voicemailbox number, if number is not defined
       
   219          * it is asked.
       
   220          * @param aLine: Linenumber of voicemail.
       
   221          */
       
   222         void CheckVMBNumberAndCallL( TMsgLine aLine );
       
   223 
       
   224 		void LaunchNewVoiceMailAppL(TInt aType) ;
       
   225 		void LaunchViewL(const TVwsViewId& aViewId, TUid aCustomMessageId, 
       
   226         const TDesC8& aCustomMessage);
       
   227 
       
   228         /**
       
   229          * Make a call to the number. Must be a valid phonenumber.
       
   230          * Otherwise does not do nothing
       
   231          * @param aTelNumber: A telephone number to be called.
       
   232          */
       
   233         void CallL( TPhCltTelephoneNumber aTelNumber );
       
   234 
       
   235 		/**
       
   236         * Find out is alternative line subscription active in the terminal
       
   237 		*/
       
   238         TBool UpdateALSStatus();
       
   239         
       
   240         /**
       
   241         * Launches voice mailbox application
       
   242         */
       
   243         void LaunchVmBxAppL ();
       
   244 
       
   245     private: // data
       
   246 
       
   247         // The current state of the ALS support
       
   248         TBool iIsALSSupported;
       
   249 
       
   250         RMobilePhone iMobilePhone;
       
   251 
       
   252         CWaitingObserver *iObserver;
       
   253 
       
   254         // String array        
       
   255         CDesCArrayFlat*  iMessagesStrings;
       
   256         
       
   257         //CRepository
       
   258         CRepository* iStorage;
       
   259         
       
   260         //RVmbxNumber
       
   261         RVmbxNumber iVmbx;
       
   262         
       
   263         //is vmbx Open allready
       
   264         TBool iSVmbxOpen;
       
   265 
       
   266         // central repository
       
   267         CRepository*   iRepository;
       
   268     };
       
   269 
       
   270 #endif      // CMSGINDICATORPLUGINIMPLEMENTATION_H
       
   271 
       
   272 // End of File