mpxplugins/viewplugins/views/inc/mpxcommonplaybackviewlayout.h
changeset 0 ff3acec5bc43
child 21 a1247965635c
equal deleted inserted replaced
-1:000000000000 0:ff3acec5bc43
       
     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:  An interface providing skin and layout data for common playback view.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CMPXCOMMONPLAYBACKVIEWLAYOUT_H
       
    20 #define CMPXCOMMONPLAYBACKVIEWLAYOUT_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <AknUtils.h>
       
    25 
       
    26 #include "mpxplaybackviewlayoutinterface.h"
       
    27 #include "mpxcommonplaybackviewlayout.h"
       
    28 #include "mpxcommonplaybackviewdefs.h"
       
    29 
       
    30 // CLASS DECLARATION
       
    31 class MAknsSkinInstance;
       
    32 class TAknsItemID;
       
    33 
       
    34 /**
       
    35 *  An interface providing skin and layout data for playback view.
       
    36 *
       
    37 *  @lib mpxplaybackview.dll
       
    38 *  @since S60 v3.0
       
    39 */
       
    40 class CMPXCommonPlaybackViewLayout : public CBase,
       
    41                                      public MMPXPlaybackViewLayout
       
    42     {
       
    43 public:
       
    44 
       
    45     /**
       
    46      * Get layout data for a button.
       
    47      *
       
    48      * @since 3.0
       
    49      * @param aParentRect Parent control's rect
       
    50      * @param aButton Enumeration value identifying the button
       
    51      * @return Layout data
       
    52      */
       
    53     IMPORT_C virtual TRect ButtonLayout(
       
    54         const TRect& aParentRect );
       
    55 
       
    56     /**
       
    57      * Get layout data for an graphical indicator.
       
    58      *
       
    59      * @since 3.0
       
    60      * @param aParentRect Parent control's rect
       
    61      * @param  aIndicator Enumeration value identifying the indicator
       
    62      * @return Layout data
       
    63      */
       
    64     IMPORT_C virtual TRect IndicatorLayout(
       
    65         const TRect& aParentRect,
       
    66         TMPXPbvIndicator aIndicator );
       
    67 
       
    68     /**
       
    69      * Set layout data for a text label.
       
    70      *
       
    71      * @since 3.0
       
    72      * @param aLabel      Label to set the layout to
       
    73      * @param aParentRect Parent rectangle for layout
       
    74      * @param aIndicator  Enumeration value identifying the indicator,
       
    75      * @param aOffsetx    Offset in x direction to apply to label
       
    76      * @param aOffsety    Offset in y direction to apply to label
       
    77      */
       
    78     IMPORT_C virtual void LayoutLabel(
       
    79         CEikLabel* aLabel,
       
    80         const TRect& aParentRect,
       
    81         TMPXPbvTextIndicator aText,
       
    82         TInt aOffsetx=0,
       
    83         TInt aOffsety=0 );
       
    84 
       
    85     /**
       
    86      * Get the bitmap and mask for a soft button in a given state.
       
    87      *
       
    88      * @since 3.0
       
    89      * @param  aButton      Enumeration value identifying the button.
       
    90      * @param  aButtonState State of the button
       
    91      * @param  aBitmap      Reference to a CFbsBitmap pointer to receive
       
    92      *                      the requested bitmap pointer. Ownership is
       
    93      *                      transferred to the caller.
       
    94      * @param  aMask        Reference to a CFbsBitmap pointer to receive
       
    95      *                      the mask of the requested bitmap. Ownership is
       
    96      *                      transferred to the caller.
       
    97      */
       
    98     IMPORT_C virtual void GetButtonBitmapsL(
       
    99         TMPXPbvButton aButton,
       
   100         TInt aButtonState,
       
   101         CFbsBitmap*& aBitmap,
       
   102         CFbsBitmap*& aMask );
       
   103 
       
   104     /**
       
   105      * Get the bitmap and mask for a given indicator.
       
   106      *
       
   107      * @since 3.0
       
   108      * @param  aIndicator   Enumeration value identifying the indicator
       
   109      * @return CGulIcon     Indicator graphic and mask. Ownership
       
   110      *                      transferred to caller.
       
   111      */
       
   112     IMPORT_C virtual CGulIcon* GetIndicatorIconMaskL(
       
   113         TMPXPbvIndicator aIndicator );
       
   114 
       
   115 protected:
       
   116 
       
   117     /**
       
   118      * Create a color-skinned icon.
       
   119      *
       
   120      * @param aSkin Pointer to the current skin instance.
       
   121      * @param aIconSkinId Item ID of the masked bitmap to be created.
       
   122      * @param aColorId Item ID of the color table.
       
   123      * @param aColorIndex Index in the color table.
       
   124      * @param aBitmapFilename Filename to be used to construct the item.
       
   125      * @param aFileBitmapId ID of the bitmap in the file.
       
   126      * @param aFileMaskId ID of the mask in the file.
       
   127      */
       
   128     IMPORT_C CGulIcon* CreateColorIconL(
       
   129         MAknsSkinInstance* aSkin,
       
   130         const TAknsItemID& aIconSkinId,
       
   131         const TAknsItemID& aColorId,
       
   132         TInt aColorIndex,
       
   133         const TDesC& aBitmapFilename,
       
   134         TInt aFileBitmapId,
       
   135         TInt aFileMaskId );
       
   136 
       
   137     /**
       
   138      * Layouts the label by reading in the resource values
       
   139      *
       
   140      * @param aLabel      Label to set the layout to
       
   141      * @param aParentRect Parent rectangle for layout
       
   142      * @param aResId      Resource ID to read from
       
   143      * @param aOffsetx    Offset in x direction to apply to label
       
   144      * @param aOffsety    Offset in y direction to apply to label
       
   145      */
       
   146     IMPORT_C void DoLayoutLabelL(
       
   147         CEikLabel* aLabel,
       
   148         const TRect& aParentRect,
       
   149         TInt aResId,
       
   150         TInt aOffsetx,
       
   151         TInt aOffsety );
       
   152 
       
   153 public:
       
   154 	/**
       
   155      * Get layout data for a button.
       
   156      * @since 5.0
       
   157      * @param  aButton Enumeration value identifying the button,
       
   158      * @return Layout data
       
   159      */
       
   160     IMPORT_C virtual TRect ButtonLayout(const TRect& aParentRect,
       
   161                                   TInt aButton);
       
   162 
       
   163 protected:
       
   164 	/**
       
   165      * Determine avkon layout variant
       
   166      * @since 5.0
       
   167      * @return layout variant type
       
   168      */
       
   169     IMPORT_C TMPXPbvLayoutVariants DetermineLayoutVariant();
       
   170 
       
   171 	/**
       
   172      * Get layout data for a text item
       
   173      * @since 5.0
       
   174      * @param  aText Enumeration value identifying the text
       
   175      * @return layout variant id
       
   176      */
       
   177     IMPORT_C TMPXPbvLayoutVariants GetTextVariant(TMPXPbvTextIndicator aText);
       
   178 
       
   179 	/**
       
   180      * Get layout data for an indicator item
       
   181      * @since 5.0
       
   182      * @param  aIndicator Enumeration value identifying the indicator
       
   183      * @return Layout variant id
       
   184      */
       
   185     IMPORT_C TMPXPbvLayoutVariants GetIndicatorVariant(TMPXPbvIndicator aIndicator);
       
   186 
       
   187     };
       
   188 
       
   189 #endif  // CMPXCOMMONPLAYBACKVIEWLAYOUT_H
       
   190 
       
   191 // End of file