1 /**************************************************************************** 2 ** 3 ** DQt - D bindings for the Qt Toolkit 4 ** 5 ** GNU Lesser General Public License Usage 6 ** This file may be used under the terms of the GNU Lesser 7 ** General Public License version 3 as published by the Free Software 8 ** Foundation and appearing in the file LICENSE.LGPL3 included in the 9 ** packaging of this file. Please review the following information to 10 ** ensure the GNU Lesser General Public License version 3 requirements 11 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. 12 ** 13 ****************************************************************************/ 14 module qt.gui.desktopservices; 15 extern(C++): 16 17 import qt.config; 18 import qt.helpers; 19 static if(!defined!"QT_NO_DESKTOPSERVICES" && !defined!"QT_NO_STANDARDPATHS") 20 import qt.core.standardpaths; 21 static if(!defined!"QT_NO_DESKTOPSERVICES") 22 { 23 import qt.core.object; 24 import qt.core.string; 25 import qt.core.url; 26 } 27 28 static if(!defined!"QT_NO_DESKTOPSERVICES") 29 { 30 31 /+ class QStringList; 32 class QUrl; 33 class QObject; +/ 34 35 extern(C++, class) struct /+ Q_GUI_EXPORT +/ QDesktopServices 36 { 37 public: 38 static bool openUrl(ref const(QUrl) url); 39 static void setUrlHandler(ref const(QString) scheme, QObject receiver, const(char)* method); 40 static void unsetUrlHandler(ref const(QString) scheme); 41 42 /+ #if QT_DEPRECATED_SINCE(5, 0) 43 //Must match QStandardPaths::StandardLocation 44 enum StandardLocation { 45 DesktopLocation, 46 DocumentsLocation, 47 FontsLocation, 48 ApplicationsLocation, 49 MusicLocation, 50 MoviesLocation, 51 PicturesLocation, 52 TempLocation, 53 HomeLocation, 54 DataLocation, 55 CacheLocation 56 }; 57 58 QT_DEPRECATED static QString storageLocation(StandardLocation type) { 59 return storageLocationImpl(static_cast<QStandardPaths::StandardLocation>(type)); 60 } 61 QT_DEPRECATED static QString displayName(StandardLocation type) { 62 return QStandardPaths::displayName(static_cast<QStandardPaths::StandardLocation>(type)); 63 } 64 #endif +/ 65 private: 66 static QString storageLocationImpl(mixin((!defined!"QT_NO_STANDARDPATHS") ? q{QStandardPaths.StandardLocation } : q{AliasSeq!()}) type); 67 } 68 69 } 70