void WebViewNix::sendTouchEvent(const NIXTouchEvent& event) { page()->handleTouchEvent(NativeWebTouchEvent(event)); }
void KinotifyWidget::showEvent (QShowEvent*) { DefaultSize_ = page ()->mainFrame ()->contentsSize (); resize (DefaultSize_); SetWidgetPlace (); }
/*! Returns \c true if the page at \a index is enabled; otherwise \c false. \sa setPageEnabled() */ bool QxtConfigWidget::isPageEnabled(int index) const { const QWidget* widget = page(index); return widget && widget->isEnabled(); }
void Console::groupEnd() { InspectorInstrumentation::addMessageToConsole(page(), JSMessageSource, EndGroupMessageType, LogMessageLevel, String(), 0, String()); }
bool CurrentUrl::wasRedirectedAndNotModifiedByJavascript() { return !wasRegularLoad() && page()->currentFrame()->url() == page()->history()->currentItem().url(); }
void Console::markTimeline(PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCallStack>) { InspectorInstrumentation::consoleMarkTimeline(page(), arguments); }
void Console::timeEnd(const String& title, PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack> callStack) { InspectorInstrumentation::stopConsoleTiming(page(), title, callStack); }
void CustomWebView::contextMenuEvent (QGraphicsSceneContextMenuEvent *e) { QPointer<QMenu> menu (new QMenu ()); QWebHitTestResult r = page ()-> mainFrame ()->hitTestContent (e->pos ().toPoint ()); IHookProxy_ptr proxy (new Util::DefaultHookProxy ()); emit hookWebViewContextMenu (proxy, this, e, r, menu, WVSStart); if (!r.linkUrl ().isEmpty ()) { QUrl url = r.linkUrl (); QString text = r.linkText (); if (XmlSettingsManager::Instance ()-> property ("TryToDetectRSSLinks").toBool ()) { bool hasAtom = text.contains ("Atom"); bool hasRSS = text.contains ("RSS"); if (hasAtom || hasRSS) { LeechCraft::Entity e; if (hasAtom) { e.Additional_ ["UserVisibleName"] = "Atom"; e.Mime_ = "application/atom+xml"; } else { e.Additional_ ["UserVisibleName"] = "RSS"; e.Mime_ = "application/rss+xml"; } e.Entity_ = url; e.Parameters_ = LeechCraft::FromUserInitiated | LeechCraft::OnlyHandle; bool ch = false; emit couldHandle (e, &ch); if (ch) { QList<QVariant> datalist; datalist << url << e.Mime_; menu->addAction (tr ("Subscribe"), this, SLOT (subscribeToLink ()))->setData (datalist); menu->addSeparator (); } } } menu->addAction (tr ("Open &here"), this, SLOT (openLinkHere ()))->setData (url); menu->addAction (tr ("Open in new &tab"), this, SLOT (openLinkInNewTab ()))->setData (url); menu->addSeparator (); menu->addAction (tr ("&Save link..."), this, SLOT (saveLink ())); QList<QVariant> datalist; datalist << url << text; menu->addAction (tr ("&Bookmark link..."), this, SLOT (bookmarkLink ()))->setData (datalist); menu->addSeparator (); if (!page ()->selectedText ().isEmpty ()) menu->addAction (pageAction (QWebPage::Copy)); menu->addAction (tr ("&Copy link"), this, SLOT (copyLink ())); if (page ()->settings ()->testAttribute (QWebSettings::DeveloperExtrasEnabled)) menu->addAction (pageAction (QWebPage::InspectElement)); } else if (page ()->selectedText ().contains (UrlInText)) { menu->addAction (tr ("Open as link"), this, SLOT (openLinkInNewTab ()))-> setData (page ()->selectedText ()); } emit hookWebViewContextMenu (proxy, this, e, r, menu, WVSAfterLink); if (!r.imageUrl ().isEmpty ()) { if (!menu->isEmpty ()) menu->addSeparator (); menu->addAction (tr ("Open image here"), this, SLOT (openImageHere ()))->setData (r.imageUrl ()); menu->addAction (tr ("Open image in new tab"), this, SLOT (openImageInNewTab ())); menu->addSeparator (); menu->addAction (tr ("Save image..."), this, SLOT (saveImage ())); QAction *spx = menu->addAction (tr ("Save pixmap..."), this, SLOT (savePixmap ())); spx->setToolTip (tr ("Saves the rendered pixmap without redownloading.")); spx->setProperty ("Poshuku/OrigPX", r.pixmap ()); spx->setProperty ("Poshuku/OrigURL", r.imageUrl ()); menu->addAction (tr ("Copy image"), this, SLOT (copyImage ())); menu->addAction (tr ("Copy image location"), this, SLOT (copyImageLocation ()))->setData (r.imageUrl ()); } emit hookWebViewContextMenu (proxy, this, e, r, menu, WVSAfterImage); bool hasSelected = !page ()->selectedText ().isEmpty (); if (hasSelected) { if (!menu->isEmpty ()) menu->addSeparator (); menu->addAction (pageAction (QWebPage::Copy)); } if (r.isContentEditable ()) menu->addAction (pageAction (QWebPage::Paste)); if (hasSelected) { Browser_->Find_->setData (page ()->selectedText ()); menu->addAction (Browser_->Find_); menu->addAction (tr ("Search..."), this, SLOT (searchSelectedText ())); } emit hookWebViewContextMenu (proxy, this, e, r, menu, WVSAfterSelectedText); if (menu->isEmpty ()) menu = page ()->createStandardContextMenu (); if (!menu->isEmpty ()) menu->addSeparator (); menu->addAction (Browser_->Add2Favorites_); menu->addSeparator (); menu->addAction (Browser_->Print_); menu->addAction (Browser_->PrintPreview_); menu->addSeparator (); menu->addAction (Browser_->ViewSources_); menu->addAction (Browser_->SavePage_); menu->addSeparator (); menu->addAction (pageAction (QWebPage::ReloadAndBypassCache)); menu->addAction (Browser_->ReloadPeriodically_); menu->addAction (Browser_->NotifyWhenFinished_); menu->addSeparator (); menu->addAction (Browser_->ChangeEncoding_->menuAction ()); emit hookWebViewContextMenu (proxy, this, e, r, menu, WVSAfterFinish); if (!menu->isEmpty ()) menu->exec (Browser_->GetGraphicsView ()->viewport ()-> mapToGlobal (e->pos ().toPoint ())); else QGraphicsWebView::contextMenuEvent (e); if (menu) delete menu; }
void FrameFocus::findFrames() { frames = page()->currentFrame()->childFrames(); }
void Entity_constructPage( PreferenceGroup& group ){ PreferencesPage page( group.createPage( "Entities", "Entity Display Preferences" ) ); Entity_constructPreferences( page ); }
//! [MainWindow - addJSObject] void MainWin::addJSObject() { // Add pAnalyzer to JavaScript Frame as member "imageAnalyzer". page()->mainFrame()->addToJavaScriptWindowObject(QString("imageAnalyzer"), m_analyzer); }
void WebViewNix::sendGestureEvent(const NIXGestureEvent& event) { WebGestureEvent ev = WebEventFactory::createWebGestureEvent(event); page()->handleGestureEvent(ev); }
void WebViewNix::sendKeyEvent(const NIXKeyEvent& event) { page()->handleKeyboardEvent(NativeWebKeyboardEvent(event)); }
void WebViewNix::sendWheelEvent(const NIXWheelEvent& event) { page()->handleWheelEvent(NativeWebWheelEvent(event)); }
void WebView::setLinkDelegationPolicy ( QWebPage::LinkDelegationPolicy p ) { page()->setLinkDelegationPolicy( p ); }
void AWebView::addJavaScriptObject() { //JS object name download access through an object m downLoad page()->mainFrame()->addToJavaScriptWindowObject("download", m_downLoad); }
void Console::count(PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCallStack> callStack) { InspectorInstrumentation::consoleCount(page(), arguments, callStack); }
bool WebView::delegateReload() const { WebPage *p = qobject_cast<QtCollider::WebPage*>(page()); Q_ASSERT(p); return p->delegateReload(); }
void Console::time(const String& title) { InspectorInstrumentation::startConsoleTiming(page(), title); }
void WebView::setDelegateReload( bool flag ) { WebPage *p = qobject_cast<QtCollider::WebPage*>(page()); Q_ASSERT(p); p->setDelegateReload( flag ); }
void Console::groupCollapsed(PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCallStack> callStack) { InspectorInstrumentation::addMessageToConsole(page(), JSMessageSource, StartGroupCollapsedMessageType, LogMessageLevel, String(), arguments, callStack); }
void WebView::evaluateJavaScript ( const QString &script ) { if( script.isEmpty() ) return; QWebFrame *frame = page()->currentFrame(); if( frame ) frame->evaluateJavaScript( script ); }
bool CurrentUrl::wasRegularLoad() { return page()->currentFrame()->url() == page()->currentFrame()->requestedUrl(); }
QString WebView::html () const { return page()->mainFrame()->toHtml(); }
// Output the annotations for the whole chapter nr ch void chapter(int ch) { for (int pg=chapterdata[ch].pgfirst; pg<=chapterdata[ch].pglast; pg++) { page(ch, pg); } }
QString WebView::plainText () const { return page()->mainFrame()->toPlainText(); }
void WebView::onFeaturePermissionRequest(const QUrl &securityOrigin, QWebEnginePage::Feature feature) { if(Preferences::getInstance()->isPermissionGranted(feature)) { page()->setFeaturePermission(securityOrigin, feature, QWebEnginePage::PermissionGrantedByUser); return; } if(Preferences::getInstance()->isPermissionDenied(feature)) { page()->setFeaturePermission(securityOrigin, feature, QWebEnginePage::PermissionDeniedByUser); return; } auto permissionString = [](QWebEnginePage::Feature feature) { switch(feature) { case QWebEnginePage::Geolocation: return tr("current location"); case QWebEnginePage::MediaAudioVideoCapture: return tr("camera and microphone"); case QWebEnginePage::MediaAudioCapture: return tr("microphone"); case QWebEnginePage::MediaVideoCapture: return tr("camera"); default: return tr("unknown"); } }; qDebug() << Q_FUNC_INFO; qDebug() << securityOrigin << " " << feature; QMessageBox *box = new QMessageBox(QMessageBox::Question, tr("Permission Request"), tr("VRSteam wants to access your %1, do you want to allow that?").arg(permissionString(feature)), QMessageBox::Yes | QMessageBox::No, this); QCheckBox *checkBox = new QCheckBox(tr("Remember this decision"), box); box->setCheckBox(checkBox); box->exec(); bool accepted = box->clickedButton() == box->button(QMessageBox::Yes); if(accepted) { qDebug() << "Accepted feature request"; page()->setFeaturePermission(securityOrigin, feature, QWebEnginePage::PermissionGrantedByUser); } else { qDebug() << "Denied feature request"; page()->setFeaturePermission(securityOrigin, feature, QWebEnginePage::PermissionDeniedByUser); } if(checkBox->isChecked()) { Preferences::getInstance()->setPermission(feature, accepted); } }
QWebPage::LinkDelegationPolicy WebView::linkDelegationPolicy () const { return page()->linkDelegationPolicy(); }
///////////////////////////////////////////////////////////////////////////////// // 函数:SendMsg // // 说明:通过指定端口,发送短信 // // 参数: // // strRecvPhone,接收手机号码 // // strMsgContent,短信内容 // // strPortName,串行端口的名称 // ///////////////////////////////////////////////////////////////////////////////// int CSerialPort::SendMsg(CString strRecvPhone , CString strMsgContent) { m_strRecvPhone = strRecvPhone; m_strMsgContent = strMsgContent; int i=0 , t=0; char ans[128]; // 应答串 //char SCA[16]; // 短消息服务中心号码(SMSC地址) char TPA[16]; // 目标号码或回复号码(TP-DA或TP-RA) //char TP_PID; // 用户信息协议标识(TP-PID) //char TP_DCS; // 用户信息编码方式(TP-DCS) // char TP_UD[161]; // 原始用户信息(编码前或解码后的TP-UD) char cmd[20]; MsgList *msglist = new MsgList; int iPage = page(strMsgContent.GetBuffer(strMsgContent.GetLength()),msglist); t= m_strRecvPhone.GetLength()+2; for(i=2;i<t;i++) { TPA[i]=m_strRecvPhone.GetAt(i-2); } TPA[0]='8'; TPA[1]='6'; TPA[t]='\0'; for(int iIndex=0 ;iIndex < iPage;iIndex++) { sprintf(cmd , "AT\r"); WritePort(cmd, strlen(cmd)); Sleep(ShortSleepTime); int nLength = ReadPort(ans, 128); ans[nLength] = '\0'; sprintf(cmd, "ATE0\r"); WritePort(cmd, strlen(cmd)); Sleep(ShortSleepTime); nLength = ReadPort(ans, 128); ans[nLength] = '\0'; sprintf(cmd, "AT+CSMS=0\r"); WritePort(cmd, strlen(cmd)); Sleep(ShortSleepTime); nLength = ReadPort(ans, 128); ans[nLength] = '\0'; sprintf(cmd, "AT+CMGF=0\r"); WritePort(cmd, strlen(cmd)); Sleep(ShortSleepTime); nLength = ReadPort(ans, 128); ans[nLength] = '\0'; sm_param_temp= new SM_PARAM; strcpy(sm_param_temp->SCA,m_SmsCenterNum); sm_param_temp->TP_DCS=0x8; sm_param_temp->TP_PID=0x0; strcpy(sm_param_temp->TPA,TPA); strcpy(sm_param_temp->TP_UD,msglist->chMsg); if(iPage > 1) sprintf(sm_param_temp->TP_UD,"%d/%d %s" ,iIndex+1,iPage,msglist->chMsg); //printf("Msg :%s\n" ,sm_param_temp->TP_UD); msglist = msglist->pNext; if(!gsmSendMessage(sm_param_temp))//发送短信 { printf("Send SMS Failed\n"); return -1; } Sleep(5000); } return 0; }
void WebViewNix::sendMouseEvent(const NIXMouseEvent& event) { page()->handleMouseEvent(NativeWebMouseEvent(event, &m_lastCursorPosition)); }