17 #ifndef QGSEXTERNALRESOURCEWIDGET_H
18 #define QGSEXTERNALRESOURCEWIDGET_H
57 if ( qobject_cast<QgsExternalResourceWidget *>( sipCpp ) )
58 sipType = sipType_QgsExternalResourceWidget;
65 Q_PROPERTY(
bool fileWidgetVisible READ fileWidgetVisible WRITE setFileWidgetVisible )
66 Q_PROPERTY(
DocumentViewerContent documentViewerContent READ documentViewerContent WRITE setDocumentViewerContent )
67 Q_PROPERTY(
int documentViewerHeight READ documentViewerHeight WRITE setDocumentViewerHeight )
68 Q_PROPERTY(
int documentViewerWidth READ documentViewerWidth WRITE setDocumentViewerWidth )
69 Q_PROPERTY(
QgsFileWidget::RelativeStorage relativeStorage READ relativeStorage WRITE setRelativeStorage )
70 Q_PROPERTY( QString defaultRoot READ defaultRoot WRITE setDefaultRoot )
91 QVariant documentPath( QVariant::Type type = QVariant::String )
const;
92 void setDocumentPath(
const QVariant &documentPath );
100 bool fileWidgetVisible()
const;
102 void setFileWidgetVisible(
bool visible );
110 int documentViewerHeight()
const;
116 void setDocumentViewerHeight(
int height );
118 int documentViewerWidth()
const;
124 void setDocumentViewerWidth(
int width );
127 void setReadOnly(
bool readOnly );
146 QString defaultRoot()
const;
152 void setDefaultRoot(
const QString &defaultRoot );
160 void setStorageType(
const QString &storageType );
168 QString storageType()
const;
175 void setStorageAuthConfigId(
const QString &authCfg );
181 QString storageAuthConfigId()
const;
197 void valueChanged(
const QString & );
200 void loadDocument(
const QString &path );
201 void onFetchFinished();
204 void updateDocumentViewer();
209 void updateDocumentContent(
const QString &filePath );
216 QString resolvePath(
const QString &path );
219 bool mFileWidgetVisible =
true;
220 DocumentViewerContent mDocumentViewerContent = NoContent;
221 int mDocumentViewerHeight = 0;
222 int mDocumentViewerWidth = 0;
224 QString mDefaultRoot;
230 QWebView *mWebView =
nullptr;
233 QLabel *mLoadingLabel =
nullptr;
234 QLabel *mErrorLabel =
nullptr;
235 QMovie *mLoadingMovie =
nullptr;
236 QPointer<QgsExternalStorageFetchedContent> mContent;
238 friend class TestQgsExternalResourceWidgetWrapper;
241 #endif // QGSEXTERNALRESOURCEWIDGET_H