calendarui/views/src/calendrawutils.cpp
branchRCL_3
changeset 66 bd7edf625bdd
parent 0 f979ecb2b13e
equal deleted inserted replaced
65:12af337248b1 66:bd7edf625bdd
       
     1 /*
       
     2 * Copyright (c) 2002 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:   Drawing utilities for Arabic and Hebrew layout
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 //debug
       
    21 #include "calendarui_debug.h"
       
    22 
       
    23 // INCLUDE FILES
       
    24 #include "calendrawutils.h"
       
    25 
       
    26 #include <AknsDrawUtils.h>
       
    27 #include <AknIconUtils.h>
       
    28 #include <AknUtils.h>
       
    29 #include <gulicon.h>
       
    30 #include <w32std.h>
       
    31 
       
    32 
       
    33 // ================= MEMBER FUNCTIONS =======================
       
    34 
       
    35 // ---------------------------------------------------------
       
    36 // CalenDrawUtils::TextPos
       
    37 // (other items were commented in a header).
       
    38 // ---------------------------------------------------------
       
    39 //
       
    40 void CalenDrawUtils::TextPos(TPoint* aResultArray, const TAknTextLineLayout& aLayout, TSize aItemSize)
       
    41     {
       
    42     TRACE_ENTRY_POINT;
       
    43     
       
    44     TRect itemRect( TPoint(0,0), aItemSize );
       
    45     TAknLayoutText layout;
       
    46     layout.LayoutText( itemRect, aLayout );
       
    47     aResultArray[0] = layout.TextRect().iTl;
       
    48     aResultArray[1] = layout.TextRect().iBr;
       
    49     
       
    50     TRACE_EXIT_POINT;
       
    51     }
       
    52 
       
    53 // ---------------------------------------------------------
       
    54 // CalenDrawUtils::GfxPos
       
    55 // (other items were commented in a header).
       
    56 // ---------------------------------------------------------
       
    57 //
       
    58 void CalenDrawUtils::GfxPos(TPoint* aResultArray, const TAknWindowLineLayout& aLayout, TSize aItemSize)
       
    59     {
       
    60     TRACE_ENTRY_POINT;
       
    61     
       
    62     TRect itemRect( TPoint(0,0), aItemSize );
       
    63     TAknLayoutRect layout;
       
    64     layout.LayoutRect( itemRect, aLayout );
       
    65     aResultArray[0] = layout.Rect().iTl;
       
    66     aResultArray[1] = layout.Rect().iBr;
       
    67     
       
    68     TRACE_EXIT_POINT;
       
    69     }
       
    70 
       
    71 // -----------------------------------------------------------------------------
       
    72 // ?classname::?member_function
       
    73 // ?implementation_description
       
    74 // (other items were commented in a header).
       
    75 // -----------------------------------------------------------------------------
       
    76 //
       
    77 void CalenDrawUtils::SetIconSizes(const TAknLayoutRect& aIconLayout, 
       
    78                                   CArrayPtr<CGulIcon>* aIconArray)
       
    79     {
       
    80     TRACE_ENTRY_POINT;
       
    81     
       
    82     if (aIconArray) // this can be done only if iconarray is set
       
    83         {
       
    84         TInt iconCount( aIconArray->Count() );
       
    85         for( TInt i(0); i < iconCount; ++i )
       
    86             {
       
    87             // note  AknIconUtils::SetSize sets both mask and bitmap size.
       
    88             // regardless which is given.
       
    89             AknIconUtils::SetSize( (*aIconArray)[i]->Bitmap(), aIconLayout.Rect().Size() );
       
    90             }
       
    91         }
       
    92     
       
    93     TRACE_EXIT_POINT;
       
    94     }
       
    95 
       
    96 
       
    97 // End of file