![]() |
Home · All Namespaces · All Classes |
00001 /*************************************************************************** 00002 ** 00003 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 00004 ** All rights reserved. 00005 ** Contact: Nokia Corporation (directui@nokia.com) 00006 ** 00007 ** This file is part of systemui. 00008 ** 00009 ** If you have questions regarding the use of this file, please contact 00010 ** Nokia at directui@nokia.com. 00011 ** 00012 ** This library is free software; you can redistribute it and/or 00013 ** modify it under the terms of the GNU Lesser General Public 00014 ** License version 2.1 as published by the Free Software Foundation 00015 ** and appearing in the file LICENSE.LGPL included in the packaging 00016 ** of this file. 00017 ** 00018 ****************************************************************************/ 00019 00020 #include <MWidgetController> 00021 #include <QGraphicsLinearLayout> 00022 #include "lockscreenheaderview.h" 00023 #include "statusarea.h" 00024 #include "clock.h" 00025 #include "date.h" 00026 00027 LockScreenHeaderView::LockScreenHeaderView(MWidgetController *controller) : 00028 MWidgetView(controller), 00029 layout(new QGraphicsLinearLayout(Qt::Vertical)) 00030 { 00031 layout->setContentsMargins(0, 0, 0, 0); 00032 layout->setSpacing(0); 00033 00034 // Add a status area to the main layout 00035 StatusArea *statusArea = new StatusArea; 00036 statusArea->setViewType("lockScreen"); 00037 layout->addItem(statusArea); 00038 00039 // Create a layout for the time and date 00040 Clock *clock = new Clock; 00041 clock->setObjectName("LockScreenHeaderClock"); 00042 QGraphicsLinearLayout *dateTimeVerticalLayout = new QGraphicsLinearLayout(Qt::Vertical); 00043 dateTimeVerticalLayout->setContentsMargins(0, 0, 0, 0); 00044 dateTimeVerticalLayout->setSpacing(0); 00045 dateTimeVerticalLayout->addItem(clock); 00046 dateTimeVerticalLayout->addItem(new Date); 00047 dateTimeVerticalLayout->addStretch(); 00048 00049 // Create a widget with a horizontal layout to align the time and date to the right and to apply a background image 00050 MWidgetController *dateTimeWidget = new MWidgetController; 00051 dateTimeWidget->setView(new MWidgetView(dateTimeWidget)); 00052 dateTimeWidget->setObjectName("LockScreenHeaderDateTime"); 00053 QGraphicsLinearLayout *dateTimeHorizontalLayout = new QGraphicsLinearLayout(Qt::Horizontal); 00054 dateTimeHorizontalLayout->setContentsMargins(0, 0, 0, 0); 00055 dateTimeHorizontalLayout->setSpacing(0); 00056 dateTimeHorizontalLayout->addStretch(); 00057 dateTimeHorizontalLayout->addItem(dateTimeVerticalLayout); 00058 dateTimeWidget->setLayout(dateTimeHorizontalLayout); 00059 00060 // Add the date and time to the main layout 00061 layout->addItem(dateTimeWidget); 00062 controller->setLayout(layout); 00063 } 00064 00065 LockScreenHeaderView::~LockScreenHeaderView() 00066 { 00067 } 00068 00069 M_REGISTER_VIEW_NEW(LockScreenHeaderView, MWidgetController)
| Copyright © 2010 Nokia Corporation | Generated on Thu Nov 4 2010 18:19:34 Doxygen 1.7.1 |
MeeGo Touch |
