MainPage   Related pages 
DataBaseWebInterfaceWidget.h
1 
2 //
3 // $Id: DataBaseWebInterfaceWidget.h 4764 2021-04-14 19:48:25Z stefan.losch $
4 // (c) ceapoint aec technologies GmbH
5 //
6 
7 
8 #pragma once
9 
10 #include "desiteCoreGui.h"
11 
12 #include <domainBim/ProjectClosedInfo.h>
13 #include <domainBim/ProjectOpenedInfo.h>
14 
15 namespace Ui {
16  class DataBaseWebInterfaceWidget;
17 }
18 
19 namespace basicGui {
20  class PrintWidget;
21  class TextBrowserProgress;
22 }
23 namespace model {
24  class IGlobalProject;
25 }
26 namespace modelGui {
27  class ExportPreviewWidget;
28  class WebViewWrapperWidget;
29 }
30 namespace domainDB {
31  class DataBaseModel;
32 }
33 namespace desiteCore {
34  class NavigatorProject;
35  class NavigatorProjectAPI;
36 }
37 
38 namespace desiteCoreGui
39 {
40 
41  class WebFormsProgressWidget;
42 
53  class DataBaseWebInterfaceWidget : public QWidget
54  {
55  Q_OBJECT
56 
57  public:
58 
61  DataBaseWebInterfaceWidget(desiteCore::NavigatorProject& navProject, QWidget *parent, Qt::WindowFlags flags = 0);
63 
64  bool getOpeningFlag() const { return _isOpening; }
65  void setOpeningFlag( bool opening ) { _isOpening = opening; }
66 
67  void enableWebInspector(bool enable);
68  void showButtonConsole(bool v);
69  void showButtonPrintByTemplate(bool v);
70  void showTitle(bool v);
71  void changeTitle(const QString& title);
72  void toggleConsole();
73  void updateHomeButtonToolTip();
74 
78  void setupTouchConfig(QObject* objectForTouchEventFilter, const QString& footerStylesheet);
79 
83  modelGui::WebViewWrapperWidget* getWebFormPtr();
84 
88  void addOrRenameBookmark(const QString& url, const QString& suggestedName);
89 
90 
91  public slots:
92 
93  void lockTable(bool v);
94 
95  void onDbUpdateFinished();
96 
99 #pragma region HEADER, FOOTER, DEBUG CONSOLE
100 
105  void setFooterVisible( bool visible );
106 
110  void setHeaderVisible( bool visible );
111 
115  void showNavigation(bool visible);
116 
120  void showConsole(bool);
121 
123 #pragma endregion
124 
125 
126 #pragma region PRINTING
127 
144  QString createPdfByTemplate(QString templateFileName, QString pdfFileName, bool openPdf = true);
145 
187  void setPaperSize(int paperSize);
188 
195  void setOrientation(int orientation);
196 
202  void setPageMargins(double L, double R, double T, double B);
203 
205  double getPageMarginTop();
207  double getPageMarginBottom();
209  double getPageMarginLeft();
211  double getPageMarginRight();
212 
213  /*
214  Returns logical DPI of your printing device. <br>
215  Standard is 96 DPI.<br>
216  Necessary for printing on devices with different OS scaling.
217 
218  \since 2.4.4, 2019-06-18, th/ah
219  */
220  double getLogicalDpi();
221 
223 #pragma endregion
224 
225 
226 #pragma region DATABASE
227 
239  void processUpdate();
240 
259  void dataChanged();
260 
268  void setImmediateUpdate(bool);
269 
271 #pragma endregion
272 
273 
274 #pragma region URL, PAGE
275 
280  void reloadPage();
281 
285  void loadUrl( QString url );
286 
301  void addSuffix(QString suffix);
302 
306  void resetSuffixList();
307 
311  void clearHistory();
312 
318  void redirectUrl(QString originalUrl, QString redirectUrl) { _redirectURLs.insert(originalUrl, redirectUrl); }
319 
321 #pragma endregion
322 
323 
327  double getZoomFactor();
328 
332  void setZoomFactor(double v);
333 
334 
338  void savePicture();
339 
340 
341 #pragma region PROGRESS
342 
365  void showProgress( const QVariantMap& v );
366 
372  void hideProgress();
373 
379  void clearProgressMessage();
380 
386  void showProgressMessage( const QString& );
387 
393  void showProgressMessageLabel( const QString& );
394 
401  void showProgressValue( double v );
402 
406  void showProgressMessageConsole( QString v );
407 
420  int getProgressState();
421 
425  void processEvents() { QApplication::processEvents(); }
426 
437  void enableInterruptJavaScriptMsg( bool enable );
438 
443  void clearMemoryCaches();
444 
449  void disableObjectCache();
450 
452 #pragma endregion
453 
456  void delegateSimulationActivated(bool);
458  void delegateSimulationDateChanged(QDateTime);
460 
463  private slots:
464 
465  void onImmediateUpdateChanged(bool);
466  void onImmediateUpdateClicked();
467 
472  void onUrlEntered();
473 
477  void onAddBookmarkClicked();
478 
482  void printPreview(QPrinter*);
483 
484  void onProjectAboutToBeOpened();
485  void onProjectOpened(domainBim::ProjectOpenedInfo);
486  void onProjectClosed(domainBim::ProjectClosedInfo);
487 
488  void printByTemplate(QString templateFN);
489 
490  void updatePrintMenu();
491  void onMenuItemTriggered(QAction* action);
492 
493  void printToPdf();
494  void showPrintTools();
495 
496  void toggleNavigation();
497 
501  void _clearDebugOutput();
502 
506  void _onContextMenuRequested_DebugOutput(const QPoint& pt);
507 
508  private:
509 
510  void _getData();
511  void _writeData();
512 
513  void _onLoadFinished(bool ok);
514  void _onLinkClicked(const QUrl& url);
515  void _onUrlChanged (const QUrl & url);
516  QString _renderHtmlTemplate(const QString& templateFileName);
517  void _populateJavaScriptWindowObject();
518 
519 
520  std::unique_ptr<Ui::DataBaseWebInterfaceWidget> ui;
521 
522  domainDB::DataBaseModel* _dbmodel;
523  desiteCore::NavigatorProject& _navProject;
524  desiteCore::NavigatorProjectAPI* _navProjectAPI;
525 
526  QHash<QString,QString> _currentValues;
527 
528  modelGui::WebViewWrapperWidget* _webForm;
529 
530  bool _isOpening;
531  bool _isWritingData;
532 
533  modelGui::ExportPreviewWidget* _exportPreview;
534 
535  QMenu* _printMenu;
536 
537  QHash<QString,PrintTemplateRecord> _printTemplateHash;
538  basicGui::PrintWidget* _printWidget;
539 
540  QStringList _handleLinksByWindowsSuffixList;
541 
542  WebFormsProgressWidget* _progressWidget;
543  basicGui::TextBrowserProgress* _tbProgress;
544 
545  QString _lockIconOpen;
546  QString _lockIconLocked;
547 
548  QHash<QString, QString> _redirectURLs;
549 
550  };
551 
552 }
Definition: DataBaseWebInterfaceWidget.h:15
Definition: DataBaseWebInterfaceWidget.h:23
void processEvents()
Definition: DataBaseWebInterfaceWidget.h:425
Definition: DataBaseWebInterfaceWidget.h:26
Definition: DataBaseWebInterfaceWidget.h:53
Definition: DataBaseWebInterfaceWidget.h:19
Definition: NavigatorProjectAPI.h:34
void redirectUrl(QString originalUrl, QString redirectUrl)
Definition: DataBaseWebInterfaceWidget.h:318
Definition: ProjectAPI.h:15
Definition: DataBaseWebInterfaceWidget.h:30
Definition: DataBaseWebInterfaceWidget.h:38

Created: Tue Dec 13 2022 13:14:00