contextframework/cfw/inc/cfservices/CFContextIndicationImpl.h
changeset 0 2e3d3ce01487
equal deleted inserted replaced
-1:000000000000 0:2e3d3ce01487
       
     1 /*
       
     2 * Copyright (c) 2002-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:  CCFContextIndicationImpl class declaration.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CFCONTEXTINDICATIONIMPL_H
       
    20 #define C_CFCONTEXTINDICATIONIMPL_H
       
    21 
       
    22 #include "cfcontextindication.h"
       
    23 
       
    24 class RWriteStream;
       
    25 class RReadStream;
       
    26 class CCFContextObjectImpl;
       
    27 
       
    28 /**
       
    29 * Context indication implementation.
       
    30 *
       
    31 * @lib CFServices.lib
       
    32 * @since S60 4.0
       
    33 */
       
    34 NONSHARABLE_CLASS( CCFContextIndicationImpl ): public CCFContextIndication
       
    35     {
       
    36     public:
       
    37     
       
    38         // Two phased constructors
       
    39         IMPORT_C static CCFContextIndicationImpl* NewL( const TUid& aUid );
       
    40         IMPORT_C static CCFContextIndicationImpl* NewLC( const TUid& aUid );
       
    41         
       
    42         // Two phased constructors
       
    43         IMPORT_C static CCFContextIndicationImpl* NewL(
       
    44             RReadStream& aStream );
       
    45         IMPORT_C static CCFContextIndicationImpl* NewLC(
       
    46             RReadStream& aStream );
       
    47 
       
    48         // Destructor
       
    49         ~CCFContextIndicationImpl();
       
    50         
       
    51     public: // From base classes
       
    52     
       
    53         // @see CCFContextIndication
       
    54         const CCFContextObject& Context() const;
       
    55 
       
    56         // @see CCFContextIndication
       
    57         const TUid& Uid() const;
       
    58         
       
    59         // @see CCFContextIndication
       
    60         void CreateDataObjectL( CCFContextDataObject& aDataObject );
       
    61 
       
    62     public: // New methods
       
    63 
       
    64         /**
       
    65         * Internalizes object.
       
    66         * 
       
    67         * @since S60 5.0
       
    68         * @param aStream Read stream.
       
    69         * @return None.
       
    70         */    
       
    71         IMPORT_C void InternalizeL( RReadStream& aStream );
       
    72         
       
    73         /**
       
    74         * Externalizes object.
       
    75         *
       
    76         * @since S60 5.0
       
    77         * @param aStream Write stream.
       
    78         * @return None.
       
    79         */    
       
    80         IMPORT_C void ExternalizeL( RWriteStream& aStream );
       
    81 
       
    82         /**
       
    83         * Returns size of the object in bytes.
       
    84         *
       
    85         * @since S60 5.0
       
    86         * @param None.
       
    87         * @return TInt.
       
    88         */    
       
    89         IMPORT_C TInt Size() const;
       
    90 	        
       
    91         /**
       
    92         * Sets new context to this indication.
       
    93         * 
       
    94         * @since S60 4.0
       
    95         * @param aObject Context object.
       
    96         * @return None
       
    97         */
       
    98         IMPORT_C void SetContextL( const CCFContextObject& aContext );
       
    99         
       
   100         /**
       
   101         * Sets a UID of the data object.
       
   102         *
       
   103         * @since S60 5.0
       
   104         * @param aUid Uid of the data object.
       
   105         * @return None.
       
   106         */
       
   107         IMPORT_C void SetDataObjectUid( const TUid& aUid );
       
   108         
       
   109         /**
       
   110         * Associate a data object with the context indication.
       
   111         *
       
   112         * @since S60 5.0
       
   113         * @param aData Data object to associate.
       
   114         * @return None.
       
   115         */
       
   116         IMPORT_C void SetDataObject( HBufC8* aData );
       
   117 
       
   118     private:
       
   119 
       
   120         CCFContextIndicationImpl( const TUid& aUid );
       
   121         void ConstructL();
       
   122 
       
   123     private:
       
   124 
       
   125         /** Context object related to the indication */
       
   126         CCFContextObjectImpl* iContext;
       
   127         
       
   128         /** UID associated into the data */
       
   129         TUid iUid;
       
   130         
       
   131         /** Streamed data object */
       
   132         HBufC8* iData;
       
   133     };
       
   134 
       
   135 #endif