Home · All Classes · Main Classes · Deprecated |
A class that represents in-process notification banner. More...
Inherits MSceneWindow.
Public Slots | |
void | setIconID (const QString &iconID) |
void | setTitle (const QString &text) |
void | setSubtitle (const QString &text) |
void | setBannerTimeStamp (const QDateTime &date) |
void | setPrefixTimeStamp (const QString &text) |
void | setPixmap (const QPixmap &pixmap) |
void | setDown (bool) |
Signals | |
void | clicked () |
Public Member Functions | |
MBanner () | |
virtual | ~MBanner () |
QString | iconID () const |
void | click () |
QString | title () const |
QString | subtitle () const |
QDateTime | bannerTimeStamp () const |
QString | prefixTimeStamp () const |
QPixmap | pixmap () const |
bool | isDown () const |
Properties | |
QString | iconID |
QString | title |
QString | subtitle |
QDateTime | bannerTimeStamp |
QString | prefixTimeStamp |
bool | down |
A class that represents in-process notification banner.
MBanner is a component used by the system for different purposes related with the notifications. Depending on the elements that you use when setting up an MBanner, the component will have different appearances.
Although we haven't defined different views for the MBanner, we consider those three types:
You should set the stylename through setStyleName() with one of the following names:
If you create a MBanner without styleName it will have a default style, and it will have the capability to show any property: title, subtitle, etc. In case that your banner contains any combination above mentioned, the styleName will be configured automatically by the library.
Due to the MBanner has the capability to be shown at the events/lock screen, it comes with two styles for this use case:
At the same time the MBanner includes a stylename that only shows the icon and title, hidding the subtitle
The difference between FullEventBanner and PrivateEventBanner is that the second doesn't show the subtitle due to privacy reasons. LockScreenEventBanner allows the user to customize the MBanner when it is placed at the lock screen.
MBanner can switch to different styles in anytime only switching the stylename. Note that some styles contain some specific layouts in which some properties are not show.
For instance if you create a Short Event Banner:
MBanner *eventBanner = new MBanner(); eventBanner->setStyleName(MBannerType::ShortEventBanner); eventBanner->setIconID("icon-l-settings"); eventBanner->setTitle("New updates waiting to install"); eventBanner->setSubtitle("130 files"); eventBanner->appear(scene(), MSceneWindow::DestroyWhenDone);
If you want show the look and feel of this MBanner in the event screen you only need switch the stylename:
eventBanner->setStyleName(MBannerType::FullEventBanner);
The MBanner layout will be styled with the FullEventBanner's layout automatically.
Is highly recommended use a styleName contemplated in the mentioned categories. As a good practice you should setup one of the mentioned stylenames to avoid conflicts in the look and feel.
By default MBanner is dismissed automatically after a certain amount of time. This parameter is defined in mbannerstyle.css under the name of disappear-timeout.
The whole MBanner is interactive. If you click the MBanner before the diappear-timeout is reached it will be dismissed.
Use MBanner class to launch in-process notifications. Use MNotification class to launch out-of-process system level notifications.
Here's how to launch an event banner from code:
MBanner *eventBanner = new MBanner(); eventBanner->setStyleName(MBannerType::ShortEventBanner); eventBanner->setIconID("icon-l-settings"); eventBanner->setTitle("New updates waiting to install"); eventBanner->setSubtitle("130 files"); eventBanner->appear(scene(), MSceneWindow::DestroyWhenDone);
Here's how to launch an information banner from code:
MBanner *infoBanner = new MBanner(); infoBanner->setStyleName(MBannerType::InformationBanner); infoBanner->setTitle("Info banner with so much information that the text wraps in portrait"); infoBanner->appear(scene(), MSceneWindow::DestroyWhenDone);
Here's how to launch a system banner from code:
MBanner *systemBanner = new MBanner(); systemBanner->setStyleName(MBannerType::SystemBanner); systemBanner->setIconID("icon-m-common-usb"); systemBanner->setTitle("System banner"); systemBanner->appear(scene(), MSceneWindow::DestroyWhenDone);
Here's how to launch a event full banner from code:
MBanner *fullEventBanner = new MBanner(); fullEventBanner->setStyleName(MBannerType::FullEventBanner); fullEventBanner->setIconID("icon-m-camera-scene-landscape-selected"); fullEventBanner->setTitle("Call"); fullEventBanner->setSubtitle("Brianna Edwards"); fullEventBanner->setPrefixTimeStamp("Yesterday:"); fullEventBanner->setBannerTimeStamp(QDateTime::currentDateTime());
MBanner::MBanner | ( | ) |
Constructs a new banner.
MBanner::~MBanner | ( | ) | [virtual] |
Destructor for banner object
QDateTime MBanner::bannerTimeStamp | ( | ) | const |
Get the timestamp.
void MBanner::click | ( | ) |
clicks mbanner
void MBanner::clicked | ( | ) | [signal] |
This signal is emitted when the banner is activated.
QString MBanner::iconID | ( | ) | const |
Returns the icon ID of the banner.
bool MBanner::isDown | ( | ) | const |
Returns true if the banner is pressed down.
QPixmap MBanner::pixmap | ( | ) | const |
Get the pixmap of the mbanner.
QString MBanner::prefixTimeStamp | ( | ) | const |
Get the prefix of the timestamp.
void MBanner::setBannerTimeStamp | ( | const QDateTime & | date | ) | [slot] |
void MBanner::setDown | ( | bool | down | ) | [slot] |
Set the banner down state.
void MBanner::setIconID | ( | const QString & | iconID | ) | [slot] |
Sets the icon for the banner.
iconId | Icon ID for the banner (for event banners) |
void MBanner::setPixmap | ( | const QPixmap & | pixmap | ) | [slot] |
Sets a pixmap for the banner.
pixmap |
void MBanner::setPrefixTimeStamp | ( | const QString & | text | ) | [slot] |
Set prefix timestamp text.
This is third line before the timestamp.
Prefix | text. |
void MBanner::setSubtitle | ( | const QString & | text | ) | [slot] |
Set subtitle text.
This is second line.
Subtitle | text. |
void MBanner::setTitle | ( | const QString & | text | ) | [slot] |
Set title text.
This is first line.
Title | text. |
QString MBanner::subtitle | ( | ) | const |
Get the subtitle.
QString MBanner::title | ( | ) | const |
Get the title.
MBanner::bannerTimeStamp [read, write] |
MBanner can have a timestamp.
MBanner::down [read, write] |
See MBannerModel::down.
MBanner::iconID [read, write] |
Icon for banner.
MBanner::prefixTimeStamp [read, write] |
MBanner can have the capability to setup a prefix before the timestamp Example: Yesterday: 18:00 PM.
MBanner::subtitle [read, write] |
MBanner can have a subtitle, is the secondary text.
MBanner::title [read, write] |
MBanner has a title, is the primary text.
Copyright © 2010 Nokia Corporation | MeeGo Touch |