34
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: stub hblabel
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include "hbmainwindow.h"
|
|
19 |
#include "hbview.h"
|
|
20 |
#include "qlist.h"
|
|
21 |
|
|
22 |
// ---------------------------------------------------------------------------
|
|
23 |
// addView
|
|
24 |
// ---------------------------------------------------------------------------
|
|
25 |
//
|
|
26 |
HbView* HbMainWindow::addView(QGraphicsWidget *widget)
|
|
27 |
{
|
|
28 |
HbView* view = qobject_cast<HbView*>(widget);
|
|
29 |
mViews.append(view);
|
|
30 |
return view;
|
|
31 |
}
|
|
32 |
|
|
33 |
// ---------------------------------------------------------------------------
|
|
34 |
// removeView
|
|
35 |
// ---------------------------------------------------------------------------
|
|
36 |
//
|
|
37 |
void HbMainWindow::removeView(QGraphicsWidget *widget)
|
|
38 |
{
|
|
39 |
mViews.removeAll(qobject_cast<HbView*>(widget));
|
|
40 |
}
|
|
41 |
|
|
42 |
// ---------------------------------------------------------------------------
|
|
43 |
// views
|
|
44 |
// ---------------------------------------------------------------------------
|
|
45 |
//
|
|
46 |
QList<HbView *> HbMainWindow::views() const
|
|
47 |
{
|
|
48 |
return mViews;
|
|
49 |
}
|
|
50 |
|
35
|
51 |
HbView* HbMainWindow::currentView() const
|
34
|
52 |
{
|
35
|
53 |
if(mViews.count())
|
|
54 |
{
|
|
55 |
return mViews.at(0);
|
|
56 |
}
|
34
|
57 |
return 0;
|
|
58 |
}
|
36
|
59 |
|
|
60 |
void HbMainWindow::setCurrentView(HbView *view)
|
|
61 |
{
|
|
62 |
for(int i = 0; i < mViews.count(); i++)
|
|
63 |
{
|
|
64 |
if(mViews[i] == view)
|
|
65 |
{
|
|
66 |
mViews.takeAt(i);
|
|
67 |
}
|
|
68 |
}
|
|
69 |
mViews.prepend(view);
|
|
70 |
}
|