epoc32/include/mw/aknsdatacontext.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
     1.1 --- a/epoc32/include/mw/aknsdatacontext.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/mw/aknsdatacontext.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,138 @@
     1.4 -aknsdatacontext.h
     1.5 +/*
     1.6 +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
     1.7 +* All rights reserved.
     1.8 +* This component and the accompanying materials are made available
     1.9 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
    1.10 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors:
    1.17 +*
    1.18 +* Description:  Defines a public interface class MAknsDataContext.
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +#ifndef AKNSDATACONTEXT_H
    1.24 +#define AKNSDATACONTEXT_H
    1.25 +
    1.26 +//  INCLUDES
    1.27 +#include <AknsConstants.h>
    1.28 +#include <AknsItemID.h>
    1.29 +#include <coemop.h>
    1.30 +
    1.31 +// CLASS DECLARATION
    1.32 +
    1.33 +/**
    1.34 +* Interface that provides context sensitive control over data allocation.
    1.35 +* MAknsDataContext can be used to indicate need for specific skin items
    1.36 +* and thus to ensure that they are allocated before first use.
    1.37 +*
    1.38 +* This is a public class with exported functions.
    1.39 +* The class is not usually intended for user derivation - concrete classes
    1.40 +* implementing the interface are provided by the library.
    1.41 +* See @c AknsUtils::CreateDataContextForContainerL() for further 
    1.42 +* details.
    1.43 +*
    1.44 +* @lib AknSkins.lib
    1.45 +*
    1.46 +* @since 2.0
    1.47 +*/
    1.48 +class MAknsDataContext 
    1.49 +    {
    1.50 +    public: // Type UID
    1.51 +        /**         
    1.52 +        * Type ID declaration.
    1.53 +        * Type ID is used to make it possible to retrieve data context
    1.54 +        * through @c MObjectProvider::MopSupplyObject interface.
    1.55 +        */
    1.56 +        DECLARE_TYPE_ID(0x10005a28)
    1.57 +
    1.58 +    public:  // Constructors and destructor    
    1.59 +
    1.60 +        /**
    1.61 +        * Destructor.
    1.62 +        * Destructor is only provided to enable deletion using base class
    1.63 +        * pointer. Caller should never delete context retrieved using
    1.64 +        * @c MObjectProvider interface.
    1.65 +        */
    1.66 +        inline virtual ~MAknsDataContext() {}
    1.67 +        
    1.68 +    public: // New functions
    1.69 +
    1.70 +        /**
    1.71 +        * Reserves and allocates specified item.
    1.72 +        * Instructs the data context that the specified item will be used
    1.73 +        * by caller and should be allocated and cached by skin instance.
    1.74 +        * Any control using cached skin items should reserve them, preferably
    1.75 +        * in @c ConstructL(), by calling this method.
    1.76 +        * Note that reservation does not guarantee that the item will be
    1.77 +        * available in cache - it's only a tentative request for allocation.
    1.78 +        *
    1.79 +        * @since 2.0
    1.80 +        *
    1.81 +        * @param aID Item ID of the item to be reserved.
    1.82 +        *
    1.83 +        * @par Exceptions:
    1.84 +        *   If item data allocation fails, function leaves with error code.
    1.85 +        */
    1.86 +        virtual void ReserveItemL( const TAknsItemID& aID ) =0;
    1.87 +
    1.88 +		/**
    1.89 +        * Indicates that specified item will no longer be used.
    1.90 +        * Instructs the data context that the specified item will not
    1.91 +        * be used by caller anymore. Exact behavior (e.g. whether cached
    1.92 +        * instance is deallocated) depends on the cache policy of data
    1.93 +        * context and skin instance. Controls should not usually call this
    1.94 +        * method, but instead allow data context (in most cases implemented
    1.95 +        * by a container) go out of scope. 
    1.96 +        *
    1.97 +        * @since 2.0
    1.98 +        * 
    1.99 +        * @param aID Item ID of the item to be released.
   1.100 +        */
   1.101 +        virtual void ReleaseItem( const TAknsItemID& aID ) =0;
   1.102 +
   1.103 +    protected: // Reserved virtual functions
   1.104 +
   1.105 +        /**
   1.106 +        * Reserved for future use.
   1.107 +        *
   1.108 +        * @since 2.0
   1.109 +        */
   1.110 +        virtual TInt Reserved1();
   1.111 +
   1.112 +        /**
   1.113 +        * Reserved for future use.
   1.114 +        *
   1.115 +        * @since 2.0
   1.116 +        */
   1.117 +        virtual TInt Reserved2();
   1.118 +
   1.119 +    public: // New functions
   1.120 +
   1.121 +        /**
   1.122 +        * Returns type UID pointer that can be used in MopSupplyObject.
   1.123 +        *
   1.124 +        * @since 2.0
   1.125 +        *
   1.126 +        * @param aId Type UID, should be the same that was given as aId
   1.127 +        *   parameter of MopSupplyObject.
   1.128 +        *
   1.129 +        * @param aContext Pointer to an MAknsDataContext instance.
   1.130 +        *
   1.131 +        * @return Type UID pointer containing aContext, or @c NULL type UID
   1.132 +        *   pointer if given type UID does not match MAknsDataContext or
   1.133 +        *   aContext is @c NULL.
   1.134 +        */
   1.135 +        IMPORT_C static TTypeUid::Ptr SupplyMopObject( TTypeUid aId, 
   1.136 +            MAknsDataContext* aContext );
   1.137 +
   1.138 +    };
   1.139 +
   1.140 +#endif // AKNSDATACONTEXT_H
   1.141 +            
   1.142 +// End of File