1 /* 2 * Copyright (C) by Christian Kamm <mail@ckamm.de> 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, but 10 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 11 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * for more details. 13 */ 14 15 #ifndef GUIUTILITY_H 16 #define GUIUTILITY_H 17 18 #include <QString> 19 #include <QUrl> 20 #include <QWidget> 21 22 #include "common/pinstate.h" 23 24 namespace OCC { 25 namespace Utility { 26 27 /** Open an url in the browser. 28 * 29 * If launching the browser fails, display a message. 30 */ 31 bool openBrowser(const QUrl &url, QWidget *errorWidgetParent = nullptr); 32 33 /** Start composing a new email message. 34 * 35 * If launching the email program fails, display a message. 36 */ 37 bool openEmailComposer(const QString &subject, const QString &body, 38 QWidget *errorWidgetParent); 39 40 /** Returns a translated string indicating the current availability. 41 * 42 * This will be used in context menus to describe the current state. 43 */ 44 QString vfsCurrentAvailabilityText(VfsItemAvailability availability); 45 46 /** Translated text for "making items always available locally" */ 47 QString vfsPinActionText(); 48 49 /** Translated text for "free up local space" (and unpinning the item) */ 50 QString vfsFreeSpaceActionText(); 51 52 } // namespace Utility 53 } // namespace OCC 54 55 #endif 56