KFile
kurlnavigatorprotocolcombo_p.h
Go to the documentation of this file.
00001 /*************************************************************************** 00002 * Copyright (C) 2006 by Aaron J. Seigo (<aseigo@kde.org>) * 00003 * Copyright (C) 2009 by Peter Penz (<peter.penz@kde.org>) * 00004 * * 00005 * This library is free software; you can redistribute it and/or * 00006 * modify it under the terms of the GNU Lesser General Public * 00007 * License as published by the Free Software Foundation; either * 00008 * version 2 of the License, or (at your option) any later version. * 00009 * * 00010 * This library is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00013 * Lesser General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU Lesser General Public * 00016 * License along with this library; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * 00019 ***************************************************************************/ 00020 00021 #ifndef KURLNAVIGATORPROTOCOLCOMBO_P_H 00022 #define KURLNAVIGATORPROTOCOLCOMBO_P_H 00023 00024 #include "kurlnavigatorbuttonbase_p.h" 00025 00026 #include <QtCore/QHash> 00027 00028 class QMenu; 00029 00030 namespace KDEPrivate 00031 { 00032 00041 class KUrlNavigatorProtocolCombo : public KUrlNavigatorButtonBase 00042 { 00043 Q_OBJECT 00044 00045 public: 00046 explicit KUrlNavigatorProtocolCombo(const QString& protocol, QWidget* parent = 0); 00047 00048 QString currentProtocol() const; 00049 00050 void setCustomProtocols(const QStringList &protocols); 00051 00052 virtual QSize sizeHint() const; 00053 00054 public Q_SLOTS: 00055 void setProtocol(const QString& protocol); 00056 00057 Q_SIGNALS: 00058 void activated(const QString& protocol); 00059 00060 protected: 00061 virtual void showEvent(QShowEvent* event); 00062 virtual void paintEvent(QPaintEvent* event); 00063 00064 private Q_SLOTS: 00065 void setProtocol(QAction* action); 00066 00067 private: 00068 void updateMenu(); 00069 void initializeCategories(); 00070 00071 enum ProtocolCategory 00072 { 00073 CoreCategory, 00074 PlacesCategory, 00075 DevicesCategory, 00076 SubversionCategory, 00077 OtherCategory, 00078 CategoryCount // mandatory last entry 00079 }; 00080 00081 QMenu* m_menu; 00082 QStringList m_protocols; 00083 QHash<QString, ProtocolCategory> m_categories; 00084 }; 00085 00086 } // namespace KDEPrivate 00087 00088 #endif
KDE 4.7 API Reference