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 hbmainwindow
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef HBMAINWINDOW_H
|
|
19 |
#define HBMAINWINDOW_H
|
|
20 |
|
|
21 |
#include <QObject>
|
|
22 |
#include "hbwidget.h"
|
|
23 |
#include "hbaction.h"
|
|
24 |
|
|
25 |
class HbView;
|
|
26 |
|
|
27 |
class HbMainWindow : public QObject
|
|
28 |
{
|
|
29 |
Q_OBJECT
|
|
30 |
|
|
31 |
public:
|
|
32 |
|
|
33 |
/**
|
|
34 |
* constructor
|
|
35 |
*/
|
|
36 |
HbMainWindow(QWidget *parent = 0, Hb::WindowFlags windowFlags = Hb::WindowFlagNone) :
|
|
37 |
mSoftKeyAction(0),
|
|
38 |
mOrientation(Qt::Vertical)
|
|
39 |
{
|
|
40 |
Q_UNUSED(parent);
|
|
41 |
Q_UNUSED(windowFlags);
|
|
42 |
}
|
|
43 |
|
|
44 |
/**
|
|
45 |
* destructor
|
|
46 |
*/
|
|
47 |
~HbMainWindow(){};
|
|
48 |
|
|
49 |
/**
|
|
50 |
* dummy
|
|
51 |
*/
|
|
52 |
void addSoftKeyAction(Hb::SoftKeyId type, HbAction *action)
|
|
53 |
{
|
|
54 |
Q_UNUSED(type);
|
|
55 |
mSoftKeyAction = action;
|
|
56 |
}
|
|
57 |
|
|
58 |
void removeSoftKeyAction(Hb::SoftKeyId type, HbAction *action)
|
|
59 |
{
|
|
60 |
Q_UNUSED(type);
|
|
61 |
if(mSoftKeyAction == action)
|
|
62 |
{
|
|
63 |
mSoftKeyAction = 0;
|
|
64 |
}
|
|
65 |
}
|
|
66 |
|
|
67 |
|
|
68 |
/**
|
|
69 |
* returns mSoftKeyAction
|
|
70 |
*/
|
|
71 |
HbAction* softKeyAction(Hb::SoftKeyId type)
|
|
72 |
{
|
|
73 |
Q_UNUSED(type);
|
|
74 |
return mSoftKeyAction;
|
|
75 |
}
|
|
76 |
|
|
77 |
HbView *addView(QGraphicsWidget *widget = 0);
|
|
78 |
|
|
79 |
void removeView(QGraphicsWidget *widget);
|
|
80 |
|
|
81 |
QList<HbView *> views() const;
|
|
82 |
|
|
83 |
HbView *currentView() const;
|
|
84 |
|
|
85 |
Qt::Orientation orientation() const
|
|
86 |
{
|
|
87 |
return mOrientation;
|
|
88 |
}
|
|
89 |
|
|
90 |
void setOrientation(Qt::Orientation orientation, bool animate = true)
|
|
91 |
{
|
|
92 |
Q_UNUSED(animate);
|
|
93 |
mOrientation = orientation;
|
|
94 |
}
|
|
95 |
|
|
96 |
void unsetOrientation(bool animate = true)
|
|
97 |
{
|
|
98 |
Q_UNUSED(animate);
|
|
99 |
mOrientation = Qt::Vertical;
|
|
100 |
}
|
35
|
101 |
|
|
102 |
signals:
|
|
103 |
|
|
104 |
void orientationChanged(Qt::Orientation orientation);
|
|
105 |
|
|
106 |
public:
|
34
|
107 |
|
|
108 |
/**
|
|
109 |
* value to return from softKeyAction
|
|
110 |
*/
|
|
111 |
HbAction *mSoftKeyAction;
|
|
112 |
|
|
113 |
/**
|
|
114 |
* views
|
|
115 |
*/
|
|
116 |
QList<HbView *> mViews;
|
|
117 |
|
|
118 |
/**
|
|
119 |
* orientation
|
|
120 |
*/
|
|
121 |
Qt::Orientation mOrientation;
|
|
122 |
};
|
|
123 |
#endif
|