epoc32/include/mw/aknscontrolcontext.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@2
     5
* 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
williamr@2
     6
* which accompanies this distribution, and is available
williamr@2
     7
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description:  Defines a public interface class MAknsControlContext and 
williamr@2
    15
*                related enumerations.
williamr@2
    16
*
williamr@2
    17
*/
williamr@2
    18
williamr@2
    19
williamr@2
    20
#ifndef AKNSCONTROLCONTEXT_H
williamr@2
    21
#define AKNSCONTROLCONTEXT_H
williamr@2
    22
williamr@2
    23
//  INCLUDES
williamr@2
    24
#include <AknsConstants.h>
williamr@2
    25
#include <AknsItemID.h>
williamr@2
    26
#include <coemop.h>
williamr@2
    27
williamr@2
    28
// DATA TYPES
williamr@2
    29
williamr@2
    30
/** 
williamr@2
    31
* Skin parameter types for MAknsControlContext::SupplySkinParameter.
williamr@2
    32
*
williamr@2
    33
* @since 2.0
williamr@2
    34
*/
williamr@2
    35
enum TAknsCCParameter
williamr@2
    36
    {
williamr@2
    37
    // This enumeration is intentionally empty.
williamr@2
    38
    };
williamr@2
    39
williamr@2
    40
/** 
williamr@2
    41
* Values for skin object types (given as aObject parameter for 
williamr@2
    42
* MAknsControlContext::SupplySkinObject).
williamr@2
    43
*
williamr@2
    44
* @since 2.0
williamr@2
    45
*/
williamr@2
    46
enum TAknsCCObject
williamr@2
    47
    {
williamr@2
    48
williamr@2
    49
    /**
williamr@2
    50
    * Item ID for layout background.
williamr@2
    51
    *
williamr@2
    52
    * MAknsControlContext::SupplySkinObject
williamr@2
    53
    * should return a pointer to TAknsBackground or @c NULL (default used).
williamr@2
    54
    *
williamr@2
    55
    * @since 2.0
williamr@2
    56
    */
williamr@2
    57
    EAknsCCOBackground              = 0,
williamr@2
    58
    
williamr@2
    59
    /**
williamr@2
    60
    * Pointer to parent context.
williamr@2
    61
    *
williamr@2
    62
    * MAknsControlContext::SupplySkinObject
williamr@2
    63
    * should return a pointer to the parent context (of type 
williamr@2
    64
    * @c MAknsControlContext) or @c NULL (no parent context).
williamr@2
    65
    *
williamr@2
    66
    * @since 2.6
williamr@2
    67
    */
williamr@2
    68
    EAknsCCOParentContext           = 1
williamr@2
    69
    };
williamr@2
    70
williamr@2
    71
/**
williamr@2
    72
* Control context type enumeration.
williamr@2
    73
*
williamr@2
    74
* @since 2.0
williamr@2
    75
*/
williamr@2
    76
enum TAknsControlContextType
williamr@2
    77
    {
williamr@2
    78
williamr@2
    79
    /**
williamr@2
    80
    * Unknown type. The control context can only be assumed to be compatible
williamr@2
    81
    * with MAknsControlContext.
williamr@2
    82
    *
williamr@2
    83
    * @since 2.0
williamr@2
    84
    */
williamr@2
    85
    EAknsControlContextTypeUnknown  = 0,
williamr@2
    86
williamr@2
    87
    /**
williamr@2
    88
    * The control context type for CAknsBasicBackgroundControlContext
williamr@2
    89
    * (and derived types).
williamr@2
    90
    *
williamr@2
    91
    * @since 2.0
williamr@2
    92
    */
williamr@2
    93
    EAknsControlContextTypeBasic    = 1,
williamr@2
    94
williamr@2
    95
    /**
williamr@2
    96
    * The control context type for CAknsLayeredBackgroundControlContext
williamr@2
    97
    * (and derived types).
williamr@2
    98
    *
williamr@2
    99
    * @since 2.0
williamr@2
   100
    */
williamr@2
   101
    EAknsControlContextTypeLayered  = 2,
williamr@2
   102
williamr@2
   103
    /**
williamr@2
   104
    * The control context type for CAknsListBoxBackgroundControlContext
williamr@2
   105
    * (and derived types).
williamr@2
   106
    *
williamr@2
   107
    * @since 2.0
williamr@2
   108
    */
williamr@2
   109
    EAknsControlContextTypeListBox  = 3,
williamr@2
   110
williamr@2
   111
    /**
williamr@2
   112
    * The control context type for CAknsFrameBackgroundControlContext
williamr@2
   113
    * (and derived types).
williamr@2
   114
    *
williamr@2
   115
    * @since 2.0
williamr@2
   116
    */
williamr@2
   117
    EAknsControlContextTypeFrame    = 4,
williamr@2
   118
williamr@2
   119
    /**
williamr@2
   120
    * The control context type for CAknsCombinedBackgroundControlContext
williamr@2
   121
    * (and derived types).
williamr@2
   122
    *
williamr@2
   123
    * @since 3.2
williamr@2
   124
    */
williamr@2
   125
    EAknsControlContextTypeCombined = 5,
williamr@2
   126
williamr@2
   127
    /**
williamr@2
   128
    * The control context type for CAknsMaskedFrameBackgroundControlContext
williamr@2
   129
    * (and derived types).
williamr@2
   130
    *
williamr@2
   131
    * @since 3.2
williamr@2
   132
    */
williamr@2
   133
    EAknsControlContextTypeMasked = 6
williamr@2
   134
    };
williamr@2
   135
williamr@2
   136
// CLASS DECLARATIONS
williamr@2
   137
williamr@2
   138
/**
williamr@2
   139
* Interface that provides context specific skin parameters.
williamr@2
   140
* This interface is used by AknsDrawUtils to query context specific parameters,
williamr@2
   141
* such as background override. Application should instantiate a class that 
williamr@2
   142
* implements this interface and provide pointer to it using 
williamr@2
   143
* @c MObjectProvider::MopSupplyObject in the appropriate control. 
williamr@2
   144
*
williamr@2
   145
* This is a public class with exported functions.
williamr@2
   146
* The class is not intended for user derivation - concrete classes implementing
williamr@2
   147
* the interface are provided by the library. See 
williamr@2
   148
* @c CAknsBasicBackgroundControlContext and 
williamr@2
   149
* @c CAknsListBoxBackgroundControlContext for further details.
williamr@2
   150
*
williamr@2
   151
* @lib AknSkins.lib
williamr@2
   152
*
williamr@2
   153
* @since 2.0
williamr@2
   154
*/
williamr@2
   155
class MAknsControlContext
williamr@2
   156
    {
williamr@2
   157
    public: // Type UID
williamr@2
   158
        /**         
williamr@2
   159
        * Type ID declaration.
williamr@2
   160
        * Type ID is used to make it possible to retrieve control context
williamr@2
   161
        * through @c MObjectProvider::MopSupplyObject interface.        
williamr@2
   162
        */
williamr@2
   163
        DECLARE_TYPE_ID(0x10005a29)
williamr@2
   164
williamr@2
   165
    public: // Destructor
williamr@2
   166
williamr@2
   167
        /**
williamr@2
   168
        * Destructor.
williamr@2
   169
        * Destructor is provided only to enable deletion using base class
williamr@2
   170
        * pointer. Caller should never delete control context retrieved through
williamr@2
   171
        * @c MObjectProvider interface.
williamr@2
   172
        */
williamr@2
   173
        inline virtual ~MAknsControlContext() {}
williamr@2
   174
williamr@2
   175
    public: // New functions
williamr@2
   176
williamr@2
   177
        /**
williamr@2
   178
        * Provides context specific integer parameter.
williamr@2
   179
        *
williamr@2
   180
        * @since 2.0
williamr@2
   181
        *
williamr@2
   182
        * @param aParam Type of the parameter to be retrieved. Possible values
williamr@2
   183
        *   are defined in ::TAknsCCParameter enumeration.
williamr@2
   184
        *
williamr@2
   185
        * @return Integer value as defined in ::TAknsCCParameter for the 
williamr@2
   186
        *   particular parameter. For unknown or unhandled values zero must be
williamr@2
   187
        *   returned.        
williamr@2
   188
        */
williamr@2
   189
        virtual TInt SupplySkinParameter( TAknsCCParameter aParam ) =0;
williamr@2
   190
williamr@2
   191
        /**
williamr@2
   192
        * Provides context specific object.
williamr@2
   193
        *
williamr@2
   194
        * @since 2.0
williamr@2
   195
        *
williamr@2
   196
        * @param aObject Type of the object to be retrieved. Possible values 
williamr@2
   197
        *   are defined in ::TAknsCCObject enumeration.
williamr@2
   198
        *
williamr@2
   199
        * @return Pointer to object as defined in ::TAknsCCObject for that 
williamr@2
   200
        *   specific aObject parameter value. For unknown or unhandled values
williamr@2
   201
        *   @c NULL must be returned.        
williamr@2
   202
        */
williamr@2
   203
        virtual TAny* SupplySkinObject( TAknsCCObject aObject ) =0;
williamr@2
   204
williamr@2
   205
        /**
williamr@2
   206
        * Determines whether this control context is compatible with the
williamr@2
   207
        * given derived type.
williamr@2
   208
        *
williamr@2
   209
        * @since 2.0
williamr@2
   210
        *
williamr@2
   211
        * @param aType Type of the derived control context class (one of
williamr@2
   212
        *   the values in TAknsControlContextType).
williamr@2
   213
        *
williamr@2
   214
        * @return ETrue if this control context instance is compatible with
williamr@2
   215
        *   the given type (i.e. can be casted to the corresponding concrete
williamr@2
   216
        *   class). EFalse otherwise.
williamr@2
   217
        */
williamr@2
   218
        virtual TBool IsCompatibleWithType( 
williamr@2
   219
            const TAknsControlContextType aType ) const =0;
williamr@2
   220
williamr@2
   221
        /**
williamr@2
   222
        * Updates the control context, if necessary.
williamr@2
   223
        * This method is called by the framework before drawing with the 
williamr@2
   224
        * context.
williamr@2
   225
        *
williamr@2
   226
        * Base class implementation returns 0.
williamr@2
   227
        *
williamr@2
   228
        * @since 2.6
williamr@2
   229
        *
williamr@2
   230
        * @return Return value reserved for future use. Currently returns 0.
williamr@2
   231
        */
williamr@2
   232
        virtual TInt UpdateContext();
williamr@2
   233
williamr@2
   234
    protected: // Reserved virtual functions
williamr@2
   235
williamr@2
   236
        /**
williamr@2
   237
        * Reserved for future use.
williamr@2
   238
        *
williamr@2
   239
        * @since 2.0
williamr@2
   240
        */
williamr@2
   241
        virtual TInt Reserved2();
williamr@2
   242
williamr@2
   243
    public: // New functions
williamr@2
   244
williamr@2
   245
        /**
williamr@2
   246
        * Returns type UID pointer that can be used in MopSupplyObject.
williamr@2
   247
        *
williamr@2
   248
        * @since 2.0
williamr@2
   249
        *
williamr@2
   250
        * @param aId Type UID, should be the same that was given as aId
williamr@2
   251
        *   parameter of MopSupplyObject.
williamr@2
   252
        *
williamr@2
   253
        * @param aContext Pointer to an MAknsControlContext instance.
williamr@2
   254
        *
williamr@2
   255
        * @return Type UID pointer containing aContext, or @c NULL type UID
williamr@2
   256
        *   pointer if given type UID does not match MAknsControlContext or
williamr@2
   257
        *   aContext is @c NULL.
williamr@2
   258
        */
williamr@2
   259
        IMPORT_C static TTypeUid::Ptr SupplyMopObject( TTypeUid aId, 
williamr@2
   260
            MAknsControlContext* aContext );
williamr@2
   261
williamr@2
   262
    };
williamr@2
   263
williamr@2
   264
#endif      // AKNSCONTROLCONTEXT_H   
williamr@2
   265
williamr@2
   266
// End of File