File indexing completed on 2024-05-19 12:22:37
0001 /* 0002 SPDX-FileCopyrightText: 2006-2007 Alexander Dymo <adymo@kdevelop.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef KDEVPLATFORM_URLDOCUMENT_H 0008 #define KDEVPLATFORM_URLDOCUMENT_H 0009 0010 #include <QUrl> 0011 0012 #include "sublimeexport.h" 0013 0014 #include "document.h" 0015 0016 namespace Sublime { 0017 0018 class UrlDocumentPrivate; 0019 0020 /** 0021 @short Basic document that has an URL. 0022 */ 0023 class KDEVPLATFORMSUBLIME_EXPORT UrlDocument: public Document 0024 { 0025 Q_OBJECT 0026 public: 0027 UrlDocument(Controller *controller, const QUrl &url); 0028 ~UrlDocument() override; 0029 0030 QString documentType() const override; 0031 0032 QString documentSpecifier() const override; 0033 0034 QUrl url() const; 0035 0036 /** 0037 * @return the icon for the mimetype of the document url. 0038 */ 0039 QIcon defaultIcon() const override; 0040 0041 QString title(TitleType type) const override; 0042 0043 protected: 0044 QWidget *createViewWidget(QWidget *parent = nullptr) override; 0045 void setUrl(const QUrl& newUrl); 0046 0047 private: 0048 const QScopedPointer<class UrlDocumentPrivate> d_ptr; 0049 Q_DECLARE_PRIVATE(UrlDocument) 0050 }; 0051 0052 } 0053 0054 #endif 0055