]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/infosidebarpage.h
include cleanup
[dolphin.git] / src / infosidebarpage.h
index 6664f56fce9a94ade64fc87e824cc2e53afafa68..5aa4f5d07c7e47a1612b3d08d56148e0f76eae4b 100644 (file)
 
 #include <sidebarpage.h>
 
-#include <q3valuevector.h>
-#include <qpushbutton.h>
-//Added by qt3to4:
-#include <QPixmap>
-#include <QEvent>
-#include <QLabel>
-#include <Q3PtrList>
+#include <QtGui/QPushButton>
+#include <QtGui/QPixmap>
+#include <QtCore/QEvent>
+#include <QtGui/QLabel>
+#include <QtCore/QList>
 
 #include <kurl.h>
 #include <kmimetype.h>
-#include <kdedesktopmimetype.h>
+#include <kdesktopfileactions.h>
 #include <kvbox.h>
 
-namespace KIO {
+namespace KIO
+{
     class Job;
 }
 
@@ -46,26 +45,27 @@ class QPainter;
 class KFileItem;
 class QLabel;
 class KVBox;
-class Q3Grid;
 class PixmapViewer;
 class MetaDataWidget;
 
 /**
- * @brief Prototype for a information sidebar.
- *
- * Will be exchanged in future releases by pluggable sidebar pages...
+ * @brief Sidebar for showing meta information of one ore more selected items.
  */
 class InfoSidebarPage : public SidebarPage
 {
-       Q_OBJECT
+    Q_OBJECT
 
 public:
-    explicit InfoSidebarPage(DolphinMainWindow* mainWindow, QWidget* parent = 0);
+    explicit InfoSidebarPage(QWidget* parent = 0);
     virtual ~InfoSidebarPage();
 
+public slots:
+    virtual void setUrl(const KUrl& url);
+    virtual void setSelection(const KFileItemList& selection);
+
 protected:
-    /** @see SidebarPage::activeViewChanged() */
-    virtual void activeViewChanged();
+    /** @see QWidget::showEvent() */
+    virtual void showEvent(QShowEvent* event);
 
 private slots:
     /**
@@ -76,14 +76,6 @@ private slots:
      */
     void requestDelayedItemInfo(const KUrl& url);
 
-    /**
-     * Does a request of information for the item of the given Url and
-     * provides default actions.
-     *
-     * @see InfoSidebarPage::showItemInfo()
-     */
-    void requestItemInfo(const KUrl& url);
-
     /**
      * Shows the information for the item of the Url which has been provided by
      * InfoSidebarPage::requestItemInfo() and provides default actions.
@@ -100,27 +92,15 @@ private slots:
      * Is invoked if no preview is available for the item. In this
      * case the icon will be shown.
      */
-    void slotPreviewFailed(const KFileItem* item);
+    void showIcon(const KFileItem& item);
 
     /**
      * Is invoked if a preview is available for the item. The preview
      * \a pixmap is shown inside the info page.
      */
-    void gotPreview(const KFileItem* item, const QPixmap& pixmap);
-
-    /**
-     * Starts the service of m_actionsVector with the index \index on
-     * the shown Url (or the selected items if available).
-     */
-    void startService(int index);
+    void showPreview(const KFileItem& item, const QPixmap& pixmap);
 
 private:
-    /**
-     * Connects to signals from the currently active Dolphin view to get
-     * informed about highlighting changes.
-     */
-    void connectToActiveView();
-
     /**
      * Checks whether the an Url is repesented by a bookmark. If yes,
      * then the bookmark icon and name are shown instead of a preview.
@@ -146,11 +126,7 @@ private:
      */
     bool showMetaInfo(const QString& key) const;
 
-    /**
-     * Inserts the available actions to the info page for the given item.
-     */
-    void insertActions();
-
+private:
     bool m_multipleSelection;
     bool m_pendingPreview;
     QTimer* m_timer;
@@ -163,41 +139,7 @@ private:
     QString m_infoLines;
     QLabel* m_infos;
 
-    KVBox* m_actionBox;
-    Q3PtrList<QWidget> m_actionWidgets;    // TODO: use children() from QObject instead
-    Q3ValueVector<KDEDesktopMimeType::Service> m_actionsVector;
-
     MetaDataWidget* m_metadataWidget;
 };
 
-// TODO #1: move to SidebarPage?
-// TODO #2: quite same button from the optical point of view as UrlNavigatorButton
-// -> provide helper class or common base class
-class ServiceButton : public QPushButton
-{
-    Q_OBJECT
-
-public:
-    ServiceButton(const QIcon& icon,
-                  const QString& text,
-                  QWidget* parent,
-                  int index);
-    virtual ~ServiceButton();
-
-signals:
-    void requestServiceStart(int index);
-
-protected:
-    virtual void paintEvent(QPaintEvent* event);
-    virtual void enterEvent(QEvent* event);
-    virtual void leaveEvent(QEvent* event);
-
-private slots:
-    void slotReleased();
-
-private:
-    bool m_hover;
-    int m_index;
-};
-
 #endif // INFOSIDEBARPAGE_H