phoneclientserver/inc/cphcltextphonedialdata.h
branchRCL_3
changeset 20 987c9837762f
parent 19 7d48bed6ce0c
child 21 0a6dd2dc9970
equal deleted inserted replaced
19:7d48bed6ce0c 20:987c9837762f
     1 /*
       
     2 * Copyright (c) 2002-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:  It defines dial data.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPHCLTEXTPHONEDIALDATA_H   
       
    20 #define CPHCLTEXTPHONEDIALDATA_H  
       
    21 
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <s32mem.h>
       
    26 #include <bldvariant.hrh>
       
    27 #include "phclttypes.h" 
       
    28 #include <cphcltdialdata.h> // Phone Client Notify API
       
    29 
       
    30 
       
    31 // Other constants used in TPhCltExtPhoneDialData ( default values )
       
    32 const TBool KPhCltDefaultAllowMatch = ETrue;   // Match is allowed
       
    33 const TBool KPhCltDefaultNumberEntry = EFalse; // No return to number entry.
       
    34 const TInt KPhCltDefaultNumberType = -1;       // No number type.
       
    35 
       
    36 
       
    37 // CONSTANTS
       
    38 //None.
       
    39 
       
    40 
       
    41 // FORWARD DECLARATIONS
       
    42 //None
       
    43 
       
    44 // CLASS DECLARATION
       
    45 /**
       
    46 * It defines the structure containing dial information.
       
    47 *
       
    48 * Fields:
       
    49 *
       
    50 *  window group    - When call is ended, set window group is actived.
       
    51 *
       
    52 *  show number     - Permission to show number. ETrue if it is allowed.
       
    53 *
       
    54 *  redial          - Automatic redial override.
       
    55 *
       
    56 *  name            - Name corresponding to number. Name must be defined
       
    57 *                    if shown number equals to EFalse.
       
    58 *  contact link      - Contact link. you should put always when you are dialing
       
    59 *                    from phonebook contact.
       
    60 *  tel number      - String that is to be dialled.
       
    61 *                    number fields are supported.
       
    62 *  allow match     - Permission to allow match. ETrue if match is to be done.
       
    63 *                    If you are dialing from sim pd or fdn, then this should
       
    64 *                    be EFalse.
       
    65 *  number entry    - Returns whether to return to the number entry on failure 
       
    66 *
       
    67 *  end other calls - Information if the existing calls are ended before
       
    68 *                    this new one is made.
       
    69 *                    Not mandatory. Set only if you know that the call is an 
       
    70 *                    emergency call.
       
    71 *  subaddress      - The calling party subaddress. Supports SAT features.
       
    72 *                    Defined in ITU-T I.330 and 3GPP TS 11.14.
       
    73 *  SATCall         - Set whether this is SAT originated call or not. 
       
    74 *                    Supports SAT features.
       
    75 *  bearer          - Bearer capabilities. Supports SAT features.
       
    76 *
       
    77 *  CallType        - The type of the call, i.e. voice (default) or video.
       
    78 *
       
    79 *  SendKey         - Call made with SendKey, optional.
       
    80 *
       
    81 *  Redial maximum duration - Automatic redial maximum duration
       
    82 *
       
    83 *  Initiate call   - true if iniate call false otherwise 
       
    84 *
       
    85 *  UUI             - User to user information sent on call setup phase.
       
    86 *
       
    87 *  @lib phoneclient.lib
       
    88 *  @since 3.2
       
    89 */
       
    90 /**
       
    91 *  Dial data set for PhoneClient.
       
    92 *
       
    93 *  @lib ServiceHandler.lib
       
    94 *  @since Series 60 3.2
       
    95 */
       
    96 NONSHARABLE_CLASS( CPhCltExtPhoneDialData ): public CPhCltDialData
       
    97     {
       
    98    
       
    99    public:
       
   100       /* 
       
   101         *   TBools combined to one uint.
       
   102         *
       
   103         *   EPhCltCallFlagsDefault
       
   104         *               Default flags, if nothing is not specified.
       
   105         *   EPhCltCallFlagsAllowNumberShowing
       
   106         *               Number showing is allowed.
       
   107         *   EPhCltCallFlagsReturnToNumberEntryOnFailure
       
   108         *               Return to Number Entry if there is an error.
       
   109         *   EPhCltCallFlagsAllowPersonalDirectoryMatching
       
   110         *               The number is matched to Personal Directory.
       
   111         *   EPhCltCallFlagsEndBeforeDial
       
   112         *               Other calls are ended before the new one is done.
       
   113         *   EPhCltCallFlagsSAT
       
   114         *               If set means that SAT has originated the call.
       
   115         *   EPhCltCallFlagsVideoCall
       
   116         *               If set means that this is video call.
       
   117         *               Otherwise means normal, i.e. voice call.
       
   118         *   EPhCltCallFlagsVoIPCall
       
   119         *               If set means that this is VoIP call.
       
   120         *               Otherwise means normal, i.e. voice call.
       
   121         *   EPhCltCallFlagsSendKey
       
   122         *               If set means that call made with SendKey.
       
   123         */
       
   124         enum TPhCltCallFlags
       
   125             {
       
   126             EPhCltCallFlagsDefault                           = 0x0000,
       
   127             EPhCltCallFlagsAllowNumberShowing                = 0x0001,
       
   128             EPhCltCallFlagsReturnToNumberEntryOnFailure      = 0x0002,
       
   129             EPhCltCallFlagsAllowPersonalDirectoryMatching    = 0x0004,
       
   130             EPhCltCallFlagsEndBeforeDial                     = 0x0008,
       
   131             EPhCltCallFlagsSAT                               = 0x0020,
       
   132             EPhCltCallFlagsVideoCall                         = 0x0040,
       
   133             EPhCltCallFlagsVoIPCall                          = 0x0080,
       
   134             EPhCltCallFlagsSendKey                           = 0x0100
       
   135             };
       
   136       
       
   137         /**
       
   138         * Two-phased constructor.
       
   139         */
       
   140         IMPORT_C static CPhCltExtPhoneDialData* NewL();
       
   141         
       
   142         /**
       
   143         * Two-phased constructor.
       
   144         */
       
   145         IMPORT_C static CPhCltExtPhoneDialData* NewLC();
       
   146         
       
   147         
       
   148         /**
       
   149         * Two-phased constructor.
       
   150         */
       
   151         IMPORT_C static CPhCltExtPhoneDialData* NewL( const TDesC8& aPackage );
       
   152         
       
   153         /**
       
   154         * Two-phased constructor.
       
   155         */
       
   156         IMPORT_C static CPhCltExtPhoneDialData* NewLC( const TDesC8& aPackage );
       
   157         
       
   158         /**
       
   159         * Destructor.
       
   160         */
       
   161         IMPORT_C virtual ~CPhCltExtPhoneDialData();
       
   162 
       
   163     public: // New functions
       
   164     
       
   165         /**
       
   166         * Fills the parameter list.
       
   167         * @since Series 60 3.2
       
   168         * @param aInParamList In parameter used with CAiwService.
       
   169         */  
       
   170         IMPORT_C HBufC8* PackLC();
       
   171         
       
   172         
       
   173         // Calculates dialdata package size
       
   174         IMPORT_C TInt CalculatePackageSize() const;
       
   175         
       
   176         // Sets dial data parameters to CPhCltExtPhoneDialData object
       
   177         void SetParamsL( const TDesC8& aPackage ); 
       
   178                
       
   179         
       
   180    public: // Access - Getters
       
   181          
       
   182 
       
   183         /**
       
   184         * Defines if mathing is allowed.
       
   185         * @since Series 60 3.2
       
   186         * @return Returns the allow match setting information.
       
   187         */
       
   188         IMPORT_C  TBool AllowMatch() const;
       
   189         
       
   190         /**
       
   191         * Bearer capability.
       
   192         * @since Series 60 3.2
       
   193         * @return Returns bearer capability.
       
   194         */
       
   195         IMPORT_C const TPhCltBearerCapability& Bearer() const;
       
   196         
       
   197         /**
       
   198         * Gives the current call type.
       
   199         * @since Series 60 3.2
       
   200         * @return Current call type.
       
   201         */
       
   202         IMPORT_C  TPhCltCallType CallType() const ;   
       
   203          
       
   204         /**
       
   205         * Contact link field.
       
   206         * @since Series 60 3.2
       
   207         * @return Returns contack link item.
       
   208         */
       
   209         IMPORT_C const TDesC8& ContactLink() const;
       
   210         
       
   211         
       
   212         /**
       
   213         * End other calls param.
       
   214         * @since Series 60 3.2
       
   215         * @return Returns ETrue if other calls will be terminated.
       
   216         *                 EFalse if calls are not terminated.
       
   217         */
       
   218         IMPORT_C TBool EndOtherCalls() const;
       
   219         
       
   220         /**
       
   221         * Intiate Call
       
   222         * @since Series 60 3.2
       
   223         * @return Returns ETrue if call is itiate call EFalse otherwise
       
   224         */
       
   225         IMPORT_C  TBool InitiateCall() const;
       
   226         
       
   227         /**
       
   228         * Name.
       
   229         * @since Series 60 3.2
       
   230         * @return Returns name.
       
   231         */
       
   232         IMPORT_C  const TPhCltNameBuffer& Name() const;
       
   233         
       
   234         
       
   235         /**
       
   236         * Redial information.
       
   237         * @since Series 60 3.2
       
   238         * @return Return the redial status,
       
   239         */
       
   240         IMPORT_C  TInt Redial() const;  
       
   241         
       
   242         /**
       
   243         * Redial maximum duration
       
   244         * @since Series 60 3.2
       
   245         * @return Returns redial max duration.
       
   246         */
       
   247         IMPORT_C const TTimeIntervalSeconds RedialMaximumDuration() const;      
       
   248                    
       
   249         
       
   250         /** 
       
   251         * Return in failure.
       
   252         * @since Series 60 3.2
       
   253         * @return Returns whether to return to the number entry.
       
   254         */
       
   255         //IMPORT_C TBool ReturnToNumberEntryOnFailure() const;
       
   256         
       
   257         /**
       
   258         * SAT Call.
       
   259         * @since Series 60 3.2
       
   260         * @return Returns ETrue if SAT call EFalse if not.
       
   261         */
       
   262         IMPORT_C  TBool SATCall() const;
       
   263         
       
   264         /** 
       
   265         * SendKey pressed.
       
   266         * @since Series 60 3.2
       
   267         * @return Return ETrue if SendKey used.
       
   268         */
       
   269         IMPORT_C TBool SendKeyPressed() const;
       
   270         
       
   271         /**
       
   272         * Show Number.
       
   273         * @since Series 60 3.2
       
   274         * @return Returns the number visibility.
       
   275         */
       
   276         IMPORT_C TBool ShowNumber() const;
       
   277         
       
   278         /**
       
   279         * Sub address.
       
   280         * @since Series 60 3.2
       
   281         * @return Returns SAT call sub address.
       
   282         */
       
   283         IMPORT_C  const TPhCltSubAddress& SubAddress() const;
       
   284         
       
   285         /**
       
   286         * Gives the current phone number.
       
   287         * @since Series 60 3.2
       
   288         * @return Telephone number.
       
   289         */
       
   290         IMPORT_C  const TPhCltTelephoneNumber& TelephoneNumber() const;
       
   291         
       
   292         /**
       
   293         * Gives the current window group id.
       
   294         * @since Series 60 3.2
       
   295         * @return Window group id. 
       
   296         */     
       
   297         IMPORT_C  TInt WindowGroup() const; 
       
   298         
       
   299         /**
       
   300          * Gives the user to user information.
       
   301          * @since S60 v3.2
       
   302          * @return User to user information.
       
   303          */
       
   304         IMPORT_C const TDesC& UUI() const;
       
   305         
       
   306     public: // Access - Setters
       
   307     
       
   308         /**
       
   309         * Set whether the name entered in SetName should be matched
       
   310         * against the personal directory.
       
   311         * @since Series 60 3.2
       
   312         * This should be set EFalse only if phone number has not been
       
   313         * taken from phonebook.
       
   314         *
       
   315         * @param aAllowMatch Whether to allow matches.
       
   316         */
       
   317         IMPORT_C  void SetAllowMatch( TBool aAllowMatch );
       
   318     
       
   319         /**
       
   320         * Set the bearer capability.
       
   321         * @since Series 60 3.2
       
   322         * @param aBearer The bearer capabilities as defined in GSM 04.08.
       
   323         * @leaves KErrArgument if aBearer's length is longer than KAiwBearerLength
       
   324         */
       
   325         IMPORT_C void SetBearerL( const TPhCltBearerCapability& aBearer );
       
   326         
       
   327         /**
       
   328         * Sets call type.
       
   329         * @since Series 60 3.2
       
   330         * @param aCallType calls' type.
       
   331         */
       
   332         IMPORT_C void SetCallType( TPhCltCallType aCallType );
       
   333         
       
   334         /**
       
   335         * Set contact link.
       
   336         * @since Series 60 3.2
       
   337         * @param aContactLink Contact link information.
       
   338         */
       
   339        IMPORT_C void SetContactLinkL( const TDesC8& aContactLink );
       
   340         
       
   341         
       
   342         /**
       
   343         * Set parameter for end other calls. 
       
   344         * @since Series 60 3.2
       
   345         * If this is set to ETrue, other calls will be terminated before
       
   346         * dial. Default is EFalse.
       
   347         * @param aEndCalls Are the other calls ended.
       
   348         */
       
   349         IMPORT_C void SetEndOtherCalls( TBool aEndCalls  );
       
   350         
       
   351         /**
       
   352         * Set Initiate call Etrue or EFalse
       
   353         *@since Series 60 3.2
       
   354         * @param aInitCall ETrue if call is intiate call
       
   355         */
       
   356         IMPORT_C void SetInitiateCall( TBool aInitCall );
       
   357         
       
   358         
       
   359         /**
       
   360         * Set the name of the person who is to be called.
       
   361         * @since Series 60 3.2
       
   362         * @param aName The name of the person being called.
       
   363         * @leaves KErrArgument if aName length is over 50 characters.
       
   364         */
       
   365         IMPORT_C void SetNameL( const TPhCltNameBuffer& aName );
       
   366         
       
   367         
       
   368         /**
       
   369         * Change the redial mode.
       
   370         * @since Series 60 3.2
       
   371         * @param aRedial The new redial status
       
   372         */
       
   373   
       
   374         IMPORT_C void SetRedial( TInt aRedial );
       
   375         
       
   376         /**
       
   377         * Set redial max duration.
       
   378         * @since Series 60 3.2
       
   379         * @param aDuration redial max duration.
       
   380         */
       
   381         IMPORT_C void SetRedialMaximumDuration( TTimeIntervalSeconds aMaximumRedialDuration );       
       
   382         
       
   383         
       
   384         /**
       
   385         * Set whether to return to number entry.
       
   386         *
       
   387         * @param aReturn Whether to return to the number entry editor.
       
   388         */
       
   389         IMPORT_C void SetReturnToNumberEntryOnFailure( TBool aReturn );
       
   390                 
       
   391         /**
       
   392         * Set wheteher this is a SAT originated call or not.
       
   393         * If this function is not called, the originator is assumed to 
       
   394         * be other than SAT.
       
   395         * @since Series 60 3.2
       
   396         * @param aSATCall ETrue if SAT originated the call, EFalse otherwise.
       
   397         */
       
   398         IMPORT_C void SetSATCall( TBool aSATCall );
       
   399         
       
   400         
       
   401         /**
       
   402         * Set the value of SendKey.
       
   403         *  @since Series 60 3.2
       
   404         * @param aSendKey The value of SendKey.
       
   405         */
       
   406         IMPORT_C void SetSendKeyPressed( TBool aSendKey );
       
   407         
       
   408         /**
       
   409         * Set the number visibility in the phone app.
       
   410         * @since Series 60 3.2
       
   411         * If this is set to EFalse, then number is not shown or written to 
       
   412         * log event.
       
   413         * @param aShowNumber Whether or not to show the number.
       
   414         */
       
   415         IMPORT_C void SetShowNumber( TBool aShowNumber );
       
   416         
       
   417         /**
       
   418         * Set the calling party subaddress.
       
   419         * Defined in ITU-T I.330 and 3GPP TS 11.14.
       
   420         * @since Series 60 3.2
       
   421         * @param aSubAddress The calling party subaddress.
       
   422         * @leaves KErrArgument if aSubAddress length is longer than 
       
   423         * KAiwSubAddressLength
       
   424         */
       
   425         IMPORT_C void SetSubAddressL( const TPhCltSubAddress& aSubAddress );
       
   426         
       
   427         /**
       
   428         * Sets the phone number.
       
   429         * @since Series 60 3.2
       
   430         * @param aNumber Phone number, which maximum length is
       
   431         * KMaximumPhoneNumberLength.
       
   432         * @leaves KErrArgument if aPhoneNumber length is over KMaximumPhoneNumberLength
       
   433         */
       
   434         IMPORT_C void SetTelephoneNumber( const TPhCltTelephoneNumber& aNumber );
       
   435         
       
   436         /**
       
   437         * Sets the window group identifier. When call is ended, set window group is actived.
       
   438         * @since Series 60 3.2
       
   439         * @param aWindowGroup Window group id.
       
   440         */
       
   441         IMPORT_C void SetWindowGroup( TInt aWindowGroup );
       
   442      
       
   443         /**
       
   444         * Set the value of xSP Service Id. 
       
   445         *
       
   446         * @param aServiceId The value of Service Id.
       
   447         */
       
   448         IMPORT_C void SetServiceId( TUint32 aServiceId );
       
   449         
       
   450 
       
   451         /** 
       
   452         * Service Id. VoIP2.2 implementation
       
   453         * @return Return service id or zero.
       
   454         */
       
   455         IMPORT_C TUint32 ServiceId() const; 
       
   456 
       
   457         
       
   458         /**
       
   459          * Sets user to user information. Maximum length is 
       
   460          * KPhCltUUILength.
       
   461          * @param aUUI User to user information.
       
   462          * @since S60 v3.2
       
   463          */
       
   464         IMPORT_C void SetUUIL( const TDesC& aUUI );
       
   465         
       
   466       
       
   467         
       
   468                 
       
   469                       
       
   470     // Constructors
       
   471     
       
   472      private: 
       
   473      
       
   474         /**
       
   475         * C++ default constructor.
       
   476         * @since Series 60 3.2
       
   477         */
       
   478         CPhCltExtPhoneDialData(); 
       
   479 
       
   480         /**
       
   481         * By default Symbian 2nd phase constructor is private.
       
   482         * @since Series 60 3.2
       
   483         */
       
   484         void ConstructL();
       
   485         
       
   486         /**
       
   487         * By default Symbian 2nd phase constructor is private.
       
   488         * @since Series 60 3.2
       
   489         * @param aPackage including dial data
       
   490         */
       
   491         void ConstructL( const TDesC8& aPackage ); 
       
   492         
       
   493      
       
   494      //Private functions
       
   495      
       
   496      private:
       
   497         /**
       
   498         * Calculates variable descriptor size
       
   499         * @since Series 60 3.2
       
   500         * @param aDescriptor which size is calculated
       
   501         */
       
   502         TInt CalculateDescriptorSize( const TDesC& aDescriptor ) const;
       
   503         
       
   504         /**
       
   505         * Calculates variable descriptor size
       
   506         * @since Series 60 3.2
       
   507         * @param aDescriptor which size is calculated
       
   508         */
       
   509         TInt CalculateDescriptorSize( const TDesC8& aDescriptor ) const;
       
   510         
       
   511         /**
       
   512         * Read descriptor value from stream
       
   513         * @since Series 60 3.2
       
   514         * @param aStream used stream
       
   515         * @param aDescriptor which is read from stream
       
   516         */
       
   517         void ReadDescriptorFromStreamL( RDesReadStream& aStream, HBufC8*& aDescriptor );
       
   518         
       
   519         /**
       
   520         * Read descriptor value from stream
       
   521         * @since Series 60 3.2
       
   522         * @param aStream used stream
       
   523         * @param aDescriptor which is read from stream
       
   524         */
       
   525         void ReadDescriptorFromStreamL( RDesReadStream& aStream, HBufC*& aDescriptor );
       
   526         
       
   527         /**
       
   528         * Write descriptor value to stream
       
   529         * @since Series 60 3.2
       
   530         * @param aStream used stream
       
   531         * @param aDescriptor which value is write to stream
       
   532         */
       
   533         void WriteDescriptorToStreamL( RDesWriteStream& aStream, const TDesC8& aDescriptor );
       
   534         
       
   535         /**
       
   536         * Write descriptor value to stream
       
   537         * @since Series 60 3.2
       
   538         * @param aStream used stream
       
   539         * @param aDescriptor which value is write to stream
       
   540         */
       
   541         void WriteDescriptorToStreamL( RDesWriteStream& aStream, const TDesC& aDescriptor );
       
   542         
       
   543      
       
   544         /**
       
   545         * Copy descriptor value to member descriptor
       
   546         * @since Series 60 3.2
       
   547         * @param aSource which is as copy source
       
   548         * @param aMemberDescriptor is as copy destination
       
   549         */
       
   550         void CopyDescriptorToMemberDescriptorL( const TDesC& aSource, HBufC*& aMemberDescriptor );
       
   551         
       
   552         /**
       
   553         * Copy descriptor value to member descriptor
       
   554         * @since Series 60 3.2
       
   555         * @param aSource which is as copy source
       
   556         * @param aMemberDescriptor is as copy destination
       
   557         */
       
   558         void CopyDescriptorToMemberDescriptorL( const TDesC8& aSource, HBufC8*& aMemberDescriptor );        
       
   559      
       
   560         
       
   561         /**
       
   562         * Check descriptor max length
       
   563         * Leaves with KErrArgument if aDescriptorLength is greated that aMaxAllowedDescriptorLenght
       
   564         * @since Series 60 3.2
       
   565         * @param aDescriptorLength is descriptor length
       
   566         * @param  aMaxAllowedDescriptorLength maximum allowed descriptor length
       
   567         */
       
   568         void CheckDescriptorMaxLengthL( TInt aDescriptorLength, TInt aMaxAllowedDescriptorLength ) const;
       
   569         
       
   570 
       
   571     };
       
   572 
       
   573 #endif      // CPHCLTEXTPHONEDIALDATA_H
       
   574             
       
   575 // End of File