»
         Symbian OS v9.3 »
         Symbian OS reference »
         C++ component reference »
         Narrow Band Protocols SMSSTACK »
         CSmsMessage
      
      
      	   
      
      	   
      
         	   
         
         Location: 
            Gsmumsg.h
            
Link against: gsmu.lib
            
         
         
       
      
      
         class CSmsMessage : public CBase;
         Description
         
         Represents a complete SMS message.
         
         This class can:
         
         Internalise and externalise its data
         
         Encode/decode itself to/from one or more SMS PDU's
         
         SMS Message Data is stored in the CSmsBufferBase iBuffer. SMS Message Settings are stored in the CSmsPDU iSmsPDU. 
         
         
         Derivation
         
         
         
            CBase - Base class for all classes to be instantiated on the heap
             
         
         
            CSmsMessage - Represents a complete SMS message
             
         
         Members
         
         Defined in CSmsMessage:
            
AddEMSInformationElementL(), AddEmailHeaderL(), AddSlotL(), AdditionalInfo(), Buffer(), Buffer(), CopyEmsElementsL(), DecodeMessagePDUsL(), E15MinutesRepresentedInSeconds, EMaximumSeconds, ESmsCombinedStorage, ESmsFlagOptimizeAlphabet, ESmsFlagOptimizeConcatenation, ESmsFlagOptimizeConcatenation16BitReference, ESmsMessageV0, ESmsMessageV1, ESmsMessageV2, ESmsNoStorage, ESmsPhoneStorage, ESmsSIMStorage, EncodeIntoSinglePDUL(), EncodeMessagePDUsL(), ExternalizeL(), ExternalizeWithoutBufferL(), GetEMSInformationElementsL(), GetEmailHeaderL(), GetOperationsForNonIEL(), InternalizeL(), InternalizeWithoutBufferL(), Is16BitConcatenation(), IsComplete(), IsDecoded(), IsEmailHeader(), IsSupportedL(), LogServerId(), MatchSlots(), MaxMessageLength(), MessageLengthL(), NewL(), NewL(), NumMessagePDUsL(), OptimizeSettingsL(), ParsedServiceCenterAddress(), ParsedToFromAddress(), RemoveEMSInformationElementL(), RemoveEMSInformationElementsL(), ResetEMSL(), Scheme(), ServiceCenterAddress(), Set16BitConcatenation(), SetLogServerId(), SetParsedServiceCenterAddressL(), SetParsedToFromAddressL(), SetServiceCenterAddressL(), SetStatus(), SetStorage(), SetTime(), SetToFromAddressL(), SetUserDataSettingsL(), SmsPDU(), SmsPDU(), Status(), Storage(), TMobileSmsStorage, TSmsMessageVersion, TSmsOptimizationFlags, TTimeIntervalsRepresentedInSeconds, TextPresent(), Time(), ToFromAddress(), Type(), UpdateSlotsL(), UserDataSettings(), Version(), iAdditionalInfo, iSlotArray, iVersion, ~CSmsMessage()
            
         
         
         Inherited from CBase:
            
Delete(),
            Extension_(),
            operator new()
         
         
       
      
         
         
         
         Construction and destruction
         
      
      
      
      
         
         static IMPORT_C CSmsMessage *NewL(RFs &aFs, const TGsmSms &aGsmSms, CSmsBufferBase *aBuffer, TBool aIsRPError=EFalse, TBool
               aIsMobileTerminated=ETrue);
         Description
         
         Allocates and creates a CSmsMessage instance from a TGsmSms.
         
         
         The type of SMS-XXXX message to construct is defined by the first byte of the TGsmSms TPDU header.
         
         
         Parameters
         
         
            
               
                  
                     
                        
                              RFs &aFs | 
                        
                            Reference handle to the file system  
                         | 
                      
                     
                        const TGsmSms &aGsmSms | 
                        
                            Reference to TGsmSms
                              
                            
                         | 
                      
                     
                        
                              CSmsBufferBase *aBuffer | 
                        
                            The Unicode text for the message. The object takes ownership of aBuffer.  
                         | 
                      
                     
                        
                              TBool aIsRPError | 
                        
                            Set to true if the message contains Reply Path Error. Default is false.  
                         | 
                      
                     
                        
                              TBool aIsMobileTerminated | 
                        
                            Set to True if the message is Mobile Terminated. Default is false.  
                         | 
                      
                   
                | 
            
         
         
         Return value
         
         
          
      
      
         
         static IMPORT_C CSmsMessage *NewL(RFs &aFs, CSmsPDU::TSmsPDUType aType, CSmsBufferBase *aBuffer, TBool aIsRPError=EFalse);
         Description
         
         Allocates and creates a CSmsMessage, specifying the SMS-XXX message type with a CSmsPDU::TSmsPduType.
         
         Parameters
         
         
            
               
                  
                     
                        
                              RFs &aFs | 
                        
                            Reference handle to the file system  
                         | 
                      
                     
                        
                              CSmsPDU::TSmsPDUType aType | 
                        
                            The PDU type  
                         | 
                      
                     
                        
                              CSmsBufferBase *aBuffer | 
                        
                            The Unicode text for the message. The object takes ownership of aBuffer.  
                         | 
                      
                     
                        
                              TBool aIsRPError | 
                        
                            Set to true if the message contains Reply Path Error. Default is false.  
                         | 
                      
                   
                | 
            
         
         
         Return value
         
         
          
      
      
         
         IMPORT_C ~CSmsMessage();
         Description
         
         Destructor, frees resources. 
         
         
       
      
      
      
      
         inline CSmsPDU::TSmsPDUType Type() const;
         Description
         
         Gets the SMS-XXX message type.
         
         Return value
         
         
          
      
      
         inline TBool IsComplete() const;
         Description
         
         Tests if the SMS message is complete.
         
         Return value
         
         
          
      
      
         inline TBool IsDecoded() const;
         Description
         
         Tests if the SMS message is Decoded.
         
         Return value
         
         
          
      
      
         inline TMobileSmsStorage Storage() const;
         Description
         
         Gets the physical location where the message represented by the object is stored.
         
         Return value
         
         
          
      
      
         inline void SetStorage(TMobileSmsStorage aStorage);
         Description
         
         Sets the physical location where the message represented by the object is stored.
         
         Parameters
         
         
          
      
      
         inline NMobileSmsStore::TMobileSmsStoreStatus Status() const;
         Description
         
         Gets the SMS store status of the message.
         
         Return value
         
         
          
      
      
         inline void SetStatus(NMobileSmsStore::TMobileSmsStoreStatus aStatus);
         Description
         
         Sets the SMS store status of the message.
         
         Parameters
         
         
          
      
      
         inline TInt LogServerId() const;
         Description
         
         Gets the Log Server Id.
         
         Return value
         
         
          
      
      
         inline void SetLogServerId(TInt aId);
         Description
         
         Sets the Log Server Id.
         
         Parameters
         
         
          
      
      
         inline const TTime &Time() const;
         Description
         
         Gets the time of message creation.
         
         Return value
         
         
          
      
      
         inline void SetTime(const TTime &aTime);
         Description
         
         Sets the time of message creation.
         
         Parameters
         
         
          
      
      
         inline CSmsPDU &SmsPDU();
         Description
         
         Gets the message PDU.
         
         Return value
         
         
          
      
      
         inline const CSmsPDU &SmsPDU() const;
         Description
         
         Gets the message PDU (const).
         
         Return value
         
         
          
      
      
         inline TPtrC ServiceCenterAddress() const;
         Description
         
         Gets the message Service Center Address.
         
         Return value
         
         
            
               
                  
                     
                        
                              TPtrC
                               | 
                        
                            Service Center Address  
                         | 
                      
                   
                | 
            
         
          
      
         
         
         
         
         SetServiceCenterAddressL()
         
       
      
         inline void SetServiceCenterAddressL(const TDesC &aAddress);
         Description
         
         Sets the message Service Center Address.
         
         Parameters
         
         
            
               
                  
                     
                        const TDesC &aAddress | 
                        
                            Service Center Address  
                         | 
                      
                   
                | 
            
         
          
      
         
         
         
         
         ParsedServiceCenterAddress()
         
       
      
         inline void ParsedServiceCenterAddress(TGsmSmsTelNumber &aParsedAddress) const;
         Description
         
         Gets the Service Center Address as an ETSI-formatted telephone number.
         
         Parameters
         
         
          
      
         
         
         
         
         SetParsedServiceCenterAddressL()
         
       
      
         inline void SetParsedServiceCenterAddressL(const TGsmSmsTelNumber &aParsedAddress);
         Description
         
         Sets the Service Center Address as an ETSI-formatted telephone number.
         
         Parameters
         
         
          
      
      
         inline TPtrC ToFromAddress() const;
         Description
         
         Gets unparsed To and From addresses.
         
         Return value
         
         
            
               
                  
                     
                        
                              TPtrC
                               | 
                        
                            To and From addresses  
                         | 
                      
                   
                | 
            
         
          
      
      
         inline void SetToFromAddressL(const TDesC &aAddress);
         Description
         
         Sets unparsed To and From addresses.
         
         Parameters
         
         
            
               
                  
                     
                        const TDesC &aAddress | 
                        
                            To and From addresses  
                         | 
                      
                   
                | 
            
         
          
      
      
         inline void ParsedToFromAddress(TGsmSmsTelNumber &aParsedAddress) const;
         Description
         
         Gets To and From addresses in ETSI format.
         
         Parameters
         
         
          
      
         
         
         
         
         SetParsedToFromAddressL()
         
       
      
         inline void SetParsedToFromAddressL(const TGsmSmsTelNumber &aParsedAddress);
         Description
         
         Sets To and From addresses in ETSI format.
         
         Parameters
         
         
          
      
         
         
         
         
         InternalizeWithoutBufferL()
         
       
      
         
         IMPORT_C void InternalizeWithoutBufferL(RReadStream &aStream);
         Description
         
         Internalises all object data except for the CSmsBufferBase.
         
         
         This is used when the buffer is stored elsewhere.
         
         Parameters
         
         
          
      
         
         
         
         
         ExternalizeWithoutBufferL()
         
       
      
         
         IMPORT_C void ExternalizeWithoutBufferL(RWriteStream &aStream) const;
         Description
         
         Externalises all object data except for the CSmsBufferBase.
         
         
         This is used when the buffer is stored elsewhere.
         
         Parameters
         
         
          
      
      
         
         IMPORT_C void InternalizeL(RReadStream &aStream);
         Description
         
         Internalises all object data.
         
         Parameters
         
         
          
      
      
         
         IMPORT_C void ExternalizeL(RWriteStream &aStream) const;
         Description
         
         Externalises all object data.
         
         Parameters
         
         
          
      
      
         inline CSmsBufferBase &Buffer();
         Description
         
         Gets the text portion of the message (non-const).
         
         Return value
         
         
          
      
      
         inline const CSmsBufferBase &Buffer() const;
         Description
         
         
         
         Return value
         
         
          
      
      
         
         IMPORT_C TBool TextPresent() const;
         Description
         
         Tests if the message contains text.
         
         Return value
         
         
            
               
                  
                     
                        TBool
                               | 
                        
                            True if the message contains text  
                         | 
                      
                   
                | 
            
         
          
      
      
         
         IMPORT_C TInt NumMessagePDUsL();
         Description
         
         Gets the number of PDU's required to encode the complete message.
         
         Return value
         
         
         
         Leave codes
         
         
            
               
                  
                     
                        KErrOverflow | 
                        
                            Leaves if the number of required PDUs exceeds the maximum or the message cannot be encoded. 
                         | 
                      
                   
                | 
            
         
          
      
      
         
         IMPORT_C TInt MaxMessageLength() const;
         Description
         
         Gets the maximum message length possible with the current settings.
         
         If Text is compressed, this returns the maximum number of bytes available with text compressed.
         
         Return value
         
         
            
               
                  
                     
                        TInt
                               | 
                        
                            Maximum message length  
                         | 
                      
                   
                | 
            
         
          
      
      
         
         IMPORT_C TInt MessageLengthL();
         Description
         
         Gets the message length.
         
         In the case where the message is compressed, this function compresses the text and returns the number of bytes of the compressed
            buffer.
         
         
         The function calls ConvertedBufferLengthL(), and is therefore an expensive operation.
         
         
         Return value
         
         
          
      
      
         
         IMPORT_C void UserDataSettings(TSmsUserDataSettings &aSettings) const;
         Description
         
         Gets the User Data Settings.
         
         
         Parameters
         
         
          
      
      
         
         IMPORT_C void SetUserDataSettingsL(const TSmsUserDataSettings &aSettings);
         Description
         
         Sets the User Data Settings.
         
         
         Parameters
         
         
          
      
      
         
         IMPORT_C void OptimizeSettingsL(TInt aOptions);
         Description
         
         Optimizes the user data settings.
         
         The alphabet flag causes an alphabet to be chosen which preserves information in the message and makes the number of PDUs
            as small as possible.
         
         
         The compression settings flag is not supported.
         
         The compression flag causes compression to be switched on if the resultant number of PDUs is smaller.
         
         If user explicitly defines alphabet as UCS2 or 8-bit coding, this setting is preserved; otherwise, if 7-bit (default) alphabet
            can not support current text of message UCS2 alphabet (Unicode) is used.
         
         
         The two concatenation flags are mutually exclusive as they deal with 8-bit and 16-bit referenced concatenation. Both flags
            cause compression to be switched off and if the message length is greater than the maximum message length, concatenation is
            switched on.
         
         
         Parameters
         
         
            
               
                  
                     
                        
                              TInt aOptions | 
                        
                            Combination of TSmsOptimizationFlags  
                         | 
                      
                   
                | 
            
         
          
      
      
         
         IMPORT_C TBool IsSupportedL(const TDesC &aDes, TInt &aNumberOfUnconvertibleCharacters, TInt &aIndexOfFirstUnconvertibleCharacter);
         Description
         
         Tests if a buffer can be encoded without loss of information.
         
         Parameters
         
         
            
               
                  
                     
                        const TDesC &aDes | 
                        
                            The buffer to test for encoding  
                         | 
                      
                     
                        
                              TInt &aNumberOfUnconvertibleCharacters | 
                        
                            On return, the number of unconvertible characters  
                         | 
                      
                     
                        
                              TInt &aIndexOfFirstUnconvertibleCharacter | 
                        
                            On return, the index of the first unconvertible character  
                         | 
                      
                   
                | 
            
         
         
         Return value
         
         
            
               
                  
                     
                        TBool
                               | 
                        
                            True if aDes can be encoded without loss of information  
                         | 
                      
                   
                | 
            
         
          
      
      
         
         IMPORT_C void EncodeMessagePDUsL(CArrayFix< TGsmSms > &aSmsArray, TInt aReference=0);
         Description
         
         Encodes message PDUs as an array of TGsmSms objects.
         
         
         Note, this function should only be called after EncodeIntoSinglePDUL() as EncodeBufferL() now automatically prepares PDUs for concatenation.
         
         
         Parameters
         
         
            
               
                  
                     
                        
                              CArrayFix< TGsmSms > &aSmsArray | 
                        
                            (In) an empty array. On return, one or more encoded TGsmSms. 
                            
                         | 
                      
                     
                        
                              TInt aReference | 
                        
                            Sets a Concatenated Message Reference (default 0)  
                         | 
                      
                   
                | 
            
         
          
      
      
         
         IMPORT_C void DecodeMessagePDUsL(const CArrayFix< TGsmSms > &aSmsArray);
         Description
         
         Decodes message PDUs from an array of TGsmSms objects.
         
         
         The array contains a concatenated message, and must have the correct number of PDUs.
         
         Parameters
         
         
          
      
         
         
         
         
         GetEMSInformationElementsL()
         
       
      
         
         IMPORT_C const RPointerArray< const CEmsInformationElement > &GetEMSInformationElementsL() const;
         Description
         
         Removes EMS IE from a CSmsMessage
         
         Return value
         
         
            
               
                  
                     
                        const RPointerArray< const CEmsInformationElement > & | 
                        
                            CArrayPtrFlat<const CEmsInformationElement>& of internal EMS array 
                         | 
                      
                   
                | 
            
         
          
      
         
         
         
         
         AddEMSInformationElementL()
         
       
      
         
         IMPORT_C void AddEMSInformationElementL(const CEmsInformationElement &aEmsIE);
         Description
         
         Adds EMS IE to a CSmsMessage
         
         Parameters
         
         
            
               
                  
                     
                        const CEmsInformationElement &aEmsIE | 
                        
                            EMS object to be added. 
                         | 
                      
                   
                | 
            
         
          
      
         
         
         
         
         RemoveEMSInformationElementsL()
         
       
      
         
         IMPORT_C RPointerArray< CEmsInformationElement > *RemoveEMSInformationElementsL(const TUint aStartPosition, const TSmsId aEmsId);
         Description
         
         Removes all EMS IEs that matches the criteria from the CSmsMessage
         
         Parameters
         
         
            
               
                  
                     
                        const TUint aStartPosition | 
                        
                            of a EMS object to be removed.  
                         | 
                      
                     
                        const TSmsId aEmsId | 
                        
                            type of a EMS object to be removed  
                         | 
                      
                   
                | 
            
         
         
         Return value
         
         
            
               
                  
                     
                        RPointerArray< CEmsInformationElement > * | 
                        
                            pointer to array of EMS IE 
                         | 
                      
                   
                | 
            
         
          
      
         
         
         
         
         RemoveEMSInformationElementL()
         
       
      
         
         IMPORT_C CEmsInformationElement *RemoveEMSInformationElementL(const TUint aStartPosition, const TSmsId aEmsId);
         Description
         
         
            Removes first EMS IE that matches the criteria from the CSmsMessage
         
         
         Parameters
         
         
            
               
                  
                     
                        const TUint aStartPosition | 
                        
                            of a EMS object to be removed.  
                         | 
                      
                     
                        const TSmsId aEmsId | 
                        
                            type of a EMS object to be removed  
                         | 
                      
                   
                | 
            
         
         
         Return value
         
         
            
               
                  
                     
                        CEmsInformationElement * | 
                        
                            pointer EMS information element  
                         | 
                      
                   
                | 
            
         
          
      
      
         
         IMPORT_C void ResetEMSL();
         Description
         
         Resets EMS IE from a CSmsMessage
          
      
      
         
         IMPORT_C TBool EncodeIntoSinglePDUL(CArrayFix< TGsmSms > &aSmsArray);
         Description
         
         
         
         Parameters
         
         
         
         Return value
         
         
          
      
      
         
         IMPORT_C void CopyEmsElementsL(CSmsMessage &aToMessage) const;
         Description
         
         Copy EMS elements to dest CSmsMessage Uses CSmsMessage extended EMS API Creates new CEmsInformationElement instance(s) and passes ownership to the dest CSmsMessage
         
         
         Parameters
         
         
          
      
      
         
         IMPORT_C void AddSlotL(const TGsmSmsSlotEntry &aSlot);
         Description
         
         
         
         Parameters
         
         
            
               
                  
                     
                        const TGsmSmsSlotEntry &aSlot | 
                        
                           
                         | 
                      
                   
                | 
            
         
          
      
      
         
         IMPORT_C TBool MatchSlots(const CArrayFixFlat< TGsmSmsSlotEntry > &aSlotArray);
         Description
         
         
         
         Parameters
         
         
         
         Return value
         
         
          
      
      
         
         IMPORT_C void AddEmailHeaderL(const TDesC &aEmailHeader, const TDesC &aEmailBody);
         Description
         
         Adds a header to an email body
         
         Parameters
         
         
            
               
                  
                     
                        const TDesC &aEmailHeader | 
                        
                            The buffer which holds RFC 822 e-mail header  
                         | 
                      
                     
                        const TDesC &aEmailBody | 
                        
                           
                         | 
                      
                   
                | 
            
         
          
      
      
         
         IMPORT_C TBool IsEmailHeader() const;
         Description
         
         Checks whether the SmsMessage contains an e-mail.
         
         Return value
         
         
            
               
                  
                     
                        TBool
                               | 
                        
                            ETrue if CSmsMessage contains e-mail ( e-mail header information element), otherwise EFalse  
                         | 
                      
                   
                | 
            
         
          
      
      
         
         IMPORT_C TBool GetEmailHeaderL(HBufC **aEmailHeader, HBufC **aEmailBody);
         Description
         
         Extracts e-mail header and body from the SmsMessage
         
         Parameters
         
         
         
         Return value
         
         
            
               
                  
                     
                        TBool
                               | 
                        
                            aEMailHeader The buffer containing the extracted email header aEMailBody The buffer containing the extracted email body ETrue
                              if extraction of e-mail header and body succeeds 
                            
                         | 
                      
                   
                | 
            
         
          
      
      
         inline void Set16BitConcatenation(TBool aIs16BitConcatenation);
         Description
         
         
         
         Parameters
         
         
            
               
                  
                     
                        
                              TBool aIs16BitConcatenation | 
                        
                           
                         | 
                      
                   
                | 
            
         
          
      
      
         inline TBool Is16BitConcatenation() const;
         Description
         
         
         
         Return value
         
         
          
      
      
         
         IMPORT_C void UpdateSlotsL(TDesC8 &aBuf);
         Description
         
         Updates the slot information for the given message as described in the supplied buffer
         
         Parameters
         
         
            
               
                  
                     
                        
                              TDesC8 &aBuf | 
                        
                            buffer, layout: byte 0 store id, byte 1..n PDU slot indexes  
                         | 
                      
                   
                | 
            
         
         
         Leave codes
         
         
          
      
      
         IMPORT_C TInt Version();
         Description
         
         Returns the message version number. 
         
         Return value
         
         
          
      
      
         inline void *AdditionalInfo();
         Description
         
         
          
      
      
         IMPORT_C CSmsNonIEOperation &GetOperationsForNonIEL(TSmsNonIEIdentifier) const;
         Description
         
         
         
         Parameters
         
         
         
         Return value
         
         
          
      
      
         IMPORT_C TSmsStatusReportScheme Scheme() const;
         Description
         
         Gets the scheme of the status report.
         
         Return value
         
         
            
               
                  
                     
                        TSmsStatusReportScheme
                               | 
                        
                            Staus Report Scheme  
                         | 
                      
                   
                | 
            
         
         
         
       
      
      
      
         
         
         
         
         Enum TSmsOptimizationFlags
         
       
      
         TSmsOptimizationFlags
         Description
         
         
            User data optimisation flags. 
         
         
         
            
               
                  
                     
                        ESmsFlagOptimizeAlphabet | 
                        
                            The alphabet flag causes an alphabet to be chosen which preserves information in the message and makes the number of PDUs
                              as small as possible. 
                            
                         | 
                      
                     
                        ESmsFlagOptimizeConcatenation | 
                        
                            8-bit referenced concatenation. 
                           This causes compression to be switched off and if the message length is greater than the maximum message length, concatenation
                              is switched on. 
                            
                         | 
                      
                     
                        ESmsFlagOptimizeConcatenation16BitReference | 
                        
                            16-bit referenced concatenation. 
                           This causes compression to be switched off and if the message length is greater than the maximum message length, concatenation
                              is switched on. 
                            
                         | 
                      
                   
                | 
            
         
          
      
      
         TMobileSmsStorage
         Description
         
         Flags that indicate whether a message is stored. 
         
         
          
      
         
         
         
         
         Enum TTimeIntervalsRepresentedInSeconds
         
       
      
         TTimeIntervalsRepresentedInSeconds
         Description
         
         
         
         
          
      
      
         TSmsMessageVersion
         Description
         
         SMS versions 
         
         
         
         
       
      
      
      
      
         CArrayFixFlat< TGsmSmsSlotEntry > iSlotArray;
         Description
         
         Array for slots. 
          
      
      
         protected: TInt iVersion;
         Description
         
         iVersion is the version of CSmsMessage. This parameter will be used to identify what iAdditionalInfo points to for that particular
            version of CSmsMessage 
         
          
      
      
         protected: void * iAdditionalInfo;
         Description
         
         iAdditionalInfo would point to any new added data structure. iVersion would identify which data structure is valid for that
            particular version of CSmsMessage