phoneclientserver/aiwdialdata/inc/aiwinternaldialdata.h
changeset 0 ff3b6d0fd310
child 19 7d48bed6ce0c
equal deleted inserted replaced
-1:000000000000 0:ff3b6d0fd310
       
     1 /*
       
     2 * Copyright (c) 2005-2006 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:  Dial data used with AIW for making calls.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CAIWINTERNALDIALDATA_H
       
    20 #define CAIWINTERNALDIALDATA_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <s32mem.h>
       
    24 #include <AiwGenericParam.h>
       
    25 #include "aiwdialdata.h"
       
    26 
       
    27 /** Constants used by aiwinternaldialdata interface. */ 
       
    28 namespace AIWInternalDialData
       
    29     {
       
    30     /** Maximum name length. */ 
       
    31     const TInt KMaximumNameLength = 50;
       
    32 
       
    33     /** Maximum phone number length same as  used by phone. */ 
       
    34     const TInt KMaximumPhoneNumberLength = 100;
       
    35 
       
    36     /** The subaddress length, see ITU-T I.330 and 3GPP TS 11.14. */ 
       
    37     const TInt KAiwSubAddressLength = 21;
       
    38 
       
    39     /** The maximum bearer length. The bearer capabilities as 
       
    40     defined in GSM 04.08. */ 
       
    41     const TInt KAiwBearerLength = 14;
       
    42     
       
    43     /** Maximum length of UUI data. */
       
    44     const TInt KAiwUUILength = 129;
       
    45     }
       
    46 
       
    47 // CLASS DECLARATION
       
    48 
       
    49 /**
       
    50 *  Dial data for SAT application.
       
    51 *
       
    52 *  @lib aiwdialdata.lib
       
    53 *  @since S60 3.2
       
    54 */
       
    55 NONSHARABLE_CLASS( CAiwInternalDialData ): public CBase
       
    56     {
       
    57     public:  // Constructors and destructor
       
    58         
       
    59         /**
       
    60         * Two-phased constructor for implementation class. 
       
    61         * Use this method for creating a instance with null items.
       
    62         *
       
    63         * @since S60 3.2
       
    64         * @return A pointer to the new object.
       
    65         */
       
    66         IMPORT_C static CAiwInternalDialData* NewL();
       
    67         
       
    68         /**
       
    69         * Two-phased constructor for implementation class. Leaves the 
       
    70         * pointer to the cleanup stack.
       
    71         * Use this method for creating a instance with null items.
       
    72         *
       
    73         * @since S60 3.2
       
    74         * @return A pointer to the new object.
       
    75         */
       
    76         IMPORT_C static CAiwInternalDialData* NewLC();
       
    77            
       
    78            /**
       
    79         * Two-phased constructor for implementation class. 
       
    80         * Use this method for creating a instance with null items.
       
    81         *
       
    82         * @since S60 3.2
       
    83         * @param aPackage descriptor parameter.
       
    84         * @return A pointer to the new object.
       
    85         */
       
    86         IMPORT_C static CAiwInternalDialData* NewL( const TDesC8& aPackage );
       
    87         
       
    88            /**
       
    89         * Two-phased constructor for implementation class. Leaves the 
       
    90         * pointer to the cleanup stack.
       
    91         * Use this method for creating a instance with null items.
       
    92         *
       
    93         * @since S60 3.2
       
    94         * @param aPackage descriptor parameter.
       
    95         * @return A pointer to the new object.
       
    96         */
       
    97         IMPORT_C static CAiwInternalDialData* NewLC( const TDesC8& aPackage );
       
    98         
       
    99         /**
       
   100         * Destructor.
       
   101         */
       
   102         virtual ~CAiwInternalDialData();
       
   103         
       
   104     public: // New
       
   105     
       
   106         /**
       
   107         * Composes data set package and inserts data to aInParamList.
       
   108         *
       
   109         * @since S60 3.2
       
   110         * @param aInParamList In parameter used with CAiwService.
       
   111         */
       
   112         IMPORT_C void FillInParamListL( CAiwGenericParamList& aInParamList );
       
   113 
       
   114     public: // Access - Setters
       
   115     
       
   116         /**
       
   117         * Sets the phone number. If phone number and contact link are both 
       
   118         * defined call will be made to contact link.
       
   119         * 
       
   120         * @since S60 3.2
       
   121         * @param aPhoneNumber Phone number, which maximum length is
       
   122         *        KMaximumPhoneNumberLength. 
       
   123         *        Default: empty.
       
   124         * @leaves KErrArgument if aPhoneNumber length is over 
       
   125         *        KMaximumPhoneNumberLength.
       
   126         */
       
   127         IMPORT_C void SetPhoneNumberL( const TDesC& aPhoneNumber );
       
   128         
       
   129         /**
       
   130         * Sets call type.
       
   131         *
       
   132         * @since S60 3.2
       
   133         * @param aCallType defines the call type.
       
   134         *        Default: EAIWVoice.
       
   135         */
       
   136         IMPORT_C void SetCallType( CAiwDialData::TCallType aCallType );
       
   137         
       
   138         /**
       
   139         * Sets the window group identifier. When call is ended, 
       
   140         * set window group is actived.
       
   141         *
       
   142         * @since S60 3.2
       
   143         * @param aWindowGroup Window group id.
       
   144         *        Default: KAiwGoToIdle.
       
   145         */
       
   146         IMPORT_C void SetWindowGroup( TInt aWindowGroup );
       
   147         
       
   148         /**
       
   149         * Sets initiate call.
       
   150         *
       
   151         * @since S60 3.2
       
   152         * @param aInitCall ETrue if call is created by using
       
   153         *        long press of send key otherwise EFalse.
       
   154         *        Default: EFalse.
       
   155         */
       
   156         IMPORT_C void SetInitiateCall( TBool aInitCall );
       
   157         
       
   158         /**
       
   159         * Sets the name of the person who is to be called. If client sets name
       
   160         * then set name is shown not contact card defined name. Set name is shown
       
   161         * also in log event.
       
   162         *
       
   163         * @since S60 3.2
       
   164         * @param aName The name of the person being called.
       
   165         * @leaves KErrArgument if aName length is over KMaximumNameLength.
       
   166         *         Default: Empty.
       
   167         */
       
   168         IMPORT_C void SetNameL( const TDesC& aName );        
       
   169         
       
   170         /**
       
   171         * Change the redial mode. For used parameters see redial related 
       
   172         * constants above.
       
   173         *
       
   174         * @since S60 3.2
       
   175         * @param aRedial the new redial status.
       
   176         *        Default: KAIWRedialDefault.
       
   177         */
       
   178         IMPORT_C void SetRedial( TInt aRedial );
       
   179         
       
   180         /**
       
   181         * Set the number visibility in the phone app.
       
   182         * If this is set to EFalse, then number is not shown at all in callbubble
       
   183         * If number has defined contact card contact name is shown in call bubble.
       
   184         *
       
   185         * @since S60 3.2
       
   186         * @param aShowNumber Whether or not to show the number.
       
   187         *        Default: ETrue.
       
   188         */
       
   189         IMPORT_C void SetShowNumber( TBool aShowNumber );
       
   190         
       
   191         /**
       
   192         * Set whether the phone number should be matched
       
   193         * against the personal directory. 
       
   194         *
       
   195         * If ETrue and name is set then number is matched to
       
   196         * phonebook but set name is shown in call bubble.
       
   197         * If name is not set then no name is shown in call bubble
       
   198         * just phone number.
       
   199         *
       
   200         * This should be set EFalse only if phone number has not been
       
   201         * taken from phonebook.
       
   202         *
       
   203         * @since S60 3.2
       
   204         * @param aAllowMatch Whether to allow matches.
       
   205         *        Default: ETrue.
       
   206         */
       
   207         IMPORT_C void SetAllowMatch( TBool aAllowMatch );
       
   208                 
       
   209         /**
       
   210         * Set contact link. If phone number and contact link are both 
       
   211         * defined call will be made to contact link.
       
   212         *
       
   213         * @since S60 3.2
       
   214         * @param aContactLink Contact link information.
       
   215         *        Default: Empty.
       
   216         */
       
   217         IMPORT_C void SetContactLinkL( const TDesC8& aContactLink );
       
   218         
       
   219         /**
       
   220         * Set wheteher this is a SAT originated call or not.
       
   221         * If this function is not called, the originator is assumed to 
       
   222         * be other than SAT.
       
   223         *
       
   224         * @since S60 3.2
       
   225         * @param aSATCall ETrue if SAT originated the call, EFalse otherwise.
       
   226         *        Default: EFalse.
       
   227         */
       
   228         IMPORT_C void SetSATCall( TBool aSATCall );
       
   229 
       
   230         /**
       
   231         * Set the calling party subaddress.
       
   232         * Defined in ITU-T I.330 and 3GPP TS 11.14.
       
   233         *
       
   234         * @since S60 3.2
       
   235         * @param aSubAddress The calling party subaddress.
       
   236         * @leaves KErrArgument if aSubAddress length is longer than 
       
   237         *         50 characters.
       
   238         *         Default: Empty.
       
   239         */
       
   240         IMPORT_C void SetSubAddressL( const TDesC& aSubAddress );
       
   241         
       
   242         /**
       
   243         * Set parameter for end other calls. 
       
   244         * If this is set to ETrue, other calls will be terminated 
       
   245         * before dial. 
       
   246         *
       
   247         * @since S60 3.2
       
   248         * @param aEndCalls Are the other calls ended.
       
   249         *        Default: EFalse.
       
   250         */
       
   251         IMPORT_C void SetEndOtherCalls( TBool aEndOtherCalls );
       
   252         
       
   253         /**
       
   254         * Set the bearer capability.
       
   255         *
       
   256         * @since S60 3.2
       
   257         * @param aBearer The bearer capabilities as defined in GSM 04.08.
       
   258         * @leaves KErrArgument if aBearer's length is longer than 14
       
   259         *         characters.
       
   260         *         Default: Empty.
       
   261         */
       
   262         IMPORT_C void SetBearerL( const TDesC8& aBearer );
       
   263                 
       
   264         /**
       
   265         * Set redial max duration time.
       
   266         *
       
   267         * @since S60 3.2
       
   268         * @param aMaxDuration The value of duration in seconds.
       
   269         *        Default: Empty.
       
   270         */
       
   271         IMPORT_C void SetRedialMaximumDuration( 
       
   272                         const TTimeIntervalSeconds aMaximumRedialDuration );
       
   273                         
       
   274         /**
       
   275         * Set id of used call service.
       
   276         *
       
   277         * @param aServiceId The value of Service Id.
       
   278         *        Default: Null.
       
   279         */
       
   280         IMPORT_C void SetServiceId( TUint32 aServiceId );    
       
   281 
       
   282         /**
       
   283          * Sets the user to user information. If this is set then the UUI data
       
   284          * is sent to the recipient via UUS mechanism at call setup phase.
       
   285          *
       
   286          * Note that UUI is not sent if telephony local variation 
       
   287          * KTelephonyLVFlagUUS is not set.
       
   288          * 
       
   289          * @since S60 v3.2
       
   290          * @param aUUI User to user information. Maxmimum length of UUI is
       
   291          * defined by constant KAiwUUILength. Leaves with KErrArgument if 
       
   292          * given data is longer than KAiwUUILength.
       
   293          */
       
   294         IMPORT_C void SetUUIL( const TDesC& aUUI );
       
   295      
       
   296    public: // Access - Getters
       
   297         
       
   298         /**
       
   299         * Phone number.
       
   300         *
       
   301         * @since S60 3.2
       
   302         * @return Phone number.
       
   303         */
       
   304         IMPORT_C const TDesC& PhoneNumber() const;
       
   305         
       
   306         /**
       
   307         * Call type.
       
   308         *
       
   309         * @since S60 3.2
       
   310         * @return Current call type.
       
   311         */
       
   312         IMPORT_C CAiwDialData::TCallType CallType() const;
       
   313         
       
   314         /**
       
   315         * Window group id.
       
   316         *
       
   317         * @since S60 3.2
       
   318         * @return Window group id. 
       
   319         */    
       
   320         IMPORT_C TInt WindowGroup() const;
       
   321         
       
   322         /**
       
   323         * Initiate call.
       
   324         *
       
   325         * @since S60 3.2
       
   326         * @return Returns ETrue if client wants to initialize voice/video 
       
   327         *                 call by using long key press. EFalse otherwise.
       
   328         */
       
   329         IMPORT_C TBool InitiateCall() const;
       
   330         
       
   331         /**
       
   332         * Name.
       
   333         *
       
   334         * @since S60 3.2
       
   335         * @return Returns name.
       
   336         */
       
   337         IMPORT_C const TDesC& Name() const;
       
   338         
       
   339         /**
       
   340         * Redial information.
       
   341         *
       
   342         * @since S60 3.2
       
   343         * @return Return the redial status,
       
   344         */
       
   345         IMPORT_C TInt Redial() const;
       
   346         
       
   347         /**
       
   348         * Show Number.
       
   349         *
       
   350         * @since S60 3.2
       
   351         * @return Returns the number visibility.
       
   352         */
       
   353         IMPORT_C TBool ShowNumber() const;
       
   354         
       
   355        /**
       
   356         * Defines if mathing is allowed.
       
   357         *
       
   358         * @since S60 3.2
       
   359         * @return Returns the allow match setting information.
       
   360         */
       
   361         IMPORT_C TBool AllowMatch() const;
       
   362         
       
   363         /**
       
   364         * Contact link field.
       
   365         *
       
   366         * @since S60 3.2
       
   367         * @return Returns contack link item.
       
   368         */
       
   369         IMPORT_C const TDesC8& ContactLink() const;
       
   370         
       
   371         /**
       
   372         * SAT Call.
       
   373         *
       
   374         * @since S60 3.2
       
   375         * @return Returns ETrue if SAT call EFalse if not.
       
   376         */
       
   377         IMPORT_C TBool SATCall() const;
       
   378         
       
   379         /**
       
   380         * Sub address.
       
   381         *
       
   382         * @since S60 3.2
       
   383         * @return Returns SAT call sub address.
       
   384         */
       
   385         IMPORT_C const TDesC& SubAddress() const;
       
   386         
       
   387         /**
       
   388         * End other calls param.
       
   389         *
       
   390         * @since S60 3.2
       
   391         * @return Returns ETrue if other calls will be terminated.
       
   392         *                  EFalse if calls are not terminated.
       
   393         */
       
   394         IMPORT_C TBool EndOtherCalls() const;
       
   395         
       
   396         /**
       
   397         * Bearer capability.
       
   398         *
       
   399         * @since S60 3.2
       
   400         * @return Returns bearer capability.
       
   401         */
       
   402         IMPORT_C const TDesC8& Bearer() const;
       
   403         
       
   404         /**
       
   405         * Automatic redial maximum duration. 
       
   406         *
       
   407         * @since S60 3.2
       
   408         * @return  value of duration in seconds.
       
   409         */
       
   410         IMPORT_C const TTimeIntervalSeconds RedialMaximumDuration() const;
       
   411         
       
   412         /** 
       
   413         * Read used Service Id.
       
   414         *
       
   415         * @return Return service id.
       
   416         */
       
   417         IMPORT_C TUint32 ServiceId() const;
       
   418 
       
   419         /**
       
   420          * User to user information.
       
   421          * 
       
   422          * @since S60 v3.2
       
   423          * @return User to user information.
       
   424          */
       
   425         IMPORT_C const TDesC& UUI() const;
       
   426 
       
   427     private:
       
   428         
       
   429         TInt CalculatePackageSize() const;
       
   430         
       
   431         TInt CalculateDescriptorSize( const TDesC& aDescriptor ) const;
       
   432         
       
   433         TInt CalculateDescriptorSize( const TDesC8& aDescriptor ) const;
       
   434         
       
   435         void ReadDescriptorFromStreamL( RDesReadStream& aStream, 
       
   436                                         HBufC*& aDescriptor );
       
   437         
       
   438         void ReadDescriptorFromStreamL( RDesReadStream& aStream, 
       
   439                                         HBufC8*& aDescriptor );
       
   440         
       
   441         void WriteDescriptorToStreamL( RDesWriteStream& aStream, 
       
   442                                        const TDesC& aDescriptor );
       
   443         
       
   444         void WriteDescriptorToStreamL( RDesWriteStream& aStream, 
       
   445                                        const TDesC8& aDescriptor );
       
   446         
       
   447         void CopyDescriptorToMemberDescriptorL( const TDesC& aSource, 
       
   448                                        HBufC*& aMemberDescriptor );
       
   449         
       
   450         void CopyDescriptorToMemberDescriptorL( const TDesC8& aSource, 
       
   451                                        HBufC8*& aMemberDescriptor );
       
   452                 
       
   453         /**
       
   454         * Leaves with KErrArgument if aDescriptorLength 
       
   455         * is greated that aMaxAllowedDescriptorLenght
       
   456         */
       
   457         void CheckDescriptorMaxLengthL( TInt aDescriptorLength, 
       
   458             TInt aMaxAllowedDescriptorLength ) const;
       
   459         
       
   460         HBufC8* PackLC();
       
   461         
       
   462     private:
       
   463 
       
   464         /**
       
   465         * C++ default constructor.
       
   466         */
       
   467         CAiwInternalDialData();
       
   468 
       
   469         /**
       
   470         * By default Symbian 2nd phase constructor is private.
       
   471         */
       
   472         void ConstructL();
       
   473         
       
   474         /**
       
   475         * By default Symbian 2nd phase constructor is private.
       
   476         */
       
   477         void ConstructL( const TDesC8& aPackage );
       
   478  
       
   479     private:    // Data
       
   480    
       
   481         HBufC* iPhoneNumber;
       
   482          
       
   483         CAiwDialData::TCallType iCallType;
       
   484         
       
   485         HBufC* iName;
       
   486         
       
   487         TInt iWindowGroup;
       
   488         
       
   489         TInt iRedial;
       
   490         
       
   491         TTimeIntervalSeconds iRedialMaximumDuration;
       
   492         
       
   493         HBufC8* iContactLink;
       
   494         
       
   495         HBufC* iSubAddress;
       
   496        
       
   497         TBool iShowNumber;
       
   498         
       
   499         TBool iAllowMatch;
       
   500         
       
   501         TBool iSATCall;
       
   502         
       
   503         TBool iEndOtherCalls;
       
   504         
       
   505         HBufC8* iBearer;
       
   506         
       
   507         TBool iInitCall;
       
   508         
       
   509         /*
       
   510          * Used service id.
       
   511          */
       
   512         TUint32 iServiceId;                 
       
   513 
       
   514         HBufC* iUUI;
       
   515     };
       
   516 
       
   517 #endif      // CAIWINTERNALDIALDATA_H   
       
   518             
       
   519 // End of File