]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinviewactionhandler.h
First step of refactoring to improve the zooming capabilities of views:
[dolphin.git] / src / dolphinviewactionhandler.h
index a11d19bb188c3df98d60547374ff3a226794c093..5084d06fe1d0e070970e5901fae7fe0722fa6b3e 100644 (file)
 #ifndef DOLPHINVIEWACTIONHANDLER_H
 #define DOLPHINVIEWACTIONHANDLER_H
 
+#include "dolphinview.h"
 #include "libdolphin_export.h"
 #include <QtCore/QObject>
+class KToggleAction;
 class QAction;
 class QActionGroup;
 class DolphinView;
@@ -54,6 +56,12 @@ public:
      */
     void setCurrentView(DolphinView* view);
 
+    /**
+     * Returns the name of the action for the current viewmode
+     */
+    QString currentViewModeActionName() const;
+
+public Q_SLOTS:
     /**
      * Update all actions in the 'View' menu, i.e. those that depend on the
      * settings in the current view.
@@ -74,6 +82,11 @@ private Q_SLOTS:
      */
     void slotCreateDir();
 
+    /**
+     * Emitted when the user requested a change of view mode
+     */
+    void slotViewModeActionTriggered(QAction*);
+
     /**
      * Let the user input a name for the selected item(s) and trigger
      * a renaming afterwards.
@@ -113,12 +126,27 @@ private Q_SLOTS:
      */
     void slotSortOrderChanged(Qt::SortOrder order);
 
+    /**
+     * Updates the state of the 'Sort by' actions.
+     */
+    void slotSortingChanged(DolphinView::Sorting sorting);
+    
+    /**
+     * Updates the state of the 'Zoom In' and 'Zoom Out' actions.
+     */    
+    void slotZoomLevelChanged(int level);
+
     /**
      * Switches on or off the displaying of additional information
      * as specified by \a action.
      */
     void toggleAdditionalInfo(QAction* action);
 
+    /**
+     * Changes the sorting of the current view.
+     */
+    void slotSortTriggered(QAction*);
+
     /**
      * Updates the state of the 'Additional Information' actions.
      */
@@ -144,6 +172,25 @@ private Q_SLOTS:
      */
     void slotShowHiddenFilesChanged();
 
+    /**
+     * Opens the view properties dialog, which allows to modify the properties
+     * of the currently active view.
+     */
+    void slotAdjustViewProperties();
+
+    /**
+     * Opens the Find File dialog for the currently shown directory.
+     */
+    void slotFindFile();
+
+    /**
+     * Connected to the "properties" action.
+     * Opens the properties dialog for the selected items of the
+     * active view. The properties dialog shows information
+     * like name, size and permissions.
+     */
+    void slotProperties();
+
 private:
     /**
      * Create all the actions.
@@ -156,10 +203,33 @@ private:
      */
     QActionGroup* createAdditionalInformationActionGroup();
 
+    /**
+     * Creates an action group with all the "sort by" actions in it.
+     * Helper method for createActions();
+     */
+    QActionGroup* createSortByActionGroup();
+
+    /**
+     * Returns the "switch to icons mode" action.
+     * Helper method for createActions();
+     */
+    KToggleAction* iconsModeAction();
+
+    /**
+     * Returns the "switch to details mode" action.
+     * Helper method for createActions();
+     */
+    KToggleAction* detailsModeAction();
+
+    /**
+     * Returns the "switch to columns mode" action.
+     * Helper method for createActions();
+     */
+    KToggleAction* columnsModeAction();
+
+
     KActionCollection* m_actionCollection;
     DolphinView* m_currentView;
 };
 
-
 #endif /* DOLPHINVIEWACTIONHANDLER_H */
-