]> cloud.milkyroute.net Git - dolphin.git/blob - src/panels/places/placesitemeditdialog.h
5f61eede2605106a174e84501b8770ebde403b54
[dolphin.git] / src / panels / places / placesitemeditdialog.h
1 /***************************************************************************
2 * Copyright (C) 2012 by Peter Penz <peter.penz19@gmail.com> *
3 * *
4 * Based on KFilePlaceEditDialog from kdelibs: *
5 * Copyright (C) 2001,2002,2003 Carsten Pfeiffer <pfeiffer@kde.org> *
6 * Copyright (C) 2007 Kevin Ottens <ervin@kde.org> * *
7 * *
8 * This program is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation; either version 2 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This program is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU General Public License *
19 * along with this program; if not, write to the *
20 * Free Software Foundation, Inc., *
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
22 ***************************************************************************/
23
24 #ifndef PLACESITEMEDITDIALOG_H
25 #define PLACESITEMEDITDIALOG_H
26
27 #include <QDialog>
28 #include <QUrl>
29
30 class KIconButton;
31 class KUrlRequester;
32 class QLineEdit;
33 class QCheckBox;
34 class QDialogButtonBox;
35
36 class PlacesItemEditDialog: public QDialog
37 {
38 Q_OBJECT
39
40 public:
41 explicit PlacesItemEditDialog(QWidget* parent = 0);
42 ~PlacesItemEditDialog() override;
43
44 void setIcon(const QString& icon);
45 QString icon() const;
46
47 void setText(const QString& text);
48 QString text() const;
49
50 void setUrl(const QUrl& url);
51 QUrl url() const;
52
53 void setAllowGlobal(bool allow);
54 bool allowGlobal() const;
55
56 protected:
57 bool event(QEvent* event) override;
58
59 private slots:
60 void slotUrlChanged(const QString& text);
61
62 private:
63 void initialize();
64
65 private:
66 QString m_icon;
67 QString m_text;
68 QUrl m_url;
69 bool m_allowGlobal;
70
71 KUrlRequester* m_urlEdit;
72 QLineEdit* m_textEdit;
73 KIconButton* m_iconButton;
74 QCheckBox* m_appLocal;
75 QDialogButtonBox *m_buttonBox;
76 };
77
78 #endif