45
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 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: CalenDayContentWidget class definition.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef CALENDAYCONTENTWIDGET_H_
|
|
19 |
#define CALENDAYCONTENTWIDGET_H_
|
|
20 |
|
|
21 |
// System includes
|
|
22 |
#include <hbwidget.h>
|
|
23 |
|
|
24 |
// User includes
|
|
25 |
#include "calendaycommonheaders.h"
|
|
26 |
|
|
27 |
// Forward declarations
|
|
28 |
class QGraphicsLinearLayout;
|
|
29 |
class CalenDayModelManager;
|
|
30 |
|
|
31 |
|
|
32 |
class CalenDayContentWidget : public HbWidget
|
|
33 |
{
|
|
34 |
Q_OBJECT
|
|
35 |
|
|
36 |
public:
|
|
37 |
/*!
|
|
38 |
\enum CalenWidgetPosition
|
|
39 |
\brief Enumeration identifies widget position if queue.
|
|
40 |
*/
|
|
41 |
enum CalenWidgetPosition
|
|
42 |
{
|
|
43 |
ECalenLastWidget = 0,
|
|
44 |
ECalenFirstWidget
|
|
45 |
};
|
|
46 |
|
|
47 |
public:
|
|
48 |
CalenDayContentWidget(CalenDayModelManager &modelManager,
|
|
49 |
QGraphicsItem *parent = 0);
|
|
50 |
~CalenDayContentWidget();
|
|
51 |
|
|
52 |
void add(HbWidget* item, CalenWidgetPosition where = ECalenLastWidget);
|
|
53 |
HbWidget* take(CalenWidgetPosition which);
|
|
54 |
void remove(CalenWidgetPosition which);
|
|
55 |
|
|
56 |
signals:
|
|
57 |
void widgetsRelayoutFinished(CalenScrollDirection scrollTo);
|
|
58 |
void scrollPositionChanged(const QPointF &newPos);
|
|
59 |
|
|
60 |
public slots:
|
|
61 |
void relayoutWidgets(CalenScrollDirection scrollTo);
|
|
62 |
void widgetScrolled(const QPointF &newPos);
|
|
63 |
|
|
64 |
private:
|
|
65 |
void initializeViews(QGraphicsItem *parent);
|
|
66 |
|
|
67 |
private:
|
|
68 |
QGraphicsLinearLayout* mLayout; //!< Linear layout for day views
|
|
69 |
|
|
70 |
QList<HbWidget*> mWidgets; //!< List of widget instances
|
|
71 |
|
|
72 |
CalenDayModelManager &mModelManager; //!< Reference to model manager
|
|
73 |
};
|
|
74 |
|
|
75 |
#endif /* CALENDAYCONTENTWIDGET_H_ */
|