]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/infosidebarpage.h
include cleanup
[dolphin.git] / src / infosidebarpage.h
index 938b869597568c16ef05ca639b252706090111b7..5aa4f5d07c7e47a1612b3d08d56148e0f76eae4b 100644 (file)
 
 #include <sidebarpage.h>
 
-#include <qpushbutton.h>
-#include <QPixmap>
-#include <QEvent>
-#include <QLabel>
-#include <QList>
+#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;
 }
 
@@ -48,21 +49,23 @@ 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(QWidget* parent = 0);
     virtual ~InfoSidebarPage();
 
 public slots:
-    void setUrl(const KUrl& url);
-    void setSelection(const KFileItemList& selection);
+    virtual void setUrl(const KUrl& url);
+    virtual void setSelection(const KFileItemList& selection);
+
+protected:
+    /** @see QWidget::showEvent() */
+    virtual void showEvent(QShowEvent* event);
 
 private slots:
     /**
@@ -89,19 +92,13 @@ 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:
     /**
@@ -129,17 +126,12 @@ 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;
     KUrl m_shownUrl;
     KUrl m_urlCandidate;
-       KFileItemList m_currentSelection;
 
     PixmapViewer* m_preview;
     QLabel* m_name;
@@ -147,40 +139,7 @@ private:
     QString m_infoLines;
     QLabel* m_infos;
 
-    KVBox* m_actionBox;
-    QVector<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