webservices/wsframework/inc/senhandlerbase.h
changeset 0 62f9d29f7211
equal deleted inserted replaced
-1:000000000000 0:62f9d29f7211
       
     1 /*
       
     2 * Copyright (c) 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:        Abstract class providing CBase 
       
    15 *                functionality on top of MSenHandler
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 #ifndef SEN_HANDLER_BASE_H
       
    28 #define SEN_HANDLER_BASE_H
       
    29 
       
    30 // INCLUDES
       
    31 #include <e32std.h>
       
    32 #include <e32base.h> // for CActive
       
    33 #include <SenBaseFragment.h>
       
    34 #include "msenhandler.h"
       
    35 #include "msenhandlercontext.h"
       
    36 
       
    37 // FORWARD DECLARATIONS
       
    38 class MSenHandlerContext;
       
    39 
       
    40 
       
    41 // CLASS DECLARATION
       
    42 /**
       
    43 * This base class makes it possible to create a "Handler Factory",
       
    44 * which may produce instances of different CSenHandlerBase subclasses.
       
    45 * [ It even might be useful to be able to create both ECOM and non-ECOM
       
    46 *   versions of handlers, if such factory pattern is further utilized.]
       
    47 *
       
    48 * Mainly, this abstract class exists to offer re-usable basic functionality
       
    49 * to its direct subclasses. Functionality includes default handling of
       
    50 * MSenHandlerContext properties, and base functions and "services".
       
    51 */
       
    52 class CSenHandlerBase : public CSenBaseFragment, public MSenHandler
       
    53     {
       
    54     public:
       
    55         /**
       
    56         * C++ destructor
       
    57         */
       
    58         IMPORT_C virtual ~CSenHandlerBase();
       
    59 
       
    60         /**
       
    61         * Handlers must also be capable to represent their structure and state 
       
    62         * (type, direction and phase) in UCS8 XML form. This can be achieved either 
       
    63         * by overriding this method, or by deriving from xml fragment class, like
       
    64         * CSenBaseFragment.
       
    65         * 
       
    66         * @param aWs is the stream where to write UCS8 (UTF-8) XML document into.
       
    67         */
       
    68         IMPORT_C virtual void WriteAsXMLToL(RWriteStream& aWs);
       
    69         
       
    70         /**
       
    71         * This method returns an XML document that will include handler types, direction, phase and name.
       
    72         * 
       
    73         * @return UCS8 (UTF-8) XML document representation of this handler.
       
    74         */
       
    75         IMPORT_C virtual HBufC8* AsXmlL();
       
    76 
       
    77     protected:
       
    78         /**
       
    79         * C++ constructor
       
    80         */
       
    81         IMPORT_C CSenHandlerBase();
       
    82 
       
    83         /**
       
    84         * Default mechanism for processing received handler specific context.
       
    85         * Typically, handlers receive their context as construction phase
       
    86         * argument.
       
    87         * 
       
    88         * @param aCtx The context that contains the configuration description of the handler.
       
    89         */
       
    90         IMPORT_C virtual void ProcessHandlerContextL(MSenHandlerContext& aCtx);
       
    91     };
       
    92 
       
    93 #endif // SEN_HANDLER_BASE_H
       
    94 
       
    95 // End of File