Home · All Namespaces · All Classes

StatusAreaView Class Reference

#include <statusareaview.h>

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

List of all members.

Public Member Functions

 StatusAreaView (StatusArea *controller)
virtual ~StatusAreaView ()
virtual void setGeometry (const QRectF &rect)
 REIMPLEMENTATION

Protected Attributes

MWidgetControllerlandscapeWidget
 
MWidgetControllerportraitWidget

Detailed Description

Status area view draws the status area.

Definition at line 37 of file statusareaview.h.


Constructor & Destructor Documentation

StatusAreaView::StatusAreaView ( StatusArea controller  ) 

Constructs a view for a status area.

Parameters:
controller the controller of this StatusAreaView

Definition at line 32 of file statusareaview.cpp.

00032                                                      :
00033     MWidgetView(controller),
00034     landscapeWidget(new MWidgetController),
00035     portraitWidget(new MWidgetController),
00036     controller(controller),
00037     landscapePhoneNetworkIndicator(new PhoneNetworkStatusIndicator(contextFrameworkContext, controller)),
00038     portraitPhoneNetworkIndicator(new PhoneNetworkStatusIndicator(contextFrameworkContext, controller)),
00039     landscapeAlarmIndicator(new AlarmStatusIndicator(contextFrameworkContext, controller)),
00040     portraitAlarmIndicator(new AlarmStatusIndicator(contextFrameworkContext, controller)),
00041     landscapeBatteryIndicator(new BatteryStatusIndicator(contextFrameworkContext, controller)),
00042     portraitBatteryIndicator(new BatteryStatusIndicator(contextFrameworkContext, controller)),
00043     landscapePhoneSignalStrengthIndicator(new PhoneNetworkSignalStrengthStatusIndicator(contextFrameworkContext, controller)),
00044     portraitPhoneSignalStrengthIndicator(new PhoneNetworkSignalStrengthStatusIndicator(contextFrameworkContext, controller)),
00045     landscapePhoneNetworkTypeIndicator(new PhoneNetworkTypeStatusIndicator(contextFrameworkContext, controller)),
00046     portraitPhoneNetworkTypeIndicator(new PhoneNetworkTypeStatusIndicator(contextFrameworkContext, controller)),
00047     landscapeInternetConnectionIndicator(new InternetConnectionStatusIndicator(contextFrameworkContext, controller)),
00048     portraitInternetConnectionIndicator(new InternetConnectionStatusIndicator(contextFrameworkContext, controller)),
00049     landscapeBluetoothIndicator(new BluetoothStatusIndicator(contextFrameworkContext, controller)),
00050     portraitBluetoothIndicator(new BluetoothStatusIndicator(contextFrameworkContext, controller)),
00051     landscapeGPSIndicator(new GPSStatusIndicator(contextFrameworkContext, controller)),
00052     portraitGPSIndicator(new GPSStatusIndicator(contextFrameworkContext, controller)),
00053     landscapePresenceIndicator(new PresenceStatusIndicator(contextFrameworkContext, controller)),
00054     portraitPresenceIndicator(new PresenceStatusIndicator(contextFrameworkContext, controller)),
00055     landscapeProfileIndicator(new ProfileStatusIndicator(contextFrameworkContext, controller)),
00056     portraitProfileIndicator(new ProfileStatusIndicator(contextFrameworkContext, controller)),
00057     landscapeInputMethodIndicator(new InputMethodStatusIndicator(controller)),
00058     landscapeCallIndicator(new CallStatusIndicator(contextFrameworkContext, controller)),
00059     portraitCallIndicator(new CallStatusIndicator(contextFrameworkContext, controller)),
00060     landscapeNotificationIndicator(new NotificationStatusIndicator(&notifierNotificationSink, controller)),
00061     portraitNotificationIndicator(new NotificationStatusIndicator(&notifierNotificationSink, controller)),
00062     landscapeTransferStatusIndicator(new TransferStatusIndicator(controller)),
00063     portraitTransferStatusIndicator(new TransferStatusIndicator(controller)),
00064     landscapeClock(new Clock(controller)),
00065     portraitClock(new Clock(controller))
00066 {
00067     // Connect related phone network indicators
00068     connect(portraitPhoneNetworkTypeIndicator,  SIGNAL(networkAvailabilityChanged(bool)), portraitPhoneSignalStrengthIndicator, SLOT(setDisplay(bool)));
00069     connect(landscapePhoneNetworkTypeIndicator, SIGNAL(networkAvailabilityChanged(bool)), landscapePhoneSignalStrengthIndicator, SLOT(setDisplay(bool)));
00070 
00071     // Set up the clock styles
00072     landscapeClock->setObjectName("StatusAreaLandscapeClock");
00073     portraitClock->setObjectName("StatusAreaPortraitClock");
00074 
00075     // Set the clock to short time display when alarm is present
00076     connect(portraitAlarmIndicator, SIGNAL(alarmSettingChanged(bool)), portraitClock, SLOT(setShortDisplay(bool)));
00077     connect(landscapeAlarmIndicator, SIGNAL(alarmSettingChanged(bool)), landscapeClock, SLOT(setShortDisplay(bool)));
00078 
00079     // Set up landscape and portrait widgets and anchor them on top of each other
00080     landscapeWidget->setView(new MWidgetView(landscapeWidget));
00081     landscapeWidget->setObjectName("StatusBarLandscapeWidget");
00082     landscapeWidget->setLayout(createLandscapeLayout());
00083     landscapeWidget->setParent(controller);
00084     portraitWidget->setParent(controller);
00085     portraitWidget->setView(new MWidgetView(portraitWidget));
00086     portraitWidget->setObjectName("StatusBarPortraitWidget");
00087     portraitWidget->setLayout(createPortraitLayout());
00088     QGraphicsAnchorLayout *compositeLayout = new QGraphicsAnchorLayout;
00089     compositeLayout->setContentsMargins(0, 0, 0, 0);
00090     compositeLayout->setSpacing(0);
00091 
00092     compositeLayout->addCornerAnchors(landscapeWidget, Qt::TopLeftCorner, compositeLayout, Qt::TopLeftCorner);
00093     compositeLayout->addCornerAnchors(landscapeWidget, Qt::TopRightCorner, compositeLayout, Qt::TopRightCorner);
00094     compositeLayout->addCornerAnchors(portraitWidget, Qt::TopLeftCorner, landscapeWidget, Qt::BottomLeftCorner);
00095     compositeLayout->addCornerAnchors(portraitWidget, Qt::BottomLeftCorner, compositeLayout, Qt::BottomLeftCorner);
00096     controller->setLayout(compositeLayout);
00097 
00098     // Connect to D-Bus and register the DBus source as an object
00099     QDBusConnection::sessionBus().registerService("com.meego.core.MInputMethodStatusIndicator");
00100     QDBusConnection::sessionBus().registerObject("/inputmethodstatusindicator", landscapeInputMethodIndicator);
00101 
00102     // Set different style names to PhoneNetworkStatusIndicator in landscape and portrait
00103     landscapePhoneNetworkIndicator->setStyleName(QString(landscapePhoneNetworkIndicator->metaObject()->className()) + "Landscape");
00104     portraitPhoneNetworkIndicator->setStyleName(QString(portraitPhoneNetworkIndicator->metaObject()->className()) + "Portrait");
00105 
00106     // Set up the class for functional testing
00107     setupTestability();
00108 }

StatusAreaView::~StatusAreaView (  )  [virtual]

Destructor.

Definition at line 142 of file statusareaview.cpp.

00143 {
00144 }


Member Function Documentation

void StatusAreaView::setGeometry ( const QRectF &  rect  )  [virtual]

REIMPLEMENTATION

Definition at line 146 of file statusareaview.cpp.

00147 {
00148     int screenWidth = MDeviceProfile::instance()->resolution().width();
00149     int screenHeight = MDeviceProfile::instance()->resolution().height();
00150     qreal areaHeight = rect.height() / 2;
00151     landscapeWidget->setMinimumSize(screenWidth, areaHeight);
00152     landscapeWidget->setMaximumSize(screenWidth, areaHeight);
00153     portraitWidget->setMinimumSize(screenHeight, areaHeight);
00154     portraitWidget->setMaximumSize(screenHeight, areaHeight);
00155 }


Member Data Documentation

Widgets for the landscape and portrait areas

Definition at line 61 of file statusareaview.h.

Definition at line 62 of file statusareaview.h.


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

Copyright © 2010 Nokia Corporation Generated on Wed Nov 10 16:05:12 2010
Doxygen 1.6.1
MeeGo Touch