uifw/AvKon/src/AknSmileyUtils.cpp
branchRCL_3
changeset 56 d48ab3b357f1
child 72 a5e7a4f63858
equal deleted inserted replaced
55:aecbbf00d063 56:d48ab3b357f1
       
     1 /*
       
     2 * Copyright (c) 2002-2009 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: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "AknSmileyUtils.h"
       
    20 #include "AknSmileyModel.h"
       
    21 
       
    22 
       
    23 
       
    24 ///////////////////////////////////////////////////////////////////////////////////////////////
       
    25 // CAknSmileyIcon
       
    26 ///////////////////////////////////////////////////////////////////////////////////////////////
       
    27 
       
    28 CAknSmileyIcon::CAknSmileyIcon()
       
    29     {
       
    30     
       
    31     }
       
    32 
       
    33 CAknSmileyIcon::~CAknSmileyIcon()
       
    34     {
       
    35     
       
    36     }
       
    37 
       
    38 const CFbsBitmap* CAknSmileyIcon::Image() const
       
    39     {
       
    40     return NULL;
       
    41     }
       
    42 
       
    43 const CFbsBitmap* CAknSmileyIcon::Mask() const
       
    44     {
       
    45     return NULL;
       
    46     }
       
    47 
       
    48 TBool CAknSmileyIcon::ReadyToDraw() const
       
    49     {
       
    50     return FALSE;
       
    51     }
       
    52 
       
    53 const TSize KSize;
       
    54 const TSize& CAknSmileyIcon::Size() const
       
    55     {
       
    56     return KSize;
       
    57     }
       
    58 
       
    59 void CAknSmileyIcon::PlayAnimationL(TInt /*aRepeat*/, TInt /*aDelay*/)
       
    60     {
       
    61 
       
    62     }
       
    63 
       
    64 void CAknSmileyIcon::StopAnimation()
       
    65     {
       
    66 
       
    67     }
       
    68 
       
    69 
       
    70 ///////////////////////////////////////////////////////////////////////////////////////////////
       
    71 // CAknSmileyManager
       
    72 ///////////////////////////////////////////////////////////////////////////////////////////////
       
    73 
       
    74 class CAknSmileyManager::CExtension : public CSmileyModel
       
    75     {
       
    76 public:
       
    77     CExtension(MAknSmileyObserver* aObserver) : CSmileyModel(aObserver) {};
       
    78     };
       
    79 
       
    80 EXPORT_C CAknSmileyManager* CAknSmileyManager::NewL(MAknSmileyObserver* aObserver)
       
    81     {
       
    82     CAknSmileyManager* self = new (ELeave) CAknSmileyManager();
       
    83     CleanupStack::PushL(self);
       
    84     self->ConstructL(aObserver);
       
    85     CleanupStack::Pop(); // self;
       
    86     return self;
       
    87     }
       
    88 
       
    89 void CAknSmileyManager::ConstructL(MAknSmileyObserver* aObserver)
       
    90     {
       
    91     iExtension = new (ELeave) CExtension(aObserver);
       
    92     iExtension->LoadResourceL();
       
    93     }
       
    94 
       
    95 CAknSmileyManager::CAknSmileyManager()
       
    96     {
       
    97     
       
    98     }
       
    99 
       
   100 EXPORT_C CAknSmileyManager::~CAknSmileyManager()
       
   101     {
       
   102     delete iExtension;
       
   103     }
       
   104 
       
   105 EXPORT_C TInt CAknSmileyManager::ConvertCodesToTextL(TDes& aText)
       
   106     {
       
   107     return iExtension->ConvertCodesToTextL(aText);
       
   108     }
       
   109 
       
   110 EXPORT_C TInt CAknSmileyManager::ConvertTextToCodesL(TDes& aText)
       
   111     {
       
   112     return iExtension->ConvertTextToCodesL(aText);
       
   113     }
       
   114 
       
   115 EXPORT_C const TDesC& CAknSmileyManager::Text(TChar aCode) const
       
   116     {
       
   117     return iExtension->Text(aCode);
       
   118     }
       
   119 
       
   120 EXPORT_C TBool CAknSmileyManager::IsSmiley(TChar aCode) const
       
   121     {
       
   122     return iExtension->IsSmiley(aCode);
       
   123     }
       
   124 
       
   125 EXPORT_C void CAknSmileyManager::SetSize(const TSize& aSize)
       
   126     {
       
   127     iExtension->SetSize(aSize);
       
   128     }
       
   129 
       
   130 EXPORT_C void CAknSmileyManager::SetSizeByFont(const CFont* aFont)
       
   131     {
       
   132     iExtension->SetSizeByFont(aFont);
       
   133     }
       
   134 
       
   135 EXPORT_C void CAknSmileyManager::DrawText(CWindowGc& aGc, const TDesC& aText, const CFont* aFont, const TPoint& aPosition) const
       
   136     {
       
   137     iExtension->DrawText(aGc, aText, aFont, aPosition);
       
   138     }
       
   139 
       
   140 EXPORT_C void CAknSmileyManager::DrawText(CWindowGc& aGc, const TDesC& aText, const TAknLayoutText& aLayout, TBool aUseLogicalToVisualConversion) const
       
   141     {
       
   142     iExtension->DrawText(aGc, aText, aLayout, aUseLogicalToVisualConversion);
       
   143     }
       
   144 
       
   145 EXPORT_C void CAknSmileyManager::DrawText(CWindowGc& aGc, const TDesC& aText, const CFont* aFont, const TRect& aBox, TInt aBaselineOffset, 
       
   146                                           CGraphicsContext::TTextAlign aAlignment, TInt aLeftMargin) const
       
   147     {
       
   148     iExtension->DrawText(aGc, aText, aFont, aBox, aBaselineOffset, aAlignment, aLeftMargin);
       
   149     }
       
   150 
       
   151 EXPORT_C TInt CAknSmileyManager::Count() const
       
   152     {
       
   153     return iExtension->Count();
       
   154     }
       
   155 
       
   156 EXPORT_C CAknSmileyIcon* CAknSmileyManager::Smiley(TChar aCode) const
       
   157     {
       
   158     return iExtension->Smiley(aCode);
       
   159     }
       
   160 
       
   161 EXPORT_C CAknSmileyIcon* CAknSmileyManager::operator[](TInt aIndex) const
       
   162     {
       
   163     return iExtension->operator[](aIndex);
       
   164     }
       
   165 
       
   166 
       
   167 // end of file
       
   168