phoneuis/vmbx/inc/VmContainer.h
changeset 0 5f000ab63145
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     1 /*
       
     2 * Copyright (c) 2002-2009 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:  Declares a container control for the application.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef VM_CONTAINER_H
       
    20 #define VM_CONTAINER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32std.h>
       
    24 #include <bldvariant.hrh>
       
    25 #include <coecntrl.h>
       
    26 #include <badesca.h>
       
    27 #include <centralrepository.h>
       
    28 #include <cenrepnotifyhandler.h>
       
    29 #include <AknIconArray.h> //for sim icon
       
    30 #include <aiwdialdata.h>
       
    31 #include <vmnumber.h>
       
    32 #include "VmAppUi.h"
       
    33 
       
    34 // CONSTANTS
       
    35 enum TVmbxIndicators
       
    36     {
       
    37     EVmbxVoiceMessageAmountInd = 0,
       
    38     EVmbxVoiceMailboxNumberInd,
       
    39     EVmbxDetailsOfLastMessageInd,
       
    40     EVmbxVideoMailboxNumberInd,
       
    41     EVmbxIntCallVoiceMailboxNumberInd
       
    42     };
       
    43 
       
    44 // FORWARD DECLARATIONS
       
    45 class CAknDoubleGraphicStyleListBox;
       
    46 class CPhCltExtPhoneBase;
       
    47 class CAiwServiceHandler;
       
    48 class CPNGNumberGrouping;
       
    49 class CAknsBasicBackgroundControlContext;
       
    50 class CCaUiEngApi;
       
    51 class CSPSettings;
       
    52 
       
    53 // CLASS DECLARATION
       
    54 
       
    55 /**
       
    56 *  CVmContainer, container control class.
       
    57 *
       
    58 *  @lib ?library
       
    59 *  @since ?Series60_version
       
    60 */
       
    61 class CVmContainer : public CCoeControl,
       
    62                      public MVmbxNotifyHandler,
       
    63                      public MVmbxAlsObserver,
       
    64                      public MCenRepNotifyHandlerCallback,
       
    65                      public MEikListBoxObserver,
       
    66                      public MServiceNotifyHandler
       
    67                      
       
    68     {
       
    69     public:  // Constructors and destructor
       
    70 
       
    71         /**
       
    72         * C++ default constructor.
       
    73         */
       
    74         CVmContainer();
       
    75 
       
    76         /**
       
    77         * Symbian OS default constructor.
       
    78         * @param aRect Frame rectangle for container.
       
    79         * @param aServiceHandler AIW service handler.
       
    80         */
       
    81         void ConstructL( const TRect& aRect,
       
    82                                         CAiwServiceHandler* aServiceHandler );
       
    83 
       
    84         /**
       
    85         * Destructor.
       
    86         */
       
    87         ~CVmContainer();
       
    88 
       
    89     public:  // New functions
       
    90         /**
       
    91         * Query for a new voice mailbox number. Calls method of vmbx.dll.
       
    92         * A different query is created depending on whether the vmbx number
       
    93         * is defined before calling this.
       
    94         *
       
    95         * @param aQueryType query type ( 2 alternatives )
       
    96         */
       
    97         void QueryNumberL( TVmbxQueryType aQueryType );
       
    98 
       
    99         /**
       
   100         * Gets the vmbx number from SIM/SharedData and updates it
       
   101         * in the display.
       
   102         */
       
   103         void UpdateVmbxNumberL();
       
   104 
       
   105         /**
       
   106         * Check wether is possible to edit the voice mailbox number.
       
   107         * @since 2.7
       
   108         * @return ETrue is editing is allowed.
       
   109         */
       
   110         TBool AllowedToChangeTheNumber();
       
   111 
       
   112         /**
       
   113         * Resets to zero the voicemail message counter in SD.
       
   114         * @since 2.7
       
   115         */
       
   116         void ResetVoicemailMessageCounterL();
       
   117 
       
   118         /**
       
   119         * Check if VoIP profiles is found.
       
   120         * @since 3.0
       
   121         * @return ETrue if there is at least one VoIP profile, EFalse otherwise
       
   122         */
       
   123         TBool IsVoIPProfilesFound();
       
   124 
       
   125         /**
       
   126         * Gets index of the current item in listbox
       
   127         * @return index of current item
       
   128         */
       
   129         TInt CurrentItem();
       
   130 
       
   131 
       
   132         /**
       
   133         * Checks if clear icon is set
       
   134         * @return ETrue if clear icon
       
   135         */
       
   136         TBool IsClearIcon();
       
   137 
       
   138         /**
       
   139         * Calls the vmbx number using PhoneClient.
       
   140         */
       
   141         void CallVoiceMailBoxL();
       
   142 
       
   143         /**
       
   144         * Calls the VoIP vmbx number using PhoneClient.
       
   145         */
       
   146         void CallIntVoiceMailBoxL();
       
   147 
       
   148         /**
       
   149         * Makes a call request to AiwProvider.
       
   150         * @aCommand AiwCommand id.
       
   151         * @aCallType voice or Video call.
       
   152         * @return KErrNone if successful.
       
   153         **/
       
   154         void AiwCallRequestL( TInt aCommand, CAiwDialData::TCallType aCallType );
       
   155 
       
   156         /**
       
   157         * Ask Vmbx type.
       
   158         * @since 3.0
       
   159         * @return returns type of Vmbx.
       
   160         */
       
   161         TInt AskTypeL();
       
   162 
       
   163         /**
       
   164         * Calls the vmbx number using PhoneClient.
       
   165         * @since 3.1
       
   166         */
       
   167         void CallVideoMailBoxL();
       
   168 
       
   169         /**
       
   170         * Constructs the icons that are needed to indicate where
       
   171         * the vmbx number is stored
       
   172         * @since 3.0
       
   173         */
       
   174         void ConstructIconsForListboxL();
       
   175 
       
   176         /**
       
   177         * Query for a new video mailbox number. Calls method of vmbx.dll.
       
   178         * A different query is created depending on whether the video mailbox
       
   179         * number is defined before calling this.
       
   180         *
       
   181         * @param aQueryType query type ( 2 alternatives )
       
   182         * @since 3.1
       
   183         */
       
   184         void QueryVideoNumberL( TVmbxQueryType aQueryType );
       
   185 
       
   186         /**
       
   187         * Query for a voice mailbox number.
       
   188         *
       
   189         * @return Voice mailbox number
       
   190         * @since 3.1
       
   191         */ const TDesC& Number() const;
       
   192 
       
   193         /**
       
   194         * Query for a video mailbox number.
       
   195         *
       
   196         * @return Video mailbox number
       
   197         * @since 3.1
       
   198         */
       
   199         const TDesC& VideoNumber() const;
       
   200 
       
   201         /**
       
   202         * Informs that listbox must be updated because returned to Vmbx
       
   203         * from other application
       
   204         *
       
   205         * @since
       
   206         */
       
   207         void UpdateData( TBool aState );
       
   208 
       
   209         /**
       
   210          * Checks if there are configured IP voicemail services
       
   211          * @since 3.2
       
   212          * @return ETrue if at least one IP voicemail service was found
       
   213          */
       
   214         TBool IsIpVoiceMailboxServices();
       
   215 
       
   216         /**
       
   217          * Get Service Id.
       
   218          * @since 3.2
       
   219          * @return TUint Service Id.
       
   220          */
       
   221         TUint ServiceId();
       
   222 
       
   223         /**
       
   224          * Informs that listbox must be updated immediately.
       
   225          * @since 3.2
       
   226          */
       
   227         void UpdateListboxL();
       
   228 
       
   229         /**
       
   230          * Add brand icon if it exist.
       
   231          * @since 3.2
       
   232          * @param aServiceId Used Service Id
       
   233          * @param aIconId On completion, contains branded icon's icon list id
       
   234          */
       
   235         void AddBrandIconL( TUint aServiceId, TInt& aIconId );
       
   236 
       
   237         /**
       
   238          * Is service updated.
       
   239          * @since 3.2
       
   240          * @return TBool ETrue if service has updated, otherwise EFalse.
       
   241          */
       
   242         TBool IsServiceUpdated() const;
       
   243 
       
   244     public: // Functions from base classes
       
   245 
       
   246         /**
       
   247         * From MEikListBoxObserver, Handles list box events.
       
   248         * @param aEventType The event identifier.
       
   249         */
       
   250         void HandleListBoxEventL( CEikListBox* /*aListBox*/,
       
   251             					  TListBoxEvent aEventType );
       
   252         /**
       
   253          * Check if Video telphony is activated at FeatureManager
       
   254          * @since 3.2
       
   255          * @return Value of VT support
       
   256          */
       
   257         TBool IsVideoSupported();
       
   258 
       
   259     private:  // Functions from base classes
       
   260 
       
   261         /**
       
   262         * From CCoeControl, responds to focus changes
       
   263         * @since 3.0
       
   264         * @param aDrawNow ?description
       
   265         */
       
   266         void FocusChanged( TDrawNow aDrawNow );
       
   267 
       
   268         /**
       
   269         * From CoeControl, responds to size changes to sets the size and
       
   270         * position of the contents of this control
       
   271         */
       
   272         void SizeChanged();
       
   273 
       
   274         /**
       
   275         * From CoeControl, gets the number of controls contained in
       
   276         * a compound control
       
   277         */
       
   278         TInt CountComponentControls() const;
       
   279 
       
   280         /**
       
   281         * From CCoeControl, gets the specified component of a compound control
       
   282         */
       
   283         CCoeControl* ComponentControl( TInt aIndex ) const;
       
   284 
       
   285         /**
       
   286         * From CCoeControl, handles key events
       
   287         */
       
   288         TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
       
   289                                                  TEventCode aType );
       
   290 
       
   291         /**
       
   292         * From CCoeControl, handles a change to the control's resources
       
   293         */
       
   294         void HandleResourceChange( TInt aType );
       
   295 
       
   296         /**
       
   297         * From CCoeControl, draw a control - called by window server
       
   298         */
       
   299         void Draw( const TRect& aRect ) const;
       
   300 
       
   301 
       
   302         /**
       
   303         * From MVmbxNotifyHandler, user has completed an action
       
   304         * to a vmbx number
       
   305         */
       
   306         void HandleNotifyL( TInt aLine, const TDesC& aValue );
       
   307 
       
   308         /**
       
   309         * From MVmbxAlsObserver, ALS line changed
       
   310         */
       
   311         void HandleAlsChangeL( TVmbxAlsLine aLine );
       
   312 
       
   313         /**
       
   314         * From MCenRepNotifyHandlerCallback, user has pressed integer value keys
       
   315         **/
       
   316         void HandleNotifyInt( TUint32 aKey, TInt aValue );
       
   317 
       
   318         /**
       
   319         * From MServiceNotifyHandler user has changed Services.
       
   320         * @since S60 v3.2
       
   321         */
       
   322         void HandleServiceNotifyL();
       
   323 
       
   324     private:   // New functions
       
   325 
       
   326         /**
       
   327         * Updates the vmbx number in the listbox shown on the app screen.
       
   328         */
       
   329         void UpdateVmbxNumberInListBoxL();
       
   330 
       
   331         /**
       
   332         * Updates the new voice message to the listbox
       
   333         */
       
   334         void UpdateNewVoiceMessagesInListBoxL();
       
   335 
       
   336         /**
       
   337         * Updates the last message details to the listbox
       
   338         */
       
   339         void UpdateLastMessageDetailsInListBoxL();
       
   340 
       
   341         /**
       
   342         * Fill array with indications
       
   343         */
       
   344         void FillIndArray();
       
   345 
       
   346     private:  // data
       
   347 
       
   348         // Video line 1
       
   349         HBufC* iVideoLine1;  // owned
       
   350 
       
   351         // Video line 2
       
   352         HBufC* iVideoLine2;  // owned
       
   353 
       
   354         // Video number
       
   355         TBuf<KVmbxMaxNumberLength> iVideoNumber;
       
   356 
       
   357 
       
   358         // Handler of the Application Interworking
       
   359         CAiwServiceHandler* iServiceHandler;
       
   360 
       
   361         //Listbox text lines
       
   362         HBufC* iLine1;  // owned
       
   363         HBufC* iLine2;  // owned
       
   364         HBufC* iLine3;  // owned
       
   365         HBufC* iLine4;  // owned
       
   366 
       
   367         // Vmbx number handler
       
   368         RVmbxNumber iVmbxNumber;
       
   369 
       
   370         // Array for the listbox texts
       
   371         CDesCArrayFlat iArray;  // owned
       
   372 
       
   373         // Vmbx listbox
       
   374         CAknDoubleGraphicStyleListBox* iListBox;  // owned
       
   375 
       
   376 
       
   377         // Mailbox number
       
   378         TBuf<KVmbxMaxNumberLength> iNumber;
       
   379 
       
   380         // Phone groups
       
   381         CPNGNumberGrouping* iNumberGrouping;  // owned
       
   382 
       
   383         // Central repository handlers
       
   384         CCenRepNotifyHandler* iNotifyHandler1;
       
   385         CCenRepNotifyHandler* iNotifyHandler2;
       
   386         CCenRepNotifyHandler* iNotifyHandler3;
       
   387 
       
   388         // Central repository session
       
   389         CRepository* iSession;  // owned
       
   390 
       
   391         // Array for indications in listbox
       
   392         RArray<TInt> iIndArray;
       
   393 
       
   394         //PRI Settings
       
   395         TInt iVmUiOpts;
       
   396 
       
   397         // Icon array
       
   398         CAknIconArray* iListIcons; //not own.. list box will delete this one
       
   399 
       
   400         // skin data
       
   401         CAknsBasicBackgroundControlContext* iSkinContext; // owned
       
   402 
       
   403         // Mailbox type
       
   404         TInt iType;
       
   405 
       
   406         // Update data when back to application
       
   407         TBool iUpdateData;
       
   408 
       
   409         // CenRep key for video support
       
   410         TBool iIsVideoSupported;
       
   411 
       
   412         // Set to true if call is ongoing
       
   413         TBool iIsCallOngoing;
       
   414 
       
   415         /**
       
   416          * Instance of service settings provider.
       
   417          * Used especially to retrieve VoIP specific info.
       
   418          * Own.
       
   419          */
       
   420         CSPSettings* iServiceProviderSettings;
       
   421 
       
   422         TBool iServiceUpdated;
       
   423 
       
   424         TBool iFeatureManagerInitialized;
       
   425 
       
   426     };
       
   427 
       
   428 #endif  // VM_CONTAINER_H
       
   429 
       
   430 // End of File