epoc32/include/mw/AknsFrameBackgroundControlContext.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@4
     1
/*
williamr@4
     2
* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
williamr@4
     3
* All rights reserved.
williamr@4
     4
* This component and the accompanying materials are made available
williamr@4
     5
* under the terms of "Eclipse Public License v1.0"
williamr@4
     6
* which accompanies this distribution, and is available
williamr@4
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@4
     8
*
williamr@4
     9
* Initial Contributors:
williamr@4
    10
* Nokia Corporation - initial contribution.
williamr@4
    11
*
williamr@4
    12
* Contributors:
williamr@4
    13
*
williamr@4
    14
* Description:  Defines a concrete public class 
williamr@4
    15
*                CAknsFrameBackgroundControlContext.
williamr@4
    16
*
williamr@4
    17
*/
williamr@4
    18
williamr@4
    19
williamr@4
    20
#ifndef AKNSFRAMEBACKGROUNDCONTROLCONTEXT_H
williamr@4
    21
#define AKNSFRAMEBACKGROUNDCONTROLCONTEXT_H
williamr@4
    22
williamr@4
    23
//  INCLUDES
williamr@4
    24
#include <AknsLayeredBackgroundControlContext.h>
williamr@4
    25
williamr@4
    26
// CLASS DECLARATION
williamr@4
    27
williamr@4
    28
/**
williamr@4
    29
*  Implementation of a control context that provides a layout background 
williamr@4
    30
*  generated from a frame item.
williamr@4
    31
*
williamr@4
    32
*  This is a public class with exported functions.
williamr@4
    33
*  The class is not intended for derivation outside the library.
williamr@4
    34
*
williamr@4
    35
*  @lib AknSkins.lib
williamr@4
    36
*
williamr@4
    37
*  @since 2.0
williamr@4
    38
*/
williamr@4
    39
NONSHARABLE_CLASS(CAknsFrameBackgroundControlContext) : 
williamr@4
    40
    public CAknsLayeredBackgroundControlContext
williamr@4
    41
    {
williamr@4
    42
    public:  // Constructors and destructor
williamr@4
    43
        
williamr@4
    44
        /**
williamr@4
    45
        * Two-phased constructor.
williamr@4
    46
        *
williamr@4
    47
        * @since 2.0
williamr@4
    48
        *
williamr@4
    49
        * @param aFrameID Item ID of the entire frame.
williamr@4
    50
        *
williamr@4
    51
        * @param aOuterRect Outer rectangle of the frame.
williamr@4
    52
        *
williamr@4
    53
        * @param aInnerRect Inner rectangle of the frame.
williamr@4
    54
        *
williamr@4
    55
        * @param aParentAbsolute ETrue if parent absolute layout should be
williamr@4
    56
        *   used, EFalse otherwise. If a parent absolute layout is used,
williamr@4
    57
        *   the parent position must be set and updated using SetParentPos.
williamr@4
    58
        *
williamr@4
    59
        * @return Newly constructed object.
williamr@4
    60
        */
williamr@4
    61
        IMPORT_C static CAknsFrameBackgroundControlContext* NewL(
williamr@4
    62
            const TAknsItemID& aFrameID, const TRect& aOuterRect, 
williamr@4
    63
            const TRect& aInnerRect, const TBool aParentAbsolute );
williamr@4
    64
        
williamr@4
    65
        /**
williamr@4
    66
        * Destructor.
williamr@4
    67
        */
williamr@4
    68
        virtual ~CAknsFrameBackgroundControlContext();
williamr@4
    69
williamr@4
    70
    public: // New functions
williamr@4
    71
        
williamr@4
    72
        /**
williamr@4
    73
        * Reconstructs the entire frame from the given item ID.
williamr@4
    74
        *
williamr@4
    75
        * @since 2.0
williamr@4
    76
        *
williamr@4
    77
        * @param aID Item ID of the entire frame.
williamr@4
    78
        */
williamr@4
    79
        IMPORT_C void SetFrame( const TAknsItemID& aFrameID );
williamr@4
    80
williamr@4
    81
        /**
williamr@4
    82
        * Sets the outer and the inner rectangles of the frame. 
williamr@4
    83
        *
williamr@4
    84
        * @since 2.0
williamr@4
    85
        *
williamr@4
    86
        * @param aOuterRect The outer rectangle of the frame.
williamr@4
    87
        *
williamr@4
    88
        * @param aInnerRect The inner rectangle of the frame.
williamr@4
    89
        */
williamr@4
    90
        IMPORT_C void SetFrameRects( const TRect& aOuterRect, 
williamr@4
    91
            const TRect& aInnerRect );
williamr@4
    92
williamr@4
    93
        /**
williamr@4
    94
        * Overrides the center part of the frame.
williamr@4
    95
        *
williamr@4
    96
        * @since 2.0
williamr@4
    97
        *
williamr@4
    98
        * @param aID Item ID of the center part to be used.
williamr@4
    99
        */
williamr@4
   100
        IMPORT_C void SetCenter( const TAknsItemID& aID );
williamr@4
   101
williamr@4
   102
        /**
williamr@4
   103
        * Sets the rectangle of a single part of the frame.
williamr@4
   104
        *
williamr@4
   105
        * @since 2.0
williamr@4
   106
        *
williamr@4
   107
        * @param aRect Rectangle of the specific part of the frame.
williamr@4
   108
        *
williamr@4
   109
        * @param aFrameElement Element (index) of the frame element 
williamr@4
   110
        *   to which the rectangle is applied.
williamr@4
   111
        *
williamr@4
   112
        */
williamr@4
   113
        IMPORT_C void SetFramePartRect( const TRect& aRect,
williamr@4
   114
            const TAknsFrameElementIndex aFrameElement );
williamr@4
   115
williamr@4
   116
    public: // From MAknsControlContext
williamr@4
   117
williamr@4
   118
        /**
williamr@4
   119
        * @copydoc MAknsControlContext::IsCompatibleWithType
williamr@4
   120
        */
williamr@4
   121
        TBool IsCompatibleWithType( const TAknsControlContextType aType ) const;
williamr@4
   122
williamr@4
   123
        /**
williamr@4
   124
        * Updates the control context, if necessary.
williamr@4
   125
        * This method is called by the framework before drawing with the 
williamr@4
   126
        * context.
williamr@4
   127
        *
williamr@4
   128
        * Implementation in CAknsFrameBackgroundControlContext updates the
williamr@4
   129
        * items to ensure that transition between single-bitmap and 
williamr@4
   130
        * multi-bitmap frames work as expected.
williamr@4
   131
        *
williamr@4
   132
        * @since 2.6
williamr@4
   133
        *
williamr@4
   134
        * @return Return value reserved for future use. Currently returns 0.
williamr@4
   135
        */
williamr@4
   136
        TInt UpdateContext();
williamr@4
   137
williamr@4
   138
    protected: // New methods
williamr@4
   139
williamr@4
   140
        /**
williamr@4
   141
        * Updates the type-dependant parameters of the frame.
williamr@4
   142
        *
williamr@4
   143
        * @since 2.6
williamr@4
   144
        *
williamr@4
   145
        * @internal
williamr@4
   146
        */
williamr@4
   147
        void UpdateFrame();
williamr@4
   148
        
williamr@4
   149
    protected:
williamr@4
   150
williamr@4
   151
        /**
williamr@4
   152
        * C++ constructor.
williamr@4
   153
        */
williamr@4
   154
        CAknsFrameBackgroundControlContext();
williamr@4
   155
williamr@4
   156
        /**
williamr@4
   157
        * Symbian 2nd phase constructor.
williamr@4
   158
        */
williamr@4
   159
        void ConstructL( const TAknsItemID& aFrameID, const TRect& aOuterRect, 
williamr@4
   160
            const TRect& aInnerRect, const TBool aParentAbsolute );
williamr@4
   161
williamr@4
   162
    protected: // Data
williamr@4
   163
        TAknsItemID iFrameID;
williamr@4
   164
        TAknsItemID iCenterID;
williamr@4
   165
williamr@4
   166
        TRect iInnerRect;
williamr@4
   167
        TRect iOuterRect;
williamr@4
   168
williamr@4
   169
        TBool iSingleElementFrame;
williamr@4
   170
williamr@4
   171
    };
williamr@4
   172
williamr@4
   173
#endif      // AKNSFRAMEBACKGROUNDCONTROLCONTEXT_H
williamr@4
   174
            
williamr@4
   175
// End of File