webservices/wsframework/inc/sencontextitem.h
changeset 0 62f9d29f7211
equal deleted inserted replaced
-1:000000000000 0:62f9d29f7211
       
     1 /*
       
     2 * Copyright (c) 2002-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 "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: Header declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 #ifndef SEN_CONTEXT_ITEM_H
       
    26 #define SEN_CONTEXT_ITEM_H
       
    27 
       
    28 //  INCLUDES
       
    29 #include <ecom/ecom.h>
       
    30 #include <e32std.h>   // for RCriticalSection
       
    31 
       
    32 #include "senwsdescription.h"
       
    33 
       
    34 #include "msencontextitem.h" // internal Framework\inc
       
    35 #include "msencontext.h"
       
    36 
       
    37 // FORWARD DECLARE
       
    38 class MSenCoreServiceManager;
       
    39 class MSenRemoteServiceConsumer;
       
    40 class MSenRemoteHostlet;
       
    41 class MSenWSDescription;
       
    42 class CSenWSDescription;
       
    43 class CSenIdentityProvider;
       
    44 class CSenWSPattern;
       
    45 class CSenServiceSession;
       
    46 class CSenWebServiceSession;
       
    47 class CSenBasicWebServiceSession;
       
    48 class CIdWSFServiceSession;
       
    49 class CIdWsfServiceInstance;
       
    50 class CSenCoreServiceConsumer;
       
    51 class CSenSenInternalServiceConsumer;
       
    52 class CIdWsfAuthenticationServiceClient;
       
    53 class CIdWsfDiscoveryServiceClient;
       
    54 class CSenRestServiceSession;
       
    55 class CWSStarServiceSession;
       
    56 class CWSStarSTSClient;
       
    57 
       
    58 class CSenChunk;
       
    59 class CSenElement;
       
    60 class CSenMessageBase;
       
    61 class CSenSoapEnvelope2;
       
    62 class MSenMessage;
       
    63 class CSenSoapEnvelope;
       
    64 class CSenAtomEntry;
       
    65 class CSenSoapMessage;
       
    66 class CSenXmlReader;
       
    67 class MSenProperties;
       
    68 class CSenXmlProperties;
       
    69 class CSenTransportProperties;
       
    70 class CSenHttpTransportProperties;
       
    71 class CSenVtcpTransportProperties;
       
    72 class CSenLayeredXmlProperties;
       
    73 class CSenLayeredTransportProperties;
       
    74 class CSenLayeredHttpTransportProperties;
       
    75 class CSenLayeredVtcpTransportProperties;
       
    76 
       
    77 using namespace SenContext;
       
    78 
       
    79 // CLASS DECLARATION
       
    80 
       
    81 /**
       
    82 * Class for wrapping objects so that they can be moved in 
       
    83 * and out of context a context using 
       
    84 * 
       
    85 * Sub-classing actual Service Providers have to implement MSenContextItem
       
    86 * interface.
       
    87 *
       
    88 */       
       
    89 class CSenContextItem : public CBase, public MSenContextItem
       
    90     {
       
    91     public: 
       
    92     
       
    93         // Constructors and destructor
       
    94         /**
       
    95         * Two-phased constructor, data type is TContextItemDataType::ETAny
       
    96         * @param apValue is the data to be stored
       
    97         * @param aIsOwnedOrNot determines whether the value is owned
       
    98         * @return pointer to new context item
       
    99         */
       
   100         IMPORT_C static CSenContextItem* NewL(TAny* apNotOwned);
       
   101         /**
       
   102         * Two-phased constructor, data type is TContextItemDataType::ETAny
       
   103         * @param apOwned is owned 
       
   104         * @param aIsOwnedOrNot determines whether the value is owned
       
   105         * @return pointer to new context item
       
   106         * which is also left on cleanup stack.
       
   107         */
       
   108         IMPORT_C static CSenContextItem* NewLC(TAny* apNotOwned);
       
   109 
       
   110         /**
       
   111         * Two-phased constructor, data type is TContextItemDataType::ETDesC8
       
   112         * @param aRefToValue is copied (alloc)
       
   113         * @return pointer to new context item
       
   114         */
       
   115         IMPORT_C static CSenContextItem* NewL(const TDesC8& aRefToValue);
       
   116         /**
       
   117         * Two-phased constructor, data type is TContextItemDataType::ETDesC8
       
   118         * @param aRefToValue is copied (alloc)
       
   119         * @return pointer to new context item
       
   120         * which is also left on cleanup stack.
       
   121         */
       
   122         IMPORT_C static CSenContextItem* NewLC(const TDesC8& aRefToValue);
       
   123         
       
   124         /**
       
   125         * Two-phased constructor, data type is TContextItemDataType::ETDesC8
       
   126         * @param apOwned is owned 
       
   127         * @return pointer to new context item
       
   128         */
       
   129         IMPORT_C static CSenContextItem* NewL(TDesC8* apOwned);
       
   130         /**
       
   131         * Two-phased constructor, data type is TContextItemDataType::ETDesC8
       
   132         * @param apOwned is owned 
       
   133         * @return pointer to new context item
       
   134         * which is also left on cleanup stack.
       
   135         */
       
   136         IMPORT_C static CSenContextItem* NewLC(TDesC8* apOwned);
       
   137 
       
   138 
       
   139         /**
       
   140         * Two-phased constructor, data type is TContextItemDataType::ETInt
       
   141         * @param apValue is copied (alloc)
       
   142         * @return pointer to new context item
       
   143         */
       
   144         IMPORT_C static CSenContextItem* NewL(const TInt apValue);
       
   145         /**
       
   146         * Two-phased constructor, data type is TContextItemDataType::ETInt
       
   147         * @param apValue is copied (alloc)
       
   148         * @return pointer to new context item
       
   149         * which is also left on cleanup stack.
       
   150         */
       
   151         IMPORT_C static CSenContextItem* NewLC(const TInt apValue);
       
   152 
       
   153 
       
   154         /**
       
   155         * Two-phased constructor, data type is TContextItemDataType::ETInt
       
   156         * @param apOwned is owned
       
   157         * @return pointer to new context item
       
   158         */
       
   159         IMPORT_C static CSenContextItem* NewL(TInt* apOwned);
       
   160         /**
       
   161         * Two-phased constructor, data type is TContextItemDataType::ETInt
       
   162         * @param apOwned is owned
       
   163         * @return pointer to new context item
       
   164         * which is also left on cleanup stack.
       
   165         */
       
   166         IMPORT_C static CSenContextItem* NewLC(TInt* apOwned);
       
   167         
       
   168 
       
   169         /**
       
   170         * Two-phased constructor, data type is TContextItemDataType::ETUint
       
   171         * @param aValue is copied (alloc)
       
   172         * @return pointer to new context item
       
   173         */
       
   174         IMPORT_C static CSenContextItem* NewL(const TUint aValue);
       
   175         /**
       
   176         * Two-phased constructor, data type is TContextItemDataType::ETUint
       
   177         * @param aValue is copied (alloc)
       
   178         * @return pointer to new context item
       
   179         * which is also left on cleanup stack.
       
   180         */
       
   181         IMPORT_C static CSenContextItem* NewLC(const TUint aValue);
       
   182 
       
   183         /**
       
   184         * Two-phased constructor, data type is TContextItemDataType::ETUint
       
   185         * @param apOwned is owned
       
   186         * @return pointer to new context item
       
   187         */
       
   188         IMPORT_C static CSenContextItem* NewL(TUint* apOwned);
       
   189         /**
       
   190         * Two-phased constructor, data type is TContextItemDataType::ETUint
       
   191         * @param apOwned is owned
       
   192         * @return pointer to new context item
       
   193         * which is also left on cleanup stack.
       
   194         */
       
   195         IMPORT_C static CSenContextItem* NewLC(TUint* apOwned);
       
   196 
       
   197 
       
   198         /**
       
   199         * Two-phased constructor, data type is TContextItemDataType::EMSenCoreServiceManager
       
   200         * @param aValue is referenced (not owned)
       
   201         * @return pointer to new context item
       
   202         */
       
   203         IMPORT_C static CSenContextItem* NewL(MSenCoreServiceManager& aValue);
       
   204         /**
       
   205         * Two-phased constructor, data type is TContextItemDataType::EMSenCoreServiceManager
       
   206         * @param aValue is referenced (not owned)
       
   207         * @return pointer to new context item
       
   208         * which is also left on cleanup stack.
       
   209         */
       
   210         IMPORT_C static CSenContextItem* NewLC(MSenCoreServiceManager& aValue);
       
   211 
       
   212 
       
   213 
       
   214 
       
   215         /**
       
   216         * Two-phased constructor, data type is TContextItemDataType::EMSenRemoteServiceConsumer
       
   217         * @param aValue is referenced (not owned)
       
   218         * @return pointer to new context item
       
   219         */
       
   220         IMPORT_C static CSenContextItem* NewL(MSenRemoteServiceConsumer& aValue);
       
   221         /**
       
   222         * Two-phased constructor, data type is TContextItemDataType::EMSenRemoteServiceConsumer
       
   223         * @param aValue is referenced (not owned)
       
   224         * @return pointer to new context item
       
   225         * which is also left on cleanup stack.
       
   226         */
       
   227         IMPORT_C static CSenContextItem* NewLC(MSenRemoteServiceConsumer& aValue);
       
   228 
       
   229 
       
   230         /**
       
   231         * Two-phased constructor, data type is TContextItemDataType::EMSenRemoteHostlet
       
   232         * @param aValue is referenced (not owned)
       
   233         * @return pointer to new context item
       
   234         */
       
   235         IMPORT_C static CSenContextItem* NewL(MSenRemoteHostlet& aValue);
       
   236         /**
       
   237         * Two-phased constructor, data type is TContextItemDataType::EMSenRemoteHostlet
       
   238         * @param aValue is referenced (not owned)
       
   239         * @return pointer to new context item
       
   240         * which is also left on cleanup stack.
       
   241         */
       
   242         IMPORT_C static CSenContextItem* NewLC(MSenRemoteHostlet& aValue);
       
   243         
       
   244         
       
   245         /**
       
   246         * Two-phased constructor, data type is TContextItemDataType::ECSenWSDescription
       
   247         * @param aValue is referenced (not owned)
       
   248         * @return pointer to new context item
       
   249         */
       
   250         IMPORT_C static CSenContextItem* NewL(CSenWSDescription& aValue);
       
   251         /**
       
   252         * Two-phased constructor, data type is TContextItemDataType::ECSenWSDescription
       
   253         * @param aValue is referenced owned (not owned)
       
   254         * @return pointer to new context item
       
   255         * which is also left on cleanup stack.
       
   256         */
       
   257         IMPORT_C static CSenContextItem* NewLC(CSenWSDescription& aValue);
       
   258 
       
   259         /**
       
   260         * Two-phased constructor, data type is TContextItemDataType::EMSenServiceDescription
       
   261         * @param apOwned is owned
       
   262         * @return pointer to new context item
       
   263         */
       
   264         IMPORT_C static CSenContextItem* NewL(CSenWSDescription* apOwned);
       
   265         /**
       
   266         * Two-phased constructor, data type is TContextItemDataType::EMSenServiceDescription
       
   267         * @param apOwned is owned
       
   268         * @return pointer to new context item
       
   269         * which is also left on cleanup stack.
       
   270         */
       
   271         IMPORT_C static CSenContextItem* NewLC(CSenWSDescription* apOwned);
       
   272 
       
   273 
       
   274         /**
       
   275         * Two-phased constructor, data type is TContextItemDataType::ECSenChunk
       
   276         * @param aValue is referenced (not owned)
       
   277         * @return pointer to new context item
       
   278         */
       
   279         IMPORT_C static CSenContextItem* NewL(CSenChunk& aValue);
       
   280         /**
       
   281         * Two-phased constructor, data type is TContextItemDataType::ECSenChunk
       
   282         * @param aValue is referenced owned (not owned)
       
   283         * @return pointer to new context item
       
   284         * which is also left on cleanup stack.
       
   285         */
       
   286         IMPORT_C static CSenContextItem* NewLC(CSenChunk& aValue);
       
   287 
       
   288         /**
       
   289         * Two-phased constructor, data type is TContextItemDataType::ECSenChunk
       
   290         * @param apOwned is owned
       
   291         * @return pointer to new context item
       
   292         */
       
   293         IMPORT_C static CSenContextItem* NewL(CSenChunk* apOwned);
       
   294         /**
       
   295         * Two-phased constructor, data type is TContextItemDataType::ECSenChunk
       
   296         * @param apOwned is owned
       
   297         * @return pointer to new context item
       
   298         * which is also left on cleanup stack.
       
   299         */
       
   300         IMPORT_C static CSenContextItem* NewLC(CSenChunk* apOwned);
       
   301 
       
   302 
       
   303         /**
       
   304         * Two-phased constructor, data type is TContextItemDataType::ECSenXmlElement
       
   305         * @param aValue is referenced (not owned)
       
   306         * @return pointer to new context item
       
   307         */
       
   308         IMPORT_C static CSenContextItem* NewL(CSenElement& aValue);
       
   309         /**
       
   310         * Two-phased constructor, data type is TContextItemDataType::ECSenXmlElement
       
   311         * @param aValue is referenced owned (not owned)
       
   312         * @return pointer to new context item
       
   313         * which is also left on cleanup stack.
       
   314         */
       
   315         IMPORT_C static CSenContextItem* NewLC(CSenElement& aValue);
       
   316 
       
   317         /**
       
   318         * Two-phased constructor, data type is TContextItemDataType::ECSenXmlElement
       
   319         * @param apOwned is owned
       
   320         * @return pointer to new context item
       
   321         */
       
   322         IMPORT_C static CSenContextItem* NewL(CSenElement* apOwned);
       
   323         /**
       
   324         * Two-phased constructor, data type is TContextItemDataType::ECSenXmlElement
       
   325         * @param apOwned is owned
       
   326         * @return pointer to new context item
       
   327         * which is also left on cleanup stack.
       
   328         */
       
   329         IMPORT_C static CSenContextItem* NewLC(CSenElement* apOwned);
       
   330 
       
   331 
       
   332         /**
       
   333         * Two-phased constructor, data type is TContextItemDataType::ECSenXmlElement
       
   334         * @param aValue is referenced (not owned)
       
   335         * @return pointer to new context item
       
   336         */
       
   337         IMPORT_C static CSenContextItem* NewL(CSenXmlReader& aValue);
       
   338         /**
       
   339         * Two-phased constructor, data type is TContextItemDataType::ECSenXmlReader
       
   340         * @param aValue is referenced owned (not owned)
       
   341         * @return pointer to new context item
       
   342         * which is also left on cleanup stack.
       
   343         */
       
   344         IMPORT_C static CSenContextItem* NewLC(CSenXmlReader& aValue);
       
   345 
       
   346         /**
       
   347         * Two-phased constructor, data type is TContextItemDataType::ECSenXmlReader
       
   348         * @param apOwned is owned
       
   349         * @return pointer to new context item
       
   350         */
       
   351         IMPORT_C static CSenContextItem* NewL(CSenXmlReader* apOwned);
       
   352         /**
       
   353         * Two-phased constructor, data type is TContextItemDataType::ECSenXmlReader
       
   354         * @param apOwned is owned
       
   355         * @return pointer to new context item
       
   356         * which is also left on cleanup stack.
       
   357         */
       
   358         IMPORT_C static CSenContextItem* NewLC(CSenXmlReader* apOwned);
       
   359 
       
   360 
       
   361         /**
       
   362         * Two-phased constructor, data type is TContextItemDataType::EMSenProperties
       
   363         * @param aValue is referenced (not owned)
       
   364         * @return pointer to new context item
       
   365         */
       
   366         IMPORT_C static CSenContextItem* NewL(MSenProperties& aValue);
       
   367         /**
       
   368         * Two-phased constructor, data type is TContextItemDataType::EMSenProperties
       
   369         * @param aValue is referenced owned (not owned)
       
   370         * @return pointer to new context item
       
   371         * which is also left on cleanup stack.
       
   372         */
       
   373         IMPORT_C static CSenContextItem* NewLC(MSenProperties& aValue);
       
   374 
       
   375         /**
       
   376         * Two-phased constructor, data type is TContextItemDataType::EMSenProperties
       
   377         * @param apOwned is owned
       
   378         * @return pointer to new context item
       
   379         */
       
   380         IMPORT_C static CSenContextItem* NewL(CSenXmlProperties* apOwned);
       
   381         /**
       
   382         * Two-phased constructor, data type is TContextItemDataType::EMSenProperties
       
   383         * @param apOwned is owned
       
   384         * @return pointer to new context item
       
   385         * which is also left on cleanup stack.
       
   386         */
       
   387         IMPORT_C static CSenContextItem* NewLC(CSenXmlProperties* apOwned);
       
   388 
       
   389         /**
       
   390         * Two-phased constructor, data type is TContextItemDataType::EMSenProperties
       
   391         * @param apOwned is owned
       
   392         * @return pointer to new context item
       
   393         */
       
   394         IMPORT_C static CSenContextItem* NewL(CSenLayeredXmlProperties* apOwned);
       
   395         /**
       
   396         * Two-phased constructor, data type is TContextItemDataType::EMSenProperties
       
   397         * @param apOwned is owned
       
   398         * @return pointer to new context item
       
   399         * which is also left on cleanup stack.
       
   400         */
       
   401         IMPORT_C static CSenContextItem* NewLC(CSenLayeredXmlProperties* apOwned);
       
   402 
       
   403 
       
   404         /**
       
   405         * Two-phased constructor, data type is TContextItemDataType::EMSenMessage
       
   406         * @param aValue is referenced (not owned)
       
   407         * @return pointer to new context item
       
   408         */
       
   409         IMPORT_C static CSenContextItem* NewL(MSenMessage& aValue);
       
   410         /**
       
   411         * Two-phased constructor, data type is TContextItemDataType::EMSenMessage
       
   412         * @param aValue is referenced owned (not owned)
       
   413         * @return pointer to new context item
       
   414         * which is also left on cleanup stack.
       
   415         */
       
   416         IMPORT_C static CSenContextItem* NewLC(MSenMessage& aValue);
       
   417 
       
   418         /**
       
   419         * Two-phased constructor, data type is TContextItemDataType::ECSenSoapEnvelope2
       
   420         * @param apOwned is owned
       
   421         * @return pointer to new context item
       
   422         */
       
   423         IMPORT_C static CSenContextItem* NewL(CSenSoapEnvelope2* apOwned);
       
   424         /**
       
   425         * Two-phased constructor, data type is TContextItemDataType::ECSenSoapEnvelope2
       
   426         * @param apOwned is owned
       
   427         * @return pointer to new context item
       
   428         * which is also left on cleanup stack.
       
   429         */
       
   430         IMPORT_C static CSenContextItem* NewLC(CSenSoapEnvelope2* apOwned);
       
   431 
       
   432         /**
       
   433         * Two-phased constructor, data type is TContextItemDataType::CSenAtomEntry
       
   434         * @param apOwned is owned
       
   435         * @return pointer to new context item
       
   436         * which is also left on cleanup stack.
       
   437         */
       
   438         IMPORT_C static CSenContextItem* NewLC(CSenAtomEntry* apOwned);
       
   439         /**
       
   440         * Two-phased constructor, data type is TContextItemDataType::CSenAtomEntry
       
   441         * @param apOwned is owned
       
   442         * @return pointer to new context item
       
   443         * which is also left on cleanup stack.
       
   444         */
       
   445         IMPORT_C static CSenContextItem* NewL(CSenAtomEntry* apOwned);
       
   446         
       
   447         
       
   448         
       
   449         
       
   450         /**
       
   451         * Two-phased constructor, data type is TContextItemDataType::ECSenMessageBase
       
   452         * @param apOwned is owned
       
   453         * @return pointer to new context item
       
   454         */
       
   455         IMPORT_C static CSenContextItem* NewL(CSenMessageBase* apOwned);
       
   456         /**
       
   457         * Two-phased constructor, data type is TContextItemDataType::ECSenMessageBase
       
   458         * @param apOwned is owned
       
   459         * @return pointer to new context item
       
   460         * which is also left on cleanup stack.
       
   461         */
       
   462         IMPORT_C static CSenContextItem* NewLC(CSenMessageBase* apOwned);
       
   463 
       
   464 
       
   465         /**
       
   466         * Two-phased constructor, data type is TContextItemDataType::ECSenXmlElement
       
   467         * @param aValue is referenced (not owned)
       
   468         * @return pointer to new context item
       
   469         */
       
   470         IMPORT_C static CSenContextItem* NewL(CSenSoapMessage& aValue);
       
   471         /**
       
   472         * Two-phased constructor, data type is TContextItemDataType::ECSenXmlElement
       
   473         * @param aValue is referenced owned (not owned)
       
   474         * @return pointer to new context item
       
   475         * which is also left on cleanup stack.
       
   476         */
       
   477         IMPORT_C static CSenContextItem* NewLC(CSenSoapMessage& aValue);
       
   478 
       
   479         /**
       
   480         * Two-phased constructor, data type is TContextItemDataType::ECSenXmlElement
       
   481         * @param apOwned is owned
       
   482         * @return pointer to new context item
       
   483         */
       
   484         IMPORT_C static CSenContextItem* NewL(CSenSoapMessage* apOwned);
       
   485         /**
       
   486         * Two-phased constructor, data type is TContextItemDataType::ECSenXmlElement
       
   487         * @param apOwned is owned
       
   488         * @return pointer to new context item
       
   489         * which is also left on cleanup stack.
       
   490         */
       
   491         IMPORT_C static CSenContextItem* NewLC(CSenSoapMessage* apOwned);
       
   492 
       
   493 
       
   494         // From MSenContextItem:
       
   495 
       
   496         /*
       
   497         * Method for resolving real C-class type (implemenation class).
       
   498         * Inherited from MSenContextItem.
       
   499         * @return the type of this class (EContextItem)
       
   500         */
       
   501         virtual MSenContextItem::TClass Type() const;            
       
   502 
       
   503 
       
   504         // New methods:
       
   505 
       
   506         /** 
       
   507         * 
       
   508         * Returns the pointer to the data that is wrapped inside this item.
       
   509         * @return pointer to wrapped data, but only if this context item 
       
   510         * was constructed with TAny -argument. In case that this item knows
       
   511         * the data type of the object (!=TAny), method will leave.
       
   512         * Supported data type(s):
       
   513         *       TAny (root) -- TContextItemDataType::ETAny
       
   514         * Leave codes:
       
   515         *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
       
   516         */
       
   517         virtual TAny* ToAnyL() const;
       
   518 
       
   519         /** 
       
   520         * Returns the 8-bit descriptor that is wrapped inside this item.
       
   521         * @return 8-bit descriptor, but only if this context item was constructed
       
   522         * to hold such data. In case that this item holds some object of different
       
   523         * type instead, the method will leave.
       
   524         * Supported data type(s):
       
   525         *       TDesC8 (root) -- TContextItemDataType::ETDesC8
       
   526         * Leave codes:
       
   527         *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
       
   528         */
       
   529         virtual TPtrC8 ToPtrC8L() const;
       
   530 
       
   531             
       
   532         /** 
       
   533         * Returns the 8-bit descriptor that is wrapped inside this item.
       
   534         * @return 8-bit descriptor, but only if this context item was constructed
       
   535         * to hold such data. In case that this item holds some object of different
       
   536         * type instead, the method will leave.
       
   537         * Supported data type(s):
       
   538         *       TDesC8 (root) -- TContextItemDataType::ETDesC8
       
   539         * Leave codes:
       
   540         *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
       
   541         */
       
   542         virtual const TDesC8* ToDesC8L() const;
       
   543         
       
   544         /** 
       
   545         * Returns the signed integer descriptor that is wrapped inside this item.
       
   546         * @return integer, but only if this context item was constructed
       
   547         * to hold such data. In case that this item holds some object of different
       
   548         * type instead, the method will leave.
       
   549         * Supported data type(s):
       
   550         *       TInt -- TContextItemDataType::ETInt
       
   551         * Leave codes:
       
   552         *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
       
   553         */
       
   554         virtual const TInt* ToIntL() const;
       
   555 
       
   556         /** 
       
   557         * Returns the unsigned integer descriptor that is wrapped inside this item.
       
   558         * @return integer, but only if this context item was constructed
       
   559         * to hold such data. In case that this item holds some object of different
       
   560         * type instead, the method will leave.
       
   561         * Supported data type(s):
       
   562         *       TUint -- TContextItemDataType::ETUint
       
   563         * Leave codes:
       
   564         *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
       
   565         */
       
   566         virtual const TUint* ToUintL() const;
       
   567         
       
   568         /** 
       
   569         * Returns MSenCoreServiceManager that is wrapped inside this item.
       
   570         * @return core, but only if this context item was constructed
       
   571         * to hold such data. In case that this item holds some object of different
       
   572         * type instead, the method will leave.
       
   573         * Supported data type(s):
       
   574         *       MSenCoreServiceManager -- TContextItemDataType::EMSenCoreServiceManager
       
   575         * Leave codes:
       
   576         *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
       
   577         */
       
   578         virtual MSenCoreServiceManager& ToSenCoreL() const;
       
   579 
       
   580         /** 
       
   581         * Returns MSenRemoteServiceConsumer that is wrapped inside this item.
       
   582         * @return consumer, but only if this context item was constructed
       
   583         * to hold such data. In case that this item holds some object of different
       
   584         * type instead, the method will leave.
       
   585         * Supported data type(s):
       
   586         *       MSenRemoteServiceConsumer -- TContextItemDataType::EMSenRemoteServiceConsumer
       
   587         * Leave codes:
       
   588         *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
       
   589         */
       
   590         virtual MSenRemoteServiceConsumer& ToSenRemoteConsumerL() const;
       
   591 
       
   592         /** 
       
   593         * Returns MSenRemoteHostlet that is wrapped inside this item.
       
   594         * @return hostlet, but only if this context item was constructed
       
   595         * to hold such data. In case that this item holds some object of different
       
   596         * type instead, the method will leave.
       
   597         * Supported data type(s):
       
   598         *       MSenRemoteHostlet (root) -- TContextItemDataType::EMSenRemoteHostlet
       
   599         * Leave codes:
       
   600         *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
       
   601         */
       
   602         virtual MSenRemoteHostlet& ToSenRemoteHostletL() const;
       
   603 
       
   604         /** 
       
   605         * Returns CSenWSDescription that is wrapped inside this item.
       
   606         * @return XML service description, but only if this context item was constructed
       
   607         * to hold such data. In case that this item holds some object of different
       
   608         * type instead, the method will leave.
       
   609         * Supported data type(s):
       
   610         *       CSenWSDescription (root) -- TContextItemDataType::EMSenServiceDescription
       
   611         * Leave codes:
       
   612         *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
       
   613         */
       
   614         virtual CSenWSDescription& ToSenServiceDescriptionL() const;
       
   615 
       
   616         /** 
       
   617         * Returns CSenServiceSession that is wrapped inside this item.
       
   618         * @return session, but only if this context item was constructed
       
   619         * to hold such data. In case that this item holds some object of different
       
   620         * type instead, the method will leave.
       
   621         * Supported data type(s):
       
   622         *       CSenServiceSession -- TContextItemDataType::EMSenServiceDescription
       
   623         * Leave codes:
       
   624         *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
       
   625         */
       
   626         virtual CSenServiceSession& ToSenServiceSessionL() const;
       
   627 
       
   628         /** 
       
   629         * Returns properties object that is wrapped inside this item.
       
   630         * @return XML properties, but only if this context item was constructed
       
   631         * to hold such data. In case that this item holds some object of different
       
   632         * type instead, the method will leave.
       
   633         * Supported data type(s):
       
   634         *       CSenXmlProperties (root) -- TContextItemDataType::EMSenProperties
       
   635         * Leave codes:
       
   636         *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
       
   637         */
       
   638         virtual CSenXmlProperties& ToSenXmlPropertiesL() const;
       
   639 
       
   640         /** 
       
   641         * Returns layered properties object that is wrapped inside this item.
       
   642         * @return layered XML properties, but only if this context item was constructed
       
   643         * to hold such data. In case that this item holds some object of different
       
   644         * type instead, the method will leave.
       
   645         * Supported data type(s):
       
   646         *       CSenLayeredXmlProperties (root) -- TContextItemDataType::EMSenProperties
       
   647         * Leave codes:
       
   648         *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
       
   649         */
       
   650         virtual CSenLayeredXmlProperties& ToSenLayeredXmlPropertiesL() const;
       
   651 
       
   652         /** 
       
   653         * Returns the XML element that is wrapped inside this item.
       
   654         * @return XML element, but only if this context item was constructed
       
   655         * to hold such data. In case that this item holds some object of different
       
   656         * type instead, the method will leave.
       
   657         * Supported data type(s):
       
   658         *       CSenElement (root) -- TContextItemDataType::ECSenElement
       
   659         * Leave codes:
       
   660         *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
       
   661         */
       
   662         virtual CSenElement& ToSenElementL() const;
       
   663 
       
   664         /** 
       
   665         * Returns the SOAP message that is wrapped inside this item.
       
   666         * @return SOAP message, but only if this context item was constructed
       
   667         * to hold such data. In case that this item holds some object of different
       
   668         * type instead, the method will leave.
       
   669         * Supported data type(s):
       
   670         *       CSenElement (root) -- TContextItemDataType::ECSenSoapEnvelope
       
   671         * Leave codes:
       
   672         *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
       
   673         */
       
   674         virtual CSenSoapMessage& ToSenSoapMessageL() const;
       
   675 
       
   676         /** 
       
   677         * Returns the message that is wrapped inside this item.
       
   678         * @return message, but only if this context item was constructed
       
   679         * to hold such data. In case that this item holds some object of different
       
   680         * type instead, the method will leave.
       
   681         * Supported data type(s):
       
   682         *       CSenElement (root) -- TContextItemDataType::EMSenMessage
       
   683         * Leave codes:
       
   684         *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
       
   685         */
       
   686         virtual MSenMessage& ToSenMessageL() const;
       
   687 
       
   688 
       
   689         /** 
       
   690         * Returns the chunk that is wrapped inside this item.
       
   691         * @return message, but only if this context item was constructed
       
   692         * to hold such data. In case that this item holds some object of different
       
   693         * type instead, the method will leave.
       
   694         * Supported data type(s):
       
   695         *       CSenElement (root) -- TContextItemDataType::ECSenChunk
       
   696         * Leave codes:
       
   697         *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
       
   698         */
       
   699         virtual CSenChunk& ToSenChunkL() const;
       
   700 
       
   701         /** 
       
   702         * Returns the XML element that is wrapped inside this item.
       
   703         * @return XML element, but only if this context item was constructed
       
   704         * to hold such data. In case that this item holds some object of different
       
   705         * type instead, the method will leave.
       
   706         * Supported data type(s):
       
   707         *       CSenXmlReader -- TContextItemDataType::ECSenXmlReader
       
   708         * Leave codes:
       
   709         *       KErrSenContextItemCastMismatch if owned/referenced data type mismatches
       
   710         */
       
   711         virtual CSenXmlReader& ToSenXmlReaderL() const;
       
   712 
       
   713         /**
       
   714         * Function:    ~CSenContextItem
       
   715         *
       
   716         * Description: Destroy the object
       
   717         */
       
   718         IMPORT_C virtual ~CSenContextItem();
       
   719 
       
   720     private:
       
   721 
       
   722         CSenContextItem(TAny* apData, MSenContextItem::TData aType, TInt* apFlags);
       
   723 
       
   724 
       
   725     private: // Data
       
   726 
       
   727         // This pointer holds the actual data wrapped by this context item:´
       
   728         TAny* ipData;
       
   729         // This member specifies the item class-type:
       
   730         MSenContextItem::TData iType;
       
   731         // This pointer holds information about data; whether it is owned or not, etc.
       
   732         TInt* ipFlags;
       
   733     };
       
   734 #endif // SEN_CONTEXT_ITEM_H
       
   735 
       
   736 // End of File