From 34e778e14e1d820b21f14e2f83e46f79bbfc03d4 Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Tue, 3 Jan 2012 10:26:00 +0100 Subject: [PATCH] first draft of 'nouvelle barre du prof' --- src/board/UBBoardPaletteManager.cpp | 10 +- src/gui/UBDockPaletteWidget.cpp | 3 + src/gui/UBDockPaletteWidget.h | 4 + src/gui/UBTeacherBarWidget.cpp | 129 ++++++++++++++++++- src/gui/UBTeacherBarWidget.h | 28 +++++ src/gui/UBVideoPlayer.h | 5 + src/gui/gui.pri | 88 ++++++------- src/podcast/youtube/UBYouTubePublisher.cpp | 2 +- src/web/UBWebController.cpp | 136 +-------------------- src/web/UBWebController.h | 29 +++-- src/web/web.pri | 8 +- 11 files changed, 243 insertions(+), 199 deletions(-) diff --git a/src/board/UBBoardPaletteManager.cpp b/src/board/UBBoardPaletteManager.cpp index 483fbbac..eb10433f 100644 --- a/src/board/UBBoardPaletteManager.cpp +++ b/src/board/UBBoardPaletteManager.cpp @@ -199,6 +199,10 @@ void UBBoardPaletteManager::setupDockPaletteWidgets() mLeftPalette->registerWidget(mpPageNavigWidget); mLeftPalette->addTab(mpPageNavigWidget); + // The teacher bar widget will always be there + mLeftPalette->registerWidget(mpTeacherBarWidget); + mLeftPalette->addTab(mpTeacherBarWidget); + mLeftPalette->connectSignals(); mRightPalette = new UBRightPalette(mContainer); @@ -207,9 +211,6 @@ void UBBoardPaletteManager::setupDockPaletteWidgets() mRightPalette->addTab(mpLibWidget); // The cache widget will be visible only if a cache is put on the page mRightPalette->registerWidget(mpCachePropWidget); - // The teacher bar widget will always be there - mRightPalette->registerWidget(mpTeacherBarWidget); - mRightPalette->addTab(mpTeacherBarWidget); // The download widget will be part of the right palette but // will become visible only when the first download starts mRightPalette->registerWidget(mpDownloadWidget); @@ -820,9 +821,6 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is } else mKeyboardPalette->setParent(0); - -// mKeyboardPalette->update(); - } } break; diff --git a/src/gui/UBDockPaletteWidget.cpp b/src/gui/UBDockPaletteWidget.cpp index 16bcb322..32dbd286 100644 --- a/src/gui/UBDockPaletteWidget.cpp +++ b/src/gui/UBDockPaletteWidget.cpp @@ -27,6 +27,9 @@ QString UBDockPaletteWidget::name() return mName; } +/** + * When a widget registers a mode it means that it would be displayed on that mode + */ void UBDockPaletteWidget::registerMode(eUBDockPaletteWidgetMode mode) { if(!mRegisteredModes.contains(mode)) diff --git a/src/gui/UBDockPaletteWidget.h b/src/gui/UBDockPaletteWidget.h index fdf50a87..98768253 100644 --- a/src/gui/UBDockPaletteWidget.h +++ b/src/gui/UBDockPaletteWidget.h @@ -5,6 +5,10 @@ #include #include + +/** + * This enum defines the different mode availables. + */ typedef enum { eUBDockPaletteWidget_BOARD, diff --git a/src/gui/UBTeacherBarWidget.cpp b/src/gui/UBTeacherBarWidget.cpp index 52c21bb2..75033ed9 100644 --- a/src/gui/UBTeacherBarWidget.cpp +++ b/src/gui/UBTeacherBarWidget.cpp @@ -32,6 +32,7 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock , mpAction1(NULL) , mpAction2(NULL) , mpAction3(NULL) + , mpDropMediaZone(NULL) , mpContainer(NULL) , mpContainerLayout(NULL) { @@ -122,6 +123,10 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock mpLayout->addWidget(mpAction2); mpLayout->addWidget(mpAction3); + // Media + mpDropMediaZone = new UBTeacherBarDropMediaZone(); + mpLayout->addWidget(mpDropMediaZone); + populateCombos(); connect(UBApplication::boardController, SIGNAL(activeSceneWillChange()), this, SLOT(saveContent())); @@ -142,6 +147,11 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock UBTeacherBarWidget::~UBTeacherBarWidget() { + if(NULL != mpDropMediaZone) + { + delete mpDropMediaZone; + mpDropMediaZone = NULL; + } if(NULL != mpAction3) { delete mpAction3; @@ -356,9 +366,7 @@ UBTeacherStudentAction::UBTeacherStudentAction(int actionNumber, QWidget *parent mpTeacherLayout = new QHBoxLayout(); - //TODO: I'm not able to translate this string using the normal way *qm file why? mpTeacherLabel = new QLabel(tr("Teacher"), this); -// mpTeacherLabel = new QLabel(tr("Enseignant"), this); mpTeacherLabel->setAlignment(Qt::AlignTop); mpTeacher = new QTextEdit(this); mpTeacher->setObjectName("TeacherStudentBox"); @@ -369,7 +377,6 @@ UBTeacherStudentAction::UBTeacherStudentAction(int actionNumber, QWidget *parent mpStudentLayout = new QHBoxLayout(); mpStudentLabel = new QLabel(tr("Student"), this); -// mpStudentLabel = new QLabel(tr("Élève"), this); mpStudentLabel->setAlignment(Qt::AlignTop); mpStudent = new QTextEdit(this); mpStudent->setObjectName("TeacherStudentBox"); @@ -452,3 +459,119 @@ QTextEdit* UBTeacherStudentAction::student() { return mpStudent; } + +#include "gui/UBMediaPlayer.h" +#include "gui/UBVideoPlayer.h" +#include "frameworks/UBFileSystemUtils.h" + +UBTeacherBarDropMediaZone::UBTeacherBarDropMediaZone(QWidget *parent, const char *name):QWidget(parent) + , mpTitleLabel(NULL) + , mpImageTab(NULL) + , mpTabWidget(NULL) + , mpLayout(NULL) +{ + setObjectName(name); + setAcceptDrops(true); + + setAttribute(Qt::WA_StyledBackground, true); + setStyleSheet(UBApplication::globalStyleSheet()); + + // Create the GUI + mpLayout = new QVBoxLayout(this); + setLayout(mpLayout); + + + mpImageTab = new QLabel(); + mpVideoTab = new UBMediaPlayer(); + mpAudioTab = new UBMediaPlayer(); + + mpTitleLabel = new QLabel(tr("Drop media here")); + mpLayout->addWidget(mpTitleLabel); + mpTabWidget = new QTabWidget(); + mpTabWidget->setMinimumHeight(200); + mpTabWidget->addTab(mpImageTab,QIcon(":images/toolbar/extraTool.png"),""); + mpTabWidget->addTab(mpVideoTab,QIcon(":images/libpalette/movieIcon.svg"),""); + mpTabWidget->addTab(mpAudioTab,QIcon(":images/libpalette/soundIcon.svg"),""); + mpLayout->addWidget(mpTabWidget); +} + +UBTeacherBarDropMediaZone::~UBTeacherBarDropMediaZone() +{ + if(NULL != mpTitleLabel) + { + delete mpTitleLabel; + mpTitleLabel = NULL; + } + if(NULL != mpImageTab) + { + delete mpImageTab; + mpImageTab = NULL; + } + if(NULL != mpVideoTab) + { + delete mpVideoTab; + mpVideoTab = NULL; + } + if(NULL != mpAudioTab) + { + delete mpAudioTab; + mpAudioTab = NULL; + } + if(NULL != mpTabWidget) + { + delete mpTabWidget; + mpTabWidget = NULL; + } + if(NULL != mpLayout) + { + delete mpLayout; + mpLayout = NULL; + } +} + + +void UBTeacherBarDropMediaZone::dragEnterEvent(QDragEnterEvent *pEvent) +{ + setBackgroundRole(QPalette::Highlight); + pEvent->acceptProposedAction(); +} + +void UBTeacherBarDropMediaZone::dragLeaveEvent(QDragLeaveEvent *pEvent) +{ + setBackgroundRole(QPalette::Dark); + pEvent->accept(); +} + +void UBTeacherBarDropMediaZone::dropEvent(QDropEvent *pEvent) +{ + setBackgroundRole(QPalette::Dark); + if(pEvent->mimeData()->hasHtml()) qDebug() << pEvent->mimeData()->html(); + if(pEvent->mimeData()->hasUrls()) qDebug() << pEvent->mimeData()->urls(); + if(pEvent->mimeData()->hasText()) qDebug() << pEvent->mimeData()->text(); + QString mimeType = UBFileSystemUtils::mimeTypeFromFileName(pEvent->mimeData()->urls().at(0).toLocalFile()); + if(mimeType.contains("image")){ + QPixmap pix = QPixmap(pEvent->mimeData()->urls().at(0).toLocalFile()); + mpImageTab->setPixmap(pix); + mpTabWidget->setCurrentWidget(mpImageTab); + } + else if(mimeType.contains("video")){ + mpVideoTab->setFile(pEvent->mimeData()->urls().at(0).toLocalFile()); + mpVideoTab->playPause(); + + mpTabWidget->setCurrentWidget(mpVideoTab); + } + else if(mimeType.contains("audio")){ + mpVideoTab->setFile(pEvent->mimeData()->urls().at(0).toLocalFile()); + mpVideoTab->playPause(); + mpTabWidget->setCurrentWidget(mpAudioTab); + } + else{ + qWarning() << "bad idea to come here"; + } + pEvent->acceptProposedAction(); +} + +void UBTeacherBarDropMediaZone::dragMoveEvent(QDragMoveEvent *pEvent) +{ + pEvent->acceptProposedAction(); +} diff --git a/src/gui/UBTeacherBarWidget.h b/src/gui/UBTeacherBarWidget.h index a021027f..585e7f8a 100644 --- a/src/gui/UBTeacherBarWidget.h +++ b/src/gui/UBTeacherBarWidget.h @@ -1,6 +1,9 @@ #ifndef UBTEACHERBARWIDGET_H #define UBTEACHERBARWIDGET_H +class UBMediaPlayer; +class UBVideoPlayer; + #include #include #include @@ -39,6 +42,30 @@ private: QHBoxLayout* mpStudentLayout; }; + +class UBTeacherBarDropMediaZone : public QWidget +{ + Q_OBJECT + +public: + UBTeacherBarDropMediaZone(QWidget* parent=0, const char* name="UBTeacherBarDropMediaZone"); + ~UBTeacherBarDropMediaZone(); + +private: + QLabel* mpTitleLabel; + QLabel* mpImageTab; + UBMediaPlayer* mpVideoTab; + UBMediaPlayer* mpAudioTab; + QTabWidget* mpTabWidget; + QVBoxLayout* mpLayout; + +protected: + void dragEnterEvent(QDragEnterEvent* pEvent); + void dropEvent(QDropEvent *pEvent); + void dragMoveEvent(QDragMoveEvent* pEvent); + void dragLeaveEvent(QDragLeaveEvent* pEvent); +}; + class UBTeacherBarWidget : public UBDockPaletteWidget { Q_OBJECT @@ -75,6 +102,7 @@ private: UBTeacherStudentAction* mpAction1; UBTeacherStudentAction* mpAction2; UBTeacherStudentAction* mpAction3; + UBTeacherBarDropMediaZone* mpDropMediaZone; QWidget* mpContainer; QVBoxLayout* mpContainerLayout; }; diff --git a/src/gui/UBVideoPlayer.h b/src/gui/UBVideoPlayer.h index ced2cc3b..287ad382 100644 --- a/src/gui/UBVideoPlayer.h +++ b/src/gui/UBVideoPlayer.h @@ -35,6 +35,11 @@ class UBVideoPlayer : public QWidget return mVideoPlayer; } + void loadMedia(QUrl url) + { + mVideoPlayer->load(Phonon::MediaSource(url)); + } + protected: Phonon::VideoPlayer* mVideoPlayer; diff --git a/src/gui/gui.pri b/src/gui/gui.pri index 20075dfb..d1a187cd 100644 --- a/src/gui/gui.pri +++ b/src/gui/gui.pri @@ -26,27 +26,28 @@ HEADERS += src/gui/UBThumbnailView.h \ src/gui/UBActionPalette.h \ src/gui/UBFavoriteToolPalette.h \ src/gui/UBKeyboardPalette.h \ - src/gui/UBNavigatorPalette.h \ - src/gui/UBDocumentNavigator.h \ - src/gui/UBDockPalette.h \ - src/gui/UBPropertyPalette.h \ - src/gui/UBLibNavigatorWidget.h \ - src/gui/UBLibItemProperties.h \ - src/gui/UBLibActionBar.h \ - src/gui/UBLibraryWidget.h \ - src/gui/UBLibPathViewer.h \ - src/gui/UBUpdateDlg.h \ - src/gui/UBDockPaletteWidget.h \ - src/gui/UBLeftPalette.h \ - src/gui/UBRightPalette.h \ - src/gui/UBPageNavigationWidget.h \ - src/gui/UBLibWidget.h \ - src/gui/UBMagnifer.h \ - src/gui/UBCachePropertiesWidget.h \ - src/gui/UBTeacherBarWidget.h \ - src/gui/UBLibWebView.h \ - src/gui/UBDownloadWidget.h \ - src/gui/UBDockDownloadWidget.h + src/gui/UBNavigatorPalette.h \ + src/gui/UBDocumentNavigator.h \ + src/gui/UBDockPalette.h \ + src/gui/UBPropertyPalette.h \ + src/gui/UBLibNavigatorWidget.h \ + src/gui/UBLibItemProperties.h \ + src/gui/UBLibActionBar.h \ + src/gui/UBLibraryWidget.h \ + src/gui/UBLibPathViewer.h \ + src/gui/UBUpdateDlg.h \ + src/gui/UBDockPaletteWidget.h \ + src/gui/UBLeftPalette.h \ + src/gui/UBRightPalette.h \ + src/gui/UBPageNavigationWidget.h \ + src/gui/UBLibWidget.h \ + src/gui/UBMagnifer.h \ + src/gui/UBCachePropertiesWidget.h \ + src/gui/UBTeacherBarWidget.h \ + src/gui/UBLibWebView.h \ + src/gui/UBDownloadWidget.h \ + src/gui/UBDockDownloadWidget.h \ + src/gui/UBMediaPlayer.h SOURCES += src/gui/UBThumbnailView.cpp \ src/gui/UBFloatingPalette.cpp \ @@ -75,27 +76,28 @@ SOURCES += src/gui/UBThumbnailView.cpp \ src/gui/UBActionPalette.cpp \ src/gui/UBFavoriteToolPalette.cpp \ src/gui/UBKeyboardPalette.cpp \ - src/gui/UBNavigatorPalette.cpp \ - src/gui/UBDocumentNavigator.cpp \ - src/gui/UBDockPalette.cpp \ - src/gui/UBPropertyPalette.cpp \ - src/gui/UBLibNavigatorWidget.cpp \ - src/gui/UBLibItemProperties.cpp \ - src/gui/UBLibActionBar.cpp \ - src/gui/UBLibraryWidget.cpp \ - src/gui/UBLibPathViewer.cpp \ - src/gui/UBUpdateDlg.cpp \ - src/gui/UBDockPaletteWidget.cpp \ - src/gui/UBLeftPalette.cpp \ - src/gui/UBRightPalette.cpp \ - src/gui/UBPageNavigationWidget.cpp \ - src/gui/UBLibWidget.cpp \ - src/gui/UBMagnifer.cpp \ - src/gui/UBCachePropertiesWidget.cpp \ - src/gui/UBTeacherBarWidget.cpp \ - src/gui/UBLibWebView.cpp \ - src/gui/UBDownloadWidget.cpp \ - src/gui/UBDockDownloadWidget.cpp + src/gui/UBNavigatorPalette.cpp \ + src/gui/UBDocumentNavigator.cpp \ + src/gui/UBDockPalette.cpp \ + src/gui/UBPropertyPalette.cpp \ + src/gui/UBLibNavigatorWidget.cpp \ + src/gui/UBLibItemProperties.cpp \ + src/gui/UBLibActionBar.cpp \ + src/gui/UBLibraryWidget.cpp \ + src/gui/UBLibPathViewer.cpp \ + src/gui/UBUpdateDlg.cpp \ + src/gui/UBDockPaletteWidget.cpp \ + src/gui/UBLeftPalette.cpp \ + src/gui/UBRightPalette.cpp \ + src/gui/UBPageNavigationWidget.cpp \ + src/gui/UBLibWidget.cpp \ + src/gui/UBMagnifer.cpp \ + src/gui/UBCachePropertiesWidget.cpp \ + src/gui/UBTeacherBarWidget.cpp \ + src/gui/UBLibWebView.cpp \ + src/gui/UBDownloadWidget.cpp \ + src/gui/UBDockDownloadWidget.cpp \ + src/gui/UBMediaPlayer.cpp win32 { @@ -123,3 +125,5 @@ linux-g++-64 { SOURCES += src/gui/UBKeyboardPalette_linux.cpp } + + diff --git a/src/podcast/youtube/UBYouTubePublisher.cpp b/src/podcast/youtube/UBYouTubePublisher.cpp index 5cd44662..f160d4a4 100644 --- a/src/podcast/youtube/UBYouTubePublisher.cpp +++ b/src/podcast/youtube/UBYouTubePublisher.cpp @@ -24,7 +24,7 @@ #include "core/UBSetting.h" #include "gui/UBMainWindow.h" -#include "gui/UBVideoPlayer.h" +//#include "gui/UBVideoPlayer.h" #include "network/UBNetworkAccessManager.h" #include "network/UBServerXMLHttpRequest.h" diff --git a/src/web/UBWebController.cpp b/src/web/UBWebController.cpp index f556872f..436397b3 100644 --- a/src/web/UBWebController.cpp +++ b/src/web/UBWebController.cpp @@ -14,8 +14,6 @@ */ #include -#include -#include #include "frameworks/UBPlatformUtils.h" @@ -62,6 +60,7 @@ UBWebController::UBWebController(UBMainWindow* mainWindow) // , mKeyboardCurrentPalette(0) , mToolsPalettePositionned(false) , mDownloadViewIsVisible(false) + { connect(mMainWindow->actionWebTools, SIGNAL(toggled(bool)), this, SLOT(toggleWebToolsPalette(bool))); @@ -73,13 +72,11 @@ UBWebController::UBWebController(UBMainWindow* mainWindow) mToolsPalettePositionnedList[i] = false; } - connect(&mOEmbedParser, SIGNAL(oembedParsed(QVector)), this, SLOT(onOEmbedParsed(QVector))); - - // TODO : Comment the next line to continue the Youtube button bugfix initialiazemOEmbedProviders(); } + UBWebController::~UBWebController() { // NOOP @@ -96,6 +93,7 @@ void UBWebController::initialiazemOEmbedProviders() mOEmbedProviders << "metacafe.com"; mOEmbedProviders << "qik.com"; mOEmbedProviders << "slideshare"; + mOEmbedProviders << "5min.com"; mOEmbedProviders << "twitpic.com"; mOEmbedProviders << "viddler.com"; mOEmbedProviders << "vimeo.com"; @@ -328,53 +326,16 @@ void UBWebController::activePageChanged() mTrapFlashController->updateTrapFlashFromPage((*mCurrentWebBrowser)->currentTabWebView()->page()->currentFrame()); } - - mMainWindow->actionWebTrap->setChecked(false); QUrl latestUrl = (*mCurrentWebBrowser)->currentTabWebView()->url(); - - // TODO : Uncomment the next line to continue the youtube button bugfix - //UBApplication::mainWindow->actionWebOEmbed->setEnabled(hasEmbeddedContent()); - // And remove this line once the previous one is uncommented UBApplication::mainWindow->actionWebOEmbed->setEnabled(isOEmbedable(latestUrl)); - UBApplication::mainWindow->actionEduMedia->setEnabled(isEduMedia(latestUrl)); emit activeWebPageChanged((*mCurrentWebBrowser)->currentTabWebView()); } } -bool UBWebController::hasEmbeddedContent() -{ - bool bHasContent = false; - if(mCurrentWebBrowser){ - QString html = (*mCurrentWebBrowser)->currentTabWebView()->webPage()->mainFrame()->toHtml(); - - // search the presence of "+oembed" - QString query = "\\+oembed([^>]*)>"; - QRegExp exp(query); - exp.indexIn(html); - QStringList results = exp.capturedTexts(); - if(2 <= results.size() && "" != results.at(1)){ - // An embedded content has been found, no need to check the other ones - bHasContent = true; - }else{ - QList contentUrls; - lookForEmbedContent(&html, "embed", "src", &contentUrls); - lookForEmbedContent(&html, "video", "src", &contentUrls); - lookForEmbedContent(&html, "object", "data", &contentUrls); - - // TODO: check the hidden iFrame - - if(!contentUrls.empty()){ - bHasContent = true; - } - } - } - - return bHasContent; -} QPixmap UBWebController::captureCurrentPage() { @@ -580,12 +541,9 @@ void UBWebController::showTabAtTop(bool attop) void UBWebController::captureoEmbed() { - if ( mCurrentWebBrowser && (*mCurrentWebBrowser) && (*mCurrentWebBrowser)->currentTabWebView()){ - // TODO : Uncomment the next lines to continue the youtube button bugfix - // getEmbeddableContent(); - - // And comment from here - + if ( mCurrentWebBrowser && (*mCurrentWebBrowser) + && (*mCurrentWebBrowser)->currentTabWebView()) + { QWebView* webView = (*mCurrentWebBrowser)->currentTabWebView(); QUrl currentUrl = webView->url(); @@ -599,56 +557,9 @@ void UBWebController::captureoEmbed() UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector); } } - // --> Until here } } -void UBWebController::lookForEmbedContent(QString* pHtml, QString tag, QString attribute, QList *pList) -{ - if(NULL != pHtml && NULL != pList){ - QVector urlsFound; - // Check for content - QRegExp exp(QString("<%0(.*)").arg(tag)); - exp.indexIn(*pHtml); - QStringList strl = exp.capturedTexts(); - if(2 <= strl.size() && strl.at(1) != ""){ - // Here we call this regular expression: - // src\s?=\s?['"]([^'"]*)['"] - // It says: give me all characters that are after src=" (or src = ") - QRegExp src(QString("%0\\s?=\\s?['\"]([^'\"]*)['\"]").arg(attribute)); - for(int i=1; iappend(QUrl(urls.at(1))); - } - } - } - } -} - -void UBWebController::checkForOEmbed(QString *pHtml) -{ - mOEmbedParser.parse(*pHtml); -} - -void UBWebController::getEmbeddableContent() -{ - // Get the source code of the page - if(mCurrentWebBrowser){ - QNetworkAccessManager* pNam = (*mCurrentWebBrowser)->currentTabWebView()->webPage()->networkAccessManager(); - if(NULL != pNam){ - QString html = (*mCurrentWebBrowser)->currentTabWebView()->webPage()->mainFrame()->toHtml(); - mOEmbedParser.setNetworkAccessManager(pNam); - - // First, we have to check if there is some oembed content - checkForOEmbed(&html); - - // Note: The other contents will be verified once the oembed ones have been checked - } - } -} void UBWebController::captureEduMedia() { @@ -809,38 +720,3 @@ void UBWebController::cut() act->trigger(); } } - -void UBWebController::onOEmbedParsed(QVector contents) -{ - QList urls; - - foreach(sOEmbedContent cnt, contents){ - urls << QUrl(cnt.url); - } - - // TODO : Implement this - //lookForEmbedContent(&html, "embed", "src", &urls); - //lookForEmbedContent(&html, "video", "src", &contentUrls); - //lookForEmbedContent(&html, "object", "data", &contentUrls); - - // TODO: check the hidden iFrame - - if(!urls.empty()){ - QUrl contentUrl; // The selected content url - - if(1 == urls.size()){ - contentUrl = urls.at(0); - }else{ - // TODO : Display a dialog box asking the user which content to get and set contentUrl to the selected content - - } - - UBGraphicsW3CWidgetItem * widget = UBApplication::boardController->activeScene()->addOEmbed(contentUrl); - - if(widget) - { - UBApplication::applicationController->showBoard(); - UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector); - } - } -} diff --git a/src/web/UBWebController.h b/src/web/UBWebController.h index 8faa752d..29640cbe 100644 --- a/src/web/UBWebController.h +++ b/src/web/UBWebController.h @@ -19,7 +19,6 @@ #include #include -#include "web/UBOEmbedParser.h" class WBBrowserWindow; class UBApplication; @@ -31,6 +30,7 @@ class WBWebView; class UBServerXMLHttpRequest; //class UBKeyboardPalette; + class UBWebController : public QObject { Q_OBJECT; @@ -88,9 +88,6 @@ class UBWebController : public QObject void captureEduMedia(); bool isOEmbedable(const QUrl& pUrl); - bool hasEmbeddedContent(); - void getEmbeddableContent(); - bool isEduMedia(const QUrl& pUrl); void copy(); @@ -98,36 +95,41 @@ class UBWebController : public QObject void cut(); private: - void initialiazemOEmbedProviders(); - void tutorialWebInstance(); - void webBrowserInstance(); - void paraschoolWebInstance(); - void lookForEmbedContent(QString* pHtml, QString tag, QString attribute, QList* pList); - void checkForOEmbed(QString* pHtml); - QStackedWidget mStackedWidget[TotalNumberOfWebInstances]; + UBMainWindow *mMainWindow; + WBBrowserWindow* mWebBrowserList[TotalNumberOfWebInstances]; WBBrowserWindow** mCurrentWebBrowser; + QWidget* mBrowserWidget; UBTrapFlashController* mTrapFlashController; UBWebToolsPalette** mToolsCurrentPalette; UBWebToolsPalette* mToolsPaletteList[TotalNumberOfWebInstances]; // UBKeyboardPalette** mKeyboardCurrentPalette; // UBKeyboardPalette* mKeyboardPaletteList[TotalNumberOfWebInstances]; + bool mToolsPalettePositionned; bool mToolsPalettePositionnedList[TotalNumberOfWebInstances]; + bool mDownloadViewIsVisible; + QStringList mOEmbedProviders; - UBOEmbedParser mOEmbedParser; + + void initialiazemOEmbedProviders(); + + void tutorialWebInstance(); + void webBrowserInstance(); + void paraschoolWebInstance(); private slots: void activePageChanged(); void trapFlash(); + void toggleWebTrap(bool checked); - void onOEmbedParsed(QVector contents); + // void showKeyboard(bool checked); signals: @@ -137,6 +139,7 @@ class UBWebController : public QObject * @param pCapturedPixmap QPixmap corresponding to the capture. */ void imageCaptured(const QPixmap& pCapturedPixmap, bool pageMode, const QUrl& source); + void activeWebPageChanged(WBWebView* pWebView); }; diff --git a/src/web/web.pri b/src/web/web.pri index 8d89a572..0e38d0c0 100644 --- a/src/web/web.pri +++ b/src/web/web.pri @@ -26,8 +26,7 @@ HEADERS += src/web/UBWebController.h \ src/web/browser/WBUrlLineEdit.h \ src/web/browser/WBWebView.h \ src/web/browser/WBHistory.h \ - src/web/browser/WBWebTrapWebView.h \ - src/web/UBOEmbedParser.h + src/web/browser/WBWebTrapWebView.h SOURCES += src/web/UBWebController.cpp \ src/web/UBTrapFlashController.cpp \ @@ -47,7 +46,8 @@ SOURCES += src/web/UBWebController.cpp \ src/web/browser/WBUrlLineEdit.cpp \ src/web/browser/WBWebView.cpp \ src/web/browser/WBHistory.cpp \ - src/web/browser/WBWebTrapWebView.cpp \ - src/web/UBOEmbedParser.cpp + src/web/browser/WBWebTrapWebView.cpp + +