]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.h
DolphinPart: provide a way to switch between view modes in konqueror.
[dolphin.git] / src / dolphinmainwindow.h
index 93ab2762a0810790b9d81232f4345dda4eb4cabb..dac0c0be8fada949ffc85c04592521fe34f13ddf 100644 (file)
 
 #include <config-nepomuk.h>
 
-#include <kxmlguiwindow.h>
-#include <ksortablelist.h>
+#include <kfileitemdelegate.h>
 #include <konq_undo.h>
+#include <ksortablelist.h>
+#include <kxmlguiwindow.h>
 
 #include <QtCore/QList>
 
@@ -60,14 +61,14 @@ public:
      * having a split view setup, the nonactive view
      * is usually shown in darker colors.
      */
-    inline DolphinViewContainer* activeViewContainer() const;
+    DolphinViewContainer* activeViewContainer() const;
 
     /**
      * Returns true, if the main window contains two instances
      * of a view container. The active view constainer can be
      * accessed by DolphinMainWindow::activeViewContainer().
      */
-    inline bool isSplit() const;
+    bool isSplit() const;
 
     /**
      * If the main window contains two instances of a view container
@@ -81,7 +82,7 @@ public:
     void rename(const KUrl& oldUrl, const KUrl& newUrl);
 
     /**
-     * Refreshs the views of the main window by recreating them dependent from
+     * Refreshes the views of the main window by recreating them dependent from
      * the given Dolphin settings.
      */
     void refreshViews();
@@ -90,7 +91,7 @@ public:
      * Returns the 'Create New...' sub menu which also can be shared
      * with other menus (e. g. a context menu).
      */
-    inline KNewMenu* newMenu() const;
+    KNewMenu* newMenu() const;
 
 public slots:
     /**
@@ -110,7 +111,7 @@ public slots:
     /**
      * Returns the main window ID used through DBus.
      */
-    inline int getId() const;
+    int getId() const;
 
     /**
      * Inform all affected dolphin components (sidebars, views) of an URL
@@ -148,9 +149,9 @@ signals:
 
     /**
      * Is emitted if information of an item is requested to be shown e. g. in the sidebar.
-     * It the URL is empty, no item information request is pending.
+     * If item is null, no item information request is pending.
      */
-    void requestItemInfo(const KUrl& url);
+    void requestItemInfo(const KFileItem& item);
 
 protected:
     /** @see QMainWindow::closeEvent */
@@ -250,14 +251,8 @@ private slots:
      */
     void invertSelection();
 
-    /** The current active view is switched to the icons mode. */
-    void setIconsView();
-
-    /** The current active view is switched to the details mode. */
-    void setDetailsView();
-
-    /** The current active view is switched to the column mode. */
-    void setColumnView();
+    /** The current active view is switched to a new view mode. */
+    void setViewMode(QAction *);
 
     /** The sorting of the current view should be done by the name. */
     void sortByName();
@@ -292,20 +287,14 @@ private slots:
     /** Switches between sorting by categories or not. */
     void toggleSortCategorization();
 
-    /**
-     * Clears any additional information for an item except for the
-     * name and the icon.
-     */
-    void clearInfo();
-
-    /** Shows the MIME type as additional information for the item. */
-    void showMimeInfo();
+    /** Switches between showing the MIME type as additional information for the item or not. */
+    void toggleMimeInfo();
 
-    /** Shows the size as additional information for the item. */
-    void showSizeInfo();
+    /** Switches between showing the size as additional information for the item or not. */
+    void toggleSizeInfo();
 
-    /** Shows the date as additional information for the item. */
-    void showDateInfo();
+    /** Switchtes between showing the date as additional information for the item or not. */
+    void toggleDateInfo();
 
     /**
      * Switches between one and two views:
@@ -398,7 +387,7 @@ private slots:
     void slotSortOrderChanged(Qt::SortOrder order);
 
     /** Updates the state of the 'Additional Information' actions. */
-    void slotAdditionalInfoChanged(KFileItemDelegate::AdditionalInformation info);
+    void slotAdditionalInfoChanged(KFileItemDelegate::InformationList info);
 
     /**
      * Updates the state of the 'Edit' menu actions and emits
@@ -407,7 +396,7 @@ private slots:
     void slotSelectionChanged(const KFileItemList& selection);
 
     /** Emits the signal requestItemInfo(). */
-    void slotRequestItemInfo(const KUrl& url);
+    void slotRequestItemInfo(const KFileItem&);
 
     /**
      * Updates the state of the 'Back' and 'Forward' menu
@@ -457,11 +446,19 @@ private:
 
     /**
      * Updates the text of the split action:
-     * If \a isSplit is true, the text is set to "Split",
+     * If two views are shown, the text is set to "Split",
      * otherwise the text is set to "Join". The icon
-     * is updated to match with the text.
+     * is updated to match with the text and the currently active view.
+     */
+    void updateSplitAction();
+
+    /**
+     * Helper method for the slots toggleDateInfo(), toggleSizeInfo()
+     * and toggleMimeInfo(). Applies \a info dependent from the  current
+     * checked state of the action \a actionName to the file item delegate.
      */
-    void updateSplitAction(bool isSplit);
+    void toggleAdditionalInfo(const char* actionName,
+                              KFileItemDelegate::Information info);
 
 private:
     /**
@@ -500,22 +497,22 @@ private:
     QList<KonqUndoManager::CommandType> m_undoCommandTypes;
 };
 
-DolphinViewContainer* DolphinMainWindow::activeViewContainer() const
+inline DolphinViewContainer* DolphinMainWindow::activeViewContainer() const
 {
     return m_activeViewContainer;
 }
 
-bool DolphinMainWindow::isSplit() const
+inline bool DolphinMainWindow::isSplit() const
 {
     return m_viewContainer[SecondaryView] != 0;
 }
 
-KNewMenu* DolphinMainWindow::newMenu() const
+inline KNewMenu* DolphinMainWindow::newMenu() const
 {
     return m_newMenu;
 }
 
-int DolphinMainWindow::getId() const
+inline int DolphinMainWindow::getId() const
 {
     return m_id;
 }