languageinterworkingfw/servicehandler/inc/liwservicedata.h
changeset 57 61b27eec6533
parent 45 7aa6007702af
equal deleted inserted replaced
45:7aa6007702af 57:61b27eec6533
     1 /*
       
     2 * Copyright (c) 2003-2005 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 the License "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:       Declares Service Data and Service Provider Metadata classes
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 #ifndef LIW_SERVICEDATA_H
       
    25 #define LIW_SERVICEDATA_H
       
    26 
       
    27 // INCLUDES
       
    28 #include <e32base.h>
       
    29 
       
    30 // CONSTANTS
       
    31 
       
    32 // MACROS
       
    33 
       
    34 // FUNCTION PROTOTYPES
       
    35 
       
    36 // FORWARD DECLARATIONS
       
    37 class CLiwServiceData;
       
    38 class CLiwXmlHandler;
       
    39 class CLiwServiceHandlerImpl;
       
    40 class CDesC8Array;
       
    41 
       
    42 class CLiwMap;
       
    43 class CLiwGenericParamList;
       
    44 class TLiwVariant;
       
    45 
       
    46 /**
       
    47 * CLiwServiceData models the service provider data/information.
       
    48 * A Service provider can obtain its metadata through the interfaces
       
    49 * of this class. The Service metadata is a name-value pair defined 
       
    50 * by the provider as part of its registration information (Refer \c REGISTRY_INFO).
       
    51 *
       
    52 * One of the key metadata value is the capability set which are expected 
       
    53 * from the service consumer by the provider. The required capability set
       
    54 * is specifed in the provider registration information (Refer \c REGISTRY_INFO).
       
    55 *
       
    56 * ServiceHandler queries for those capabilities using \c CLiwServiceData::GetCapabilitiesL
       
    57 *
       
    58 * @lib ServiceHandler.lib
       
    59 *
       
    60 * @see CLiwServiceHandler
       
    61 * @see CLiwMetaData
       
    62 * @see TCapability
       
    63 */
       
    64 class CLiwServiceData : public CBase
       
    65 {
       
    66 public:
       
    67 
       
    68 	
       
    69 	/**
       
    70     * Returns the service metadata.
       
    71     *
       
    72     * @return the service metadata
       
    73     */
       
    74     CLiwGenericParamList* GetMetaData() const;
       
    75 	
       
    76 	// Destructor
       
    77 	virtual ~CLiwServiceData();
       
    78 													
       
    79 private:
       
    80 	
       
    81 	/*
       
    82 	 * Creates and returns an instance of \c CLiwServiceData
       
    83 	 * This is private and not available for external clients.
       
    84 	 *
       
    85 	 * @return the instance of created instance of \c CLiwServiceData
       
    86 	 */
       
    87 	static CLiwServiceData* NewL();
       
    88 	
       
    89 	/*
       
    90 	 * Creates and returns an instance of \c CLiwServiceData
       
    91 	 * The created instance is left in the cleanupstack.
       
    92 	 * This is private and not available for external clients.
       
    93 	 *
       
    94 	 * @return the instance of created instance of \c CLiwServiceData
       
    95 	 */
       
    96 	static CLiwServiceData* NewLC();
       
    97 	
       
    98 	/*
       
    99 	 * Default private constructor.
       
   100 	 * Creates the metadata associated with the service data
       
   101 	 */
       
   102 	CLiwServiceData();
       
   103 	
       
   104 	/*
       
   105 	 * Second phase constructor
       
   106 	 */
       
   107 	void ConstructL();
       
   108 
       
   109 	/*
       
   110 	 * Adds a metadata name-value pair. If the key already exists,
       
   111 	 * then the value will be added to the list of values associated
       
   112 	 * with the metadata key 
       
   113 	 *
       
   114 	 * @param aKey the metadata key to be inserted
       
   115 	 * @param aValue the value associated with the metadata key to be inserted
       
   116 	 */
       
   117 	void AddMetaDataL(const TDesC8& aKey, const TDesC8& aValue);
       
   118 	void AddMetaDataL(const TDesC8& aKey, const TLiwVariant& aValue);
       
   119 	
       
   120 	/*
       
   121 	 * Removes all the metadata key-value pairs.
       
   122 	 * This is called from service handler implementation if and only
       
   123 	 * if there is an error in parsing. Since, the FW uses SAX parser
       
   124 	 * and if the XML error happens after the metadata entries are 
       
   125 	 * created, the entries should be cleaned up.
       
   126 	 */
       
   127 	void CleanUpMetaData();
       
   128 	
       
   129 	
       
   130 	
       
   131 	CLiwGenericParamList* iDataList;
       
   132 	
       
   133 	friend class CLiwXmlHandler;
       
   134 	friend class CLiwServiceHandlerImpl;
       
   135 };
       
   136 
       
   137 #endif 
       
   138 
       
   139 // End of File
       
   140 
       
   141