webservices/wsstar/wsstarplugin/src/wsstarhandlercontext.cpp
changeset 0 62f9d29f7211
equal deleted inserted replaced
-1:000000000000 0:62f9d29f7211
       
     1 /*
       
     2 * Copyright (c) 2006-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:        
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 #include "wsstarhandlercontext.h"
       
    26 CWSStarHandlerContext* CWSStarHandlerContext::NewL()
       
    27     {
       
    28     CWSStarHandlerContext* self = new (ELeave) CWSStarHandlerContext();
       
    29     CleanupStack::PushL (self);
       
    30     self->ConstructL();
       
    31     CleanupStack::Pop(self);
       
    32     return self;
       
    33     }
       
    34 
       
    35 // Constructor
       
    36 CWSStarHandlerContext::CWSStarHandlerContext():
       
    37     iCoreServiceManager(NULL),
       
    38     iWSStarPlugin(NULL),
       
    39     iLogger(NULL)
       
    40     {
       
    41     }
       
    42 
       
    43 // Constructor
       
    44 void CWSStarHandlerContext::ConstructL()
       
    45     {
       
    46     }
       
    47 
       
    48 
       
    49 // Destructor
       
    50 CWSStarHandlerContext::~CWSStarHandlerContext()
       
    51     {
       
    52     delete iVersion;
       
    53     }
       
    54 
       
    55 //from HandlerContext        
       
    56 TInt CWSStarHandlerContext::Add(MSenCoreServiceManager& aValue)
       
    57     {
       
    58     iCoreServiceManager = &aValue;
       
    59     return KErrNone;
       
    60     }
       
    61 
       
    62 MSenCoreServiceManager* CWSStarHandlerContext::GetSenCoreServiceManager()
       
    63     {
       
    64     return iCoreServiceManager;
       
    65     }
       
    66 
       
    67 
       
    68 
       
    69 //from MContext      
       
    70 SenContext::TContextType CWSStarHandlerContext::Type() const
       
    71     {
       
    72     return SenContext::EHandlerContext;
       
    73     }
       
    74 SenContext::TContextDirection CWSStarHandlerContext::Direction() const
       
    75     {
       
    76     return SenContext::EBoth;
       
    77     }
       
    78 TInt CWSStarHandlerContext::Add(const TDesC8& /*aKey*/, const TDesC8& /*aValue*/)
       
    79     {
       
    80     return KErrNotSupported;
       
    81     }
       
    82 TInt CWSStarHandlerContext::Update(const TDesC8& aKey, const TDesC8& aValue)
       
    83     {
       
    84     TInt retVal(KErrNone);
       
    85     //version with makeing of copy
       
    86     if (aKey == HandlerContextKey::KVersion)
       
    87         {
       
    88         delete iVersion;
       
    89         iVersion = NULL;
       
    90         TRAP(retVal,iVersion = aValue.AllocL());
       
    91         }
       
    92     else
       
    93         {
       
    94         retVal = KErrNotFound;
       
    95         }
       
    96     return retVal;    
       
    97     }
       
    98 const TDesC8* CWSStarHandlerContext::GetDesC8L(const TDesC8& aKey)
       
    99     {
       
   100     if (aKey == HandlerContextKey::KVersion)
       
   101         {
       
   102         return iVersion;
       
   103         }
       
   104     else
       
   105         {
       
   106         return NULL;
       
   107         }
       
   108     }
       
   109 TInt CWSStarHandlerContext::Add(const TDesC8& /*aKey*/, TInt /*aValue*/)
       
   110     {
       
   111     return KErrNotSupported;
       
   112     }
       
   113 TInt CWSStarHandlerContext::Update(const TDesC8& /*aKey*/, TInt /*aValue*/)
       
   114     {
       
   115     return KErrNotSupported;
       
   116     }
       
   117 const TInt* CWSStarHandlerContext::GetIntL(const TDesC8& /*aKey*/)
       
   118     {
       
   119     return NULL;
       
   120     }
       
   121 TInt CWSStarHandlerContext::Add(const TDesC8& /*aKey*/, CSenElement* /*aValue*/)
       
   122     {
       
   123     return KErrNotSupported;
       
   124     }
       
   125 TInt CWSStarHandlerContext::Update(const TDesC8& /*aKey*/, CSenElement* /*aValue*/)
       
   126     {
       
   127     return KErrNotSupported;
       
   128     }
       
   129 const CSenElement* CWSStarHandlerContext::GetSenElementL(const TDesC8& /*aKey*/)
       
   130     {
       
   131     return NULL;
       
   132     }
       
   133 TInt CWSStarHandlerContext::Add(const TDesC8& aKey, TAny* aValue)
       
   134     {
       
   135     if (aKey == HandlerContextKey::KSIF())
       
   136         {
       
   137         iWSStarPlugin = (CWSStarPlugin*)aValue;
       
   138         return KErrNone;
       
   139         }
       
   140     else if (aKey == HandlerContextKey::KLogger())
       
   141         {
       
   142         iLogger = (RFileLogger*)aValue;
       
   143         return KErrNone;
       
   144         }
       
   145     else
       
   146         {
       
   147         return KErrNotFound;
       
   148         }
       
   149     }
       
   150 
       
   151 TInt CWSStarHandlerContext::Update(const TDesC8& /*aKey*/, TAny* /*aValue*/)
       
   152     {
       
   153     return KErrNotSupported;
       
   154     }
       
   155 TAny* CWSStarHandlerContext::GetAnyL(const TDesC8& aKey)	//codescannerwarnings
       
   156     {
       
   157      if (aKey == HandlerContextKey::KSIF())
       
   158         {
       
   159         return (TAny*)iWSStarPlugin;
       
   160         }
       
   161      else if (aKey == HandlerContextKey::KLogger())
       
   162         {
       
   163         return (TAny*)iLogger;
       
   164         }
       
   165     else
       
   166         {
       
   167         return NULL;
       
   168         }
       
   169     }
       
   170 
       
   171 const CSenXmlReader* CWSStarHandlerContext::GetParser()
       
   172     {
       
   173     return NULL;
       
   174     }
       
   175 TInt CWSStarHandlerContext::Remove(const TDesC8& /*aKey*/)  
       
   176     {
       
   177     return KErrNotSupported;
       
   178     }
       
   179 TInt CWSStarHandlerContext::Count() const
       
   180     {
       
   181     return KErrNotSupported;
       
   182     }
       
   183 TPtrC8 CWSStarHandlerContext::KeyAtL(TInt /*aIndex*/)   
       
   184     {
       
   185     return KNullDesC8();
       
   186     }
       
   187 void CWSStarHandlerContext::Reset() 
       
   188     {
       
   189     }
       
   190     
       
   191    
       
   192 // END OF FILE