Home · All Namespaces · All Classes
Public Member Functions | Protected Member Functions

NotificationAreaView Class Reference

#include <notificationareaview.h>

Inheritance diagram for NotificationAreaView:
Inheritance graph
[legend]
Collaboration diagram for NotificationAreaView:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 NotificationAreaView (NotificationArea *controller)
virtual ~NotificationAreaView ()

Protected Member Functions

virtual void updateData (const QList< const char * > &modifications)
 REIMPLEMENTATION
virtual void applyStyle ()

Detailed Description

Definition at line 34 of file notificationareaview.h.


Constructor & Destructor Documentation

NotificationAreaView::NotificationAreaView ( NotificationArea controller  ) 

Constructs a view for a notification area.

Parameters:
controller the controller of this NotificationAreaView

Definition at line 31 of file notificationareaview.cpp.

                                                                       :
    MWidgetView(controller),
    bannerLayout(new MLayout()),
    clearButtonLayout(new QGraphicsLinearLayout(Qt::Horizontal)),
    //% "Clear"
    clearButton(new MButton(qtTrId("qtn_noti_clear"))),
    andMore(new MWidgetController)
{
    // Set up the main layout
    QGraphicsLinearLayout *mainLayout = new QGraphicsLinearLayout(Qt::Vertical);
    mainLayout->setContentsMargins(0, 0, 0, 0);
    mainLayout->setSpacing(0);
    mainLayout->addItem(bannerLayout);
    mainLayout->addItem(andMore);
    mainLayout->addItem(clearButtonLayout);
    controller->setLayout(mainLayout);

    // Set up the banner layout
    bannerPolicy = new MLinearLayoutPolicy(bannerLayout, Qt::Vertical);
    bannerPolicy->setStyleName("NotificationAreaBannerLayoutPolicy");
    bannerLayout->setContentsMargins(0, 0, 0, 0);
    bannerLayout->setPolicy(bannerPolicy);

    // Create the "and more" area
    andMore->setView(new MWidgetView(andMore));
    andMore->setObjectName("AndMore");
    //% "And more"
    MLabel *andMoreLabel = new MLabel(qtTrId("qtn_noti_more"));
    andMoreLabel->setObjectName("AndMoreLabel");
    QGraphicsLinearLayout *andMoreLayout = new QGraphicsLinearLayout(Qt::Horizontal);
    andMoreLayout->setContentsMargins(0, 0, 0, 0);
    andMoreLayout->setSpacing(0);
    andMoreLayout->addStretch();
    andMoreLayout->addItem(andMoreLabel);
    andMore->setLayout(andMoreLayout);

    // Put a clear button into the clear button layout
    clearButtonLayout->setContentsMargins(0, 0, 0, 0);
    clearButtonLayout->setSpacing(0);
    clearButton->setObjectName("NotificationAreaClearButton");
    connect(clearButton, SIGNAL(clicked()), controller, SLOT(removeAllRemovableBanners()));
    clearButtonLayout->addStretch();
    clearButtonLayout->addItem(clearButton);
    clearButtonLayout->addStretch();
}

NotificationAreaView::~NotificationAreaView (  )  [virtual]

Destroys the notification area view.

Definition at line 77 of file notificationareaview.cpp.

{
    // Clear the banner layout
    while (bannerPolicy->count() > 0) {
        bannerPolicy->removeAt(0);
    }
}


Member Function Documentation

void NotificationAreaView::applyStyle (  )  [protected, virtual]

Definition at line 97 of file notificationareaview.cpp.

{
    MWidgetView::applyStyle();

    // Update the layout since "clear all" button visibility or the maximum amount of banners may have changed
    updateLayout();
}

void NotificationAreaView::updateData ( const QList< const char * > &  modifications  )  [protected, virtual]

REIMPLEMENTATION

Definition at line 85 of file notificationareaview.cpp.

{
    MWidgetView::updateData(modifications);

    const char *member;
    foreach(member, modifications) {
        if (member == NotificationAreaModel::Banners) {
            updateLayout();
        }
    }
}


The documentation for this class was generated from the following files:

Copyright © 2010 Nokia Corporation Generated on Thu Nov 4 2010 18:19:35
Doxygen 1.7.1
MeeGo Touch