ganeswidgets/src/hgmediawall_p.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 14 May 2010 16:57:01 +0300
changeset 2 49c70dcc3f17
parent 1 e48454f237ca
child 3 c863538fcbb6
permissions -rw-r--r--
Revision: 201017 Kit: 201019

/*
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:
*
*/

#include "hgmediawall_p.h"
#include "hgcoverflowcontainer.h"
#include "trace.h"

HgMediawallPrivate::HgMediawallPrivate() : HgWidgetPrivate()
{
    FUNC_LOG;
    mStaticScrollDirection = true;
}

HgMediawallPrivate::~HgMediawallPrivate()
{
    FUNC_LOG;
}

void HgMediawallPrivate::init(Qt::Orientation orientation)
{
    FUNC_LOG;

    Q_Q(HgMediawall);
    HgCoverflowContainer* container = new HgCoverflowContainer(q);
    // Mediawall supports only horizontal scrolling.
    container->init(orientation);
    HgWidgetPrivate::init(container);
    
    q->connect( container, SIGNAL(animationAboutToEnd(QModelIndex)),
                q, SIGNAL(animationAboutToEnd(QModelIndex)) );
}

void HgMediawallPrivate::setTitlePosition(HgMediawall::LabelPosition position)
{
    FUNC_LOG;

    container()->setTitlePosition(position);
}

HgMediawall::LabelPosition HgMediawallPrivate::titlePosition() const
{
    FUNC_LOG;

    return container()->titlePosition();
}

void HgMediawallPrivate::setDescriptionPosition(HgMediawall::LabelPosition position)
{
    FUNC_LOG;

    container()->setDescriptionPosition(position);
}

HgMediawall::LabelPosition HgMediawallPrivate::descriptionPosition() const
{
    FUNC_LOG;

    return container()->descriptionPosition();
}

void HgMediawallPrivate::setTitleFontSpec(const HbFontSpec &fontSpec)
{
    FUNC_LOG;

    container()->setTitleFontSpec(fontSpec);
}

HbFontSpec HgMediawallPrivate::titleFontSpec() const
{
    FUNC_LOG;

    return container()->titleFontSpec();
}

void HgMediawallPrivate::setDescriptionFontSpec(const HbFontSpec &fontSpec)
{
    FUNC_LOG;

    container()->setDescriptionFontSpec(fontSpec);
}

HbFontSpec HgMediawallPrivate::descriptionFontSpec() const
{
    FUNC_LOG;

    return container()->descriptionFontSpec();
}

HgCoverflowContainer *HgMediawallPrivate::container()
{
    HANDLE_ERROR_NULL(mContainer);
    return qobject_cast<HgCoverflowContainer *>(mContainer);
}

const HgCoverflowContainer *HgMediawallPrivate::container() const
{
    HANDLE_ERROR_NULL(mContainer);
    return qobject_cast<const HgCoverflowContainer *>(mContainer);
}

// EOF