1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#ifndef UBTEACHERBARPREVIEWWIDGET_H
#define UBTEACHERBARPREVIEWWIDGET_H
#include <QLabel>
#include <QVBoxLayout>
#include <QPushButton>
#include "core/UBPersistenceManager.h"
#include "customWidgets/UBWidgetList.h"
#include "customWidgets/UBMediaWidget.h"
#include "customWidgets/UBDraggableMedia.h"
#include "customWidgets/UBDraggableLabel.h"
#include "UBTeacherBarDataMgr.h"
class UBTeacherBarPreviewMedia : public QWidget
{
Q_OBJECT
public:
UBTeacherBarPreviewMedia(QWidget* parent=0, const char* name="UBTeacherBarPreviewMedia");
~UBTeacherBarPreviewMedia();
// int loadMedia(QStringList pMedias);
void loadWidgets(QList<QWidget*> pWidgetList, bool isResizable = true);
void cleanMedia();
private:
UBWidgetList* mWidget;
QVBoxLayout mLayout;
QMap<QWidget*,QString>mWidgetList;
};
class UBActionPreview : public QWidget
{
public:
UBActionPreview(QWidget* parent=0, const char* name="UBActionPreview");
~UBActionPreview();
void setOwner(int owner);
void setContent(const QString& content);
private:
QLabel* mpOwner;
QTextEdit* mpContent;
QVBoxLayout mLayout;
QHBoxLayout mOwnerLayout;
};
class UBTBPreviewContainer : public UBWidgetList
{
public:
UBTBPreviewContainer(QWidget* parent=0, const char* name="UBTBPreviewContainer");
~UBTBPreviewContainer();
};
class UBTeacherBarPreviewWidget : public QWidget
{
Q_OBJECT
public:
UBTeacherBarPreviewWidget(UBTeacherBarDataMgr* pDataMgr, QWidget* parent=0, const char* name="UBTeacherBarPreviewWidget");
~UBTeacherBarPreviewWidget();
void updateFields();
void clearFields();
signals:
void showEditMode();
protected:
void showEvent(QShowEvent* ev);
private slots:
void onEdit();
void onActiveSceneChanged();
private:
void generateActions();
void generateMedias();
void generateLinks();
void generateComments();
QVBoxLayout mLayout;
QHBoxLayout mEditLayout;
QPushButton* mpEditButton;
// Titles
QVBoxLayout mTitleLayout;
UBTBSeparator mTitleSeparator;
QWidget* mpTitleContainer;
QLabel* mpSessionTitle;
QLabel* mpTitle;
QLabel* mpTitleLabel;
QLabel* mpPageNbrLabel;
UBTBPreviewContainer* mpContentContainer;
// Schedule
QLabel* mpScheduleLabel;
// License
UBTBSeparator mLicenseSeparator;
// TODO : replace the QLabel of the license by a widget done for that!
UBTBLicenseWidget* mpLicenseLabel;
/** Pointer to the datas */
UBTeacherBarDataMgr* mpDataMgr;
/** The list of stored widgets */
QList<QWidget*> mStoredWidgets;
/** A temporary action widget */
UBActionPreview* mpTmpAction;
/** A temporary media widget */
UBTeacherBarPreviewMedia* mpTmpMedia;
/** A temporary link */
QLabel* mpTmpLink;
/** A temporary comments field */
QTextEdit* mpTmpComment;
/** A temporary media object */
UBDraggableMedia* mTmpMedia;
/** A temporary label object */
UBDraggableLabel* mpTmpLabel;
};
#endif // UBTEACHERBARPREVIEWWIDGET_H