/usr/include/kparts/browseropenorsavequestion.h is in kdelibs5-dev 4:4.14.16-0ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | /*
Copyright (c) 2009 David Faure <faure@kde.org>
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2 of the License or ( at
your option ) version 3 or, at the discretion of KDE e.V. ( which shall
act as a proxy as in section 14 of the GPLv3 ), any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef BROWSEROPENORSAVEQUESTION_H
#define BROWSEROPENORSAVEQUESTION_H
#include "kparts_export.h"
#include <kdialog.h>
#include "browserrun.h"
#include <kservice.h>
namespace KParts {
class BrowserOpenOrSaveQuestionPrivate;
/**
* This class shows the dialog that asks the user whether to
* save a url or open a url in another application.
*
* It also has the variant which asks "save or embed" (e.g. into konqueror).
*
* @since 4.4
*/
class KPARTS_EXPORT BrowserOpenOrSaveQuestion
{
public:
/**
* Constructor, for all kinds of dialogs shown in this class.
* @param url the URL in question
* @param mimeType the mimetype of the URL
*/
BrowserOpenOrSaveQuestion(QWidget* parent, const KUrl& url, const QString& mimeType);
~BrowserOpenOrSaveQuestion();
/**
* Sets the suggested filename, shown in the dialog.
* @param suggestedFileName optional file name suggested by the server (HTTP Content-Disposition)
*/
void setSuggestedFileName(const QString& suggestedFileName);
/**
* Set of features that should be enabled in this dialog.
* This allows to add features before making all applications ready for those features
* (e.g. applications need to read selectedService() otherwise the dialog should not
* show the service selection button)
*/
enum Feature { BasicFeatures = 0, /**< Only the basic save, open, embed, cancel button */
ServiceSelection = 1 /**< Shows "Open With..." with the associated applications for the mimetype */
};
Q_DECLARE_FLAGS(Features, Feature)
/**
* Enables the given features in the dialog
*/
void setFeatures(Features features);
enum Result { Save, Open, Embed, Cancel };
/**
* Ask the user whether to save or open a url in another application.
* @param parent parent widget for the dialog
* @return Save, Open or Cancel.
*/
Result askOpenOrSave();
/**
* Ask the user whether to save or open a url in another application.
* @param parent parent widget for the dialog
* @param flags set to BrowserRun::AttachmentDisposition if suggested by the server
* This is used because by default text/html files are opened embedded in browsers, not saved.
* But if the server said "attachment", it means the user is download a file for saving it.
* @return Save, Embed or Cancel.
*/
Result askEmbedOrSave(int flags = 0);
// KDE5 TODO: move BrowserRun::AskEmbedOrSaveFlags to this class.
// TODO askOpenEmbedOrSave
/**
* @return the service that was selected during askOpenOrSave,
* if it returned Open.
* In all other cases (no associated application, Save or Cancel
* selected), this returns 0.
*
* Requires setFeatures(BrowserOpenOrSaveQuestion::ServiceSelection).
*/
KService::Ptr selectedService() const;
private:
BrowserOpenOrSaveQuestionPrivate* const d;
};
}
#endif /* BROWSEROPENORSAVEQUESTION_H */
|