williamr@2: /*
williamr@2: * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
williamr@2: * All rights reserved.
williamr@2: * This component and the accompanying materials are made available
williamr@4: * under the terms of "Eclipse Public License v1.0"
williamr@2: * which accompanies this distribution, and is available
williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2: *
williamr@2: * Initial Contributors:
williamr@2: * Nokia Corporation - initial contribution.
williamr@2: *
williamr@2: * Contributors:
williamr@2: *
williamr@2: * Description:  Data class for trigger information
williamr@2: *
williamr@2: */
williamr@2: 
williamr@2: 
williamr@2: #ifndef LBTTRIGGERINFO_H
williamr@2: #define LBTTRIGGERINFO_H
williamr@2: 
williamr@2: #include <e32base.h>
williamr@2: #include <lbtcommon.h>
williamr@2: #include <s32strm.h>
williamr@2: 
williamr@2: class CLbtTriggerEntry;
williamr@2: struct TLbtTriggerDynamicInfo;
williamr@2: 
williamr@2: 
williamr@2: /**
williamr@2:  * Data class for trigger information. The trigger information contains trigger 
williamr@2:  * entry and trigger dynamic information.
williamr@2:  *
williamr@2:  * @lib lbt.lib
williamr@2:  *
williamr@2:  * @since S60 5.1
williamr@2:  */
williamr@2: class CLbtTriggerInfo : public CBase
williamr@2:     {
williamr@2: public:
williamr@2:     /**
williamr@2:      * Constructs a new instance of trigger information object.
williamr@2:      *
williamr@2:      * @return The new instance of trigger information object.
williamr@2:      */
williamr@2:     IMPORT_C static CLbtTriggerInfo* NewL();
williamr@2: 
williamr@2:     /**
williamr@2:      * Constructs a new instance of trigger information object
williamr@2:      * and pushes it onto cleanup stack.
williamr@2:      *
williamr@2:      * @return The new instance of trigger information object.
williamr@2:      */
williamr@2:     IMPORT_C static CLbtTriggerInfo* NewLC();
williamr@2: 
williamr@2:     /**
williamr@2:      * Constructs a new instance of trigger information object.
williamr@2:      *
williamr@2:      * @param[in] aEntry The pointer to the trigger entry. 
williamr@2:      * Ownership is transferred to this object.
williamr@2:      * @param[in] aDynInfo The pointer to the trigger dynamic 
williamr@2:      * information object. Ownership is transferred to this object.
williamr@2:      * @return The new instance of trigger information object.
williamr@2:      */
williamr@2:     IMPORT_C static CLbtTriggerInfo* NewL( 
williamr@2:         CLbtTriggerEntry* aEntry,
williamr@2:         TLbtTriggerDynamicInfo* aDynInfo );
williamr@2: 
williamr@2:     /**
williamr@2:      * Destructor
williamr@2:      */
williamr@2:     IMPORT_C virtual ~CLbtTriggerInfo();
williamr@2: 
williamr@2:     /**
williamr@2:      * Gets trigger entry object.
williamr@2:      *
williamr@2:      * @return Pointer to the trigger entry object. Ownership is
williamr@2:      * not transferred to the client.
williamr@2:      */
williamr@2:     IMPORT_C CLbtTriggerEntry* TriggerEntry();
williamr@2: 
williamr@2:     /**
williamr@2:      * Sets trigger entry.
williamr@2:      *
williamr@2:      * @param[in] aEntry The trigger entry object. Ownership is 
williamr@2:      * transferred to this object.
williamr@2:      */
williamr@2:     IMPORT_C void SetTriggerEntry( CLbtTriggerEntry* aEntry );
williamr@2: 
williamr@2:     /**
williamr@2:      * Gets trigger dynamic information object.
williamr@2:      *
williamr@2:      * @return Pointer to the trigger dynamic information object.
williamr@2:      * Ownership is not transferred to the client.
williamr@2:      */
williamr@2:     IMPORT_C TLbtTriggerDynamicInfo* DynInfo();
williamr@2: 
williamr@2:     /**
williamr@2:      * Sets trigger dynamic information object.
williamr@2:      *
williamr@2:      * @param[in] aDynInfo Pointer to the trigger dynamic 
williamr@2:      * information object. Ownership is transferred to this object.
williamr@2:      */
williamr@2:     IMPORT_C void SetDynInfo( TLbtTriggerDynamicInfo* aDynInfo );
williamr@2:     
williamr@2:     
williamr@2: 	/**
williamr@2:      * Internalizes the trigger object's details and attributes 
williamr@2:      * from stream.
williamr@2:      *
williamr@2:      * The presence of this function means that the standard template 
williamr@2:      * operator>>() ( defined in s32strm.h ) is available to internalize objects 
williamr@2:      * of this class.
williamr@2:      *
williamr@2:      * @param[in] aStream Stream from which the object should be internalized.
williamr@2:      */
williamr@2:     IMPORT_C void InternalizeL( RReadStream& aStream );
williamr@2:     
williamr@2:     /**
williamr@2:      * Externalizes the trigger object's details and attributes
williamr@2:      * to stream.
williamr@2:      *
williamr@2:      * The presence of this function means that the standard template 
williamr@2:      * operator<<() ( defined in s32strm.h ) is available to externalize objects 
williamr@2:      * of this class.
williamr@2:      *
williamr@2:      * @param[in] aStream Stream to which the object should be externalized.
williamr@2:      */
williamr@2:     IMPORT_C void ExternalizeL( RWriteStream& aStream ) const;
williamr@2: 
williamr@2: protected:
williamr@2:     /**
williamr@2:      * Default constructor.
williamr@2:      */
williamr@2:     CLbtTriggerInfo();
williamr@2: 
williamr@2: private:    
williamr@2:     /**
williamr@2:      * Symbian 2nd phase constructor.
williamr@2:      */
williamr@2:     void ConstructL(CLbtTriggerEntry* aEntry,
williamr@2:         TLbtTriggerDynamicInfo* aDynInfo);
williamr@2:     
williamr@2:     /**
williamr@2:      * Symbian 2nd phase constructor.
williamr@2:      */    
williamr@2:     void ConstructL();    
williamr@2: 	
williamr@2: 	/**
williamr@2:      * By default, prohibit copy constructor
williamr@2:      */
williamr@2:     CLbtTriggerInfo( const CLbtTriggerInfo& );
williamr@2:     
williamr@2:     /**
williamr@2:      * Prohibit assigment operator
williamr@2:      */
williamr@2:     CLbtTriggerInfo& operator= ( const CLbtTriggerInfo& );
williamr@2: 
williamr@2: 
williamr@2: private:// data
williamr@2:     /**
williamr@2:      * Trigger entry
williamr@2:      */
williamr@2:     CLbtTriggerEntry* iEntry;
williamr@2: 
williamr@2:     /**
williamr@2:      * Trigger dynamic info
williamr@2:      */
williamr@2:     TLbtTriggerDynamicInfo* iDynInfo;
williamr@2:     };
williamr@2: 
williamr@2: #endif // LBTTRIGGERINFO_H