]> cloud.milkyroute.net Git - dolphin.git/blob - src/dolphinremoteencoding.h
BUG: 175658
[dolphin.git] / src / dolphinremoteencoding.h
1 /***************************************************************************
2 * Copyright (C) 2009 by Rahman Duran <rahman.duran@gmail.com> *
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, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
19
20 #ifndef DOLPHINREMOTEENCODING_H
21 #define DOLPHINREMOTEENCODING_H
22
23 #include <QStringList>
24 #include <QtGui/QAction>
25 #include <kurl.h>
26
27
28 class KActionMenu;
29 class DolphinViewActionHandler;
30
31 /**
32 * @brief Allows to chnage character encoding for remote urls like ftp.
33 *
34 * When browsing remote url, its possible to change encoding from Tools Menu.
35 */
36
37 class DolphinRemoteEncoding: public QObject
38 {
39 Q_OBJECT
40 public:
41 DolphinRemoteEncoding(QObject* parent, DolphinViewActionHandler* actionHandler);
42 ~DolphinRemoteEncoding();
43
44 public Q_SLOTS:
45 void slotAboutToOpenUrl();
46 void slotItemSelected(QAction* action);
47 void slotReload();
48 void slotDefault();
49
50 private Q_SLOTS:
51 void slotAboutToShow();
52
53 private:
54 void updateView();
55 void loadSettings();
56 void fillMenu();
57 void updateMenu();
58
59 KActionMenu* m_menu;
60 QStringList m_encodingDescriptions;
61 KUrl m_currentURL;
62 DolphinViewActionHandler* m_actionHandler;
63
64 bool m_loaded;
65 int m_idDefault;
66 };
67
68 #endif