MainPage   Related pages 
DataBaseWebInterfaceWidget.h
1 
2 //
3 // $Id: DataBaseWebInterfaceWidget.h 3773 2020-07-24 10:16:34Z ansgar.horstmann $
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 
139  QString createPdfByTemplate(QString templateFileName, QString pdfFileName);
140 
182  void setPaperSize(int paperSize);
183 
190  void setOrientation(int orientation);
191 
197  void setPageMargins(double L, double R, double T, double B);
198 
200  double getPageMarginTop();
202  double getPageMarginBottom();
204  double getPageMarginLeft();
206  double getPageMarginRight();
207 
208  /*
209  Returns logical DPI of your printing device. <br>
210  Standard is 96 DPI.<br>
211  Necessary for printing on devices with different OS scaling.
212 
213  \since 2.4.4, 2019-06-18, th/ah
214  */
215  double getLogicalDpi();
216 
218 #pragma endregion
219 
220 
221 #pragma region DATABASE
222 
234  void processUpdate();
235 
254  void dataChanged();
255 
263  void setImmediateUpdate(bool);
264 
266 #pragma endregion
267 
268 
269 #pragma region URL, PAGE
270 
275  void reloadPage();
276 
280  void loadUrl( QString url );
281 
296  void addSuffix(QString suffix);
297 
301  void resetSuffixList();
302 
306  void clearHistory();
307 
313  void redirectUrl(QString originalUrl, QString redirectUrl) { _redirectURLs.insert(originalUrl, redirectUrl); }
314 
316 #pragma endregion
317 
318 
322  double getZoomFactor();
323 
327  void setZoomFactor(double v);
328 
329 
333  void savePicture();
334 
335 
336 #pragma region PROGRESS
337 
360  void showProgress( const QVariantMap& v );
361 
367  void hideProgress();
368 
374  void clearProgressMessage();
375 
381  void showProgressMessage( const QString& );
382 
388  void showProgressMessageLabel( const QString& );
389 
396  void showProgressValue( double v );
397 
401  void showProgressMessageConsole( QString v );
402 
415  int getProgressState();
416 
420  void processEvents() { QApplication::processEvents(); }
421 
432  void enableInterruptJavaScriptMsg( bool enable );
433 
438  void clearMemoryCaches();
439 
444  void disableObjectCache();
445 
447 #pragma endregion
448 
451  void delegateSimulationActivated(bool);
453  void delegateSimulationDateChanged(QDateTime);
455 
458  private slots:
459 
460  void onImmediateUpdateChanged(bool);
461  void onImmediateUpdateClicked();
462 
467  void onUrlEntered();
468 
472  void onAddBookmarkClicked();
473 
477  void printPreview(QPrinter*);
478 
479  void onProjectAboutToBeOpened();
480  void onProjectOpened(domainBim::ProjectOpenedInfo);
481  void onProjectClosed(domainBim::ProjectClosedInfo);
482 
483  void printByTemplate(QString templateFN);
484 
485  void updatePrintMenu();
486  void onMenuItemTriggered(QAction* action);
487 
488  void printToPdf();
489  void showPrintTools();
490 
491  void toggleNavigation();
492 
496  void _clearDebugOutput();
497 
501  void _onContextMenuRequested_DebugOutput(const QPoint& pt);
502 
503  private:
504 
505  void _getData();
506  void _writeData();
507 
508  void _onLoadFinished(bool ok);
509  void _onLinkClicked(const QUrl& url);
510  void _onUrlChanged (const QUrl & url);
511  QString _renderHtmlTemplate(const QString& templateFileName);
512  void _populateJavaScriptWindowObject();
513 
514 
515  std::unique_ptr<Ui::DataBaseWebInterfaceWidget> ui;
516 
517  domainDB::DataBaseModel* _dbmodel;
518  desiteCore::NavigatorProject& _navProject;
519  desiteCore::NavigatorProjectAPI* _navProjectAPI;
520 
521  QHash<QString,QString> _currentValues;
522 
523  modelGui::WebViewWrapperWidget* _webForm;
524 
525  bool _isOpening;
526  bool _isWritingData;
527 
528  modelGui::ExportPreviewWidget* _exportPreview;
529 
530  QMenu* _printMenu;
531 
532  QHash<QString,PrintTemplateRecord> _printTemplateHash;
533  basicGui::PrintWidget* _printWidget;
534 
535  QStringList _handleLinksByWindowsSuffixList;
536 
537  WebFormsProgressWidget* _progressWidget;
538  basicGui::TextBrowserProgress* _tbProgress;
539 
540  QString _lockIconOpen;
541  QString _lockIconLocked;
542 
543  QHash<QString, QString> _redirectURLs;
544 
545  };
546 
547 }
Definition: DataBaseWebInterfaceWidget.h:15
Definition: DataBaseWebInterfaceWidget.h:23
void processEvents()
Definition: DataBaseWebInterfaceWidget.h:420
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:313
Definition: ProjectAPI.h:16
Definition: DataBaseWebInterfaceWidget.h:30
Definition: DataBaseWebInterfaceWidget.h:38

Created: Fri Feb 5 2021 09:33:06