serviceproviders/sapi_mediamanagement/mediamanagementservice/src/mgmediacontainer.cpp
changeset 5 989d2f495d90
equal deleted inserted replaced
1:a36b1e19a461 5:989d2f495d90
       
     1 /*
       
     2 * Copyright (c) 2007-2007 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 the License "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"mgmediacontainer.h"
       
    20 // -----------------------------------------------------------------------------
       
    21 // CMediaContainer::NewL
       
    22 // Returns the instance of CMediaContainer.
       
    23 // -----------------------------------------------------------------------------
       
    24 CMediaContainer* CMediaContainer::NewL(TRect& aRect)
       
    25     {
       
    26     CMediaContainer* self = new (ELeave) CMediaContainer();
       
    27     CleanupStack::PushL(self); 
       
    28     self->ConstructL(aRect);
       
    29     CleanupStack::Pop(self);
       
    30     return self;
       
    31     }
       
    32 
       
    33 // -----------------------------------------------------------------------------
       
    34 // CMediaContainer::CMediaContainer
       
    35 // Constructor
       
    36 // -----------------------------------------------------------------------------   
       
    37 CMediaContainer::CMediaContainer()
       
    38     {
       
    39     // no implementation required
       
    40     }
       
    41 // -----------------------------------------------------------------------------
       
    42 // CMediaContainer::~CMediaContainer
       
    43 // Destructor
       
    44 // -----------------------------------------------------------------------------   
       
    45 CMediaContainer::~CMediaContainer()
       
    46     {
       
    47     CloseWindow();
       
    48      // no implementation required
       
    49     }
       
    50 // -----------------------------------------------------------------------------
       
    51 // CMediaContainer::ConstructL
       
    52 // 
       
    53 // -----------------------------------------------------------------------------   
       
    54 void CMediaContainer::ConstructL(TRect& aRect)
       
    55     {
       
    56      
       
    57     CreateWindowL();
       
    58        SetRect(aRect);
       
    59 
       
    60       iVideoRect = Rect();
       
    61       TPoint point = PositionRelativeToScreen();
       
    62       iVideoRect.iTl.iX += point.iX;
       
    63       iVideoRect.iTl.iY += point.iY;
       
    64       iVideoRect.iBr.iX += point.iX;
       
    65       iVideoRect.iBr.iY += point.iY;
       
    66       ActivateL();
       
    67 
       
    68     }
       
    69 // -----------------------------------------------------------------------------
       
    70 // CMediaContainer::Draw
       
    71 // CCoeControl protected method implementation
       
    72 // -----------------------------------------------------------------------------   
       
    73 void CMediaContainer::Draw(const TRect& /*aRect*/) const
       
    74     {
       
    75      CWindowGc& gc = SystemGc();
       
    76      gc.SetBrushColor(KRgbBlack);
       
    77      gc.SetBrushStyle (CGraphicsContext::ESolidBrush);
       
    78      TRect rect = Rect();
       
    79      gc.Clear(rect);
       
    80     }