sipplugins/sippsipsettingsui/inc/sipsettingsmodel.h
author Petteri Saari <petteri.saari@digia.com>
Thu, 25 Nov 2010 13:59:42 +0200
branchMSRP_FrameWork
changeset 58 cdb720e67852
parent 15 8248b03a2669
permissions -rw-r--r--
This release addresses the following issues: 1. The crash bug fix when receiving file 2. Now the sending is based on MSRP messages, there is no longer file receiving or sending. Client sends data as MSRP was designed. 3. Soma MSRP stack was created so that the client told the correct session-id, Symbian stack generated it by itself. This is not allowed, it was changed so that clients tell the session-id (same as used in SIP INVITE). 4. Unnecessary division of data to chunks removed when there is no need to interrupt sending. The message is sent in as few chunks as possible. 5. Stack can now receive files and chunks with ?unlimited? size. Old stack wrote the incoming data to memory and did not utilize disk space until the end of chunk was reached (large chunks from another client crashed it). 6. Now when writing the incoming data to file, it will take into account the byte-range header values. So, this complies with the RFC4975 requirements that stack must be able to handle chunks that come in any sequence. 7. Some buffering changes to outgoing/incoming data. 8. The outgoing data is now checked that it does not contain the created transaction-id before sending the data. 9. MSRP success reports are now implemented and tested against servers. 10. Progress report system fixed so progress is now visible on client (all the way to 100%). 11. Message Cancel receiving / Cancel sending now corrected and made to work as rfc4975 requires. (termination from sender and error code from receiver when cancelling). 12. Bug correction related to messages received not belonging to any session, old stack implementation did send error response, but after response was written it did give the buffer to client anyway. Now corrected.

/*
* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  The model of SIP Settings view
*
*/


#ifndef SIP_SETTINGS_MODEL_H
#define SIP_SETTINGS_MODEL_H

//  INCLUDES

#include <e32base.h>
#include <bamdesca.h>       // MDesCArray
#include <AknUtils.h>       // KMaxColumnDataLength
#include "tsipsettingsdata.h"

// FORWARD DECLARATIONS

class CGSSIPModel;
class MGSSIPProfileHandler;
class CGSSIPModel;

// CLASS DECLARATION

/**
*  CSIPSettingsModel model class
*  @since 3.1
*  model class for SIP Settings view
*/
class CSIPSettingsModel 
    : public CBase,
      public MDesCArray
    {
    public:  // Constructors and destructor
        
        /**
        * Two-phased constructor.
        * (@param aHandler Pointer to profile manipulator)
        */
        static CSIPSettingsModel* NewL( MGSSIPProfileHandler* aHandler );
        
        /**
        * Destructor.
        */
        virtual ~CSIPSettingsModel();

    public: // New functions

        /**
        * Returns the index of the default profile
        * @return The index of the default profile
        */
        TInt DefaultProfileIndex();

        /**
        * Sets new default profile
        * @param aIndex The index of the (new) default profile
        */
        void SetDefaultProfileL( TInt aIndex );

        /**
        * Returns the array containing the profile names.
        * NOTE! The ownership of the array is on the caller
        * @return Array consisting of the names of the profiles
        */
        CDesCArray* ListOfProfileNamesL();
        
        /**
        * Returns the name of a profile
        * NOTE! The returning buffers ownership changes to the caller
        * @param aIndex Index to the queried profile        
        * @return Buffer containing the name of the queried profile
        */
        HBufC* ProfileNameLC( TInt aIndex );

        /**
        * Returns the number of profiles
        * @return Number of profiles
        */
        TInt NumOfProfiles();

        /**
        * Creates a new profile and prepares it for editing
        * @param aIndex Index to the profile that is used as a basis
        */
        void CreateNewProfileL( TInt aIndex );

        /**
        * Marks a profile for editing it
        * @param aIndex Index to the edited profile
        * @return Ok to move to next view?
        */
        TBool EditProfileL( TInt aIndex );

        /**
        * Deletes a profile
        * @param aIndex Index to the deleted profile
        */
        void DeleteProfileL( TInt aIndex );

        /**
        * Checks if profile can be deleted.
        * @param aIndex Index to the deleted profile
        * @param aIsUse ETrue if profile is in use
        * @param aDefault ETrue if profile is default profile 
        * @param aLocked ETrue if profile is locked 
        */
        void CheckProfileForDeleteL( 
            TInt aIndex, TBool& aIsUse, TBool& aDefault, TBool& aLocked );
        
    protected:  // Functions from base classes
        
        /**
        * From MDesC16Array returns the number of the elements
        */	
        TInt MdcaCount() const;
	
        /**
        * From MDesC16Array Returns a list item
        */
        TPtrC16 MdcaPoint(TInt aIndex) const;
        
    private:

        /**
        * C++ default constructor.
        * @param aHandler Pointer to profile manipulator
        */
        CSIPSettingsModel( MGSSIPProfileHandler* aHandler );

        /**
        * By default Symbian 2nd phase constructor is private.
        */
        void ConstructL();

    private:    // Data
    
        // The buffer that is returned on MdcaPoint() call
        //mutable TBuf<KMaxColumnDataLength> iBuf;   
        mutable TBuf<KMaxSIPProviderNameLength*3> iBuf;
        
        // Pointer to profile handler
        MGSSIPProfileHandler* iHandler;

        // "Registered"/"Not registered"/"Error in registration" texts
        HBufC* iRegisteredTxt;
        HBufC* iNotRegisteredTxt;
        HBufC* iErrorInReg;                
    };

#endif      // SIP_SETTINGS_MODEL_H   
            
// End of File