]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.h
Step 1 of 2 to fix the issue that reloading of a directory resets the contents positi...
[dolphin.git] / src / dolphinmainwindow.h
index 4cfe31077138480461569740c886ecd1e12e5d81..d481a9e317e7ebdbb0edaf091343304e9c98f0cb 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
  ***************************************************************************/
 
-#ifndef _DOLPHIN_MAINWINDOW_H_
-#define _DOLPHIN_MAINWINDOW_H_
+#ifndef DOLPHIN_MAINWINDOW_H
+#define DOLPHIN_MAINWINDOW_H
 
 #include "dolphinview.h"
 
 #include <kmainwindow.h>
 #include <ksortablelist.h>
-#include <konq_operations.h>
 #include <konq_undo.h>
 
 #include <QList>
 
+class DolphinApplication;
 class KNewMenu;
-class KPrinter;
 class KUrl;
-class QLineEdit;
-class KFileIconView;
-class KHBox;
-class Q3IconViewItem;
 class QSplitter;
-class KAction;
-class UrlNavigator;
-class DolphinApplication;
 
 /**
  * @short Main window for Dolphin.
  *
  * Handles the menus, toolbars and Dolphin views.
- *
- * @author Peter Penz <peter.penz@gmx.at>
-*/
+ */
 class DolphinMainWindow: public KMainWindow
 {
     Q_OBJECT
+    Q_CLASSINFO("D-Bus Interface", "org.kde.dolphin.MainWindow")
+    Q_PROPERTY(int id READ getId SCRIPTABLE true)
     friend class DolphinApplication;
+
 public:
     virtual ~DolphinMainWindow();
 
@@ -72,19 +65,22 @@ public:
     DolphinView* activeView() const { return m_activeView; }
 
     /**
-     * Handles the dropping of Urls to the given
+     * Handles the dropping of URLs to the given
      * destination. A context menu with the options
      * 'Move Here', 'Copy Here', 'Link Here' and
      * 'Cancel' is offered to the user.
-     * @param urls        List of Urls which have been
+     * @param urls        List of URLs which have been
      *                    dropped.
-     * @param destination Destination Url, where the
-     *                    list or Urls should be moved,
+     * @param destination Destination URL, where the
+     *                    list or URLs should be moved,
      *                    copied or linked to.
      */
     void dropUrls(const KUrl::List& urls,
                   const KUrl& destination);
 
+    /** Renames the item represented by \a oldUrl to \a newUrl. */
+    void rename(const KUrl& oldUrl, const KUrl& newUrl);
+
     /**
      * Refreshs the views of the main window by recreating them dependent from
      * the given Dolphin settings.
@@ -97,6 +93,20 @@ public:
      */
     KNewMenu* newMenu() const { return m_newMenu; }
 
+public slots:
+    /**
+     * Returns the main window ID used through DBus.
+     */
+    int getId() const { return m_id; }
+
+    /**
+     * Changes the URL of the current active DolphinView to \a url.
+     */
+    void changeUrl(const QString& url);
+
+    /** Stores all settings and quits Dolphin. */
+    void quit();
+
 signals:
     /**
      * Is send if the active view has been changed in
@@ -131,7 +141,10 @@ private slots:
     /** Updates the 'Create New...' sub menu. */
     void updateNewMenu();
 
-    /** Renames the selected item of the active view. */
+    /**
+     * Let the user input a name for the selected item(s) and trigger
+     * a renaming afterwards.
+     */
     void rename();
 
     /** Moves the selected items of the active view to the trash. */
@@ -147,9 +160,6 @@ private slots:
      */
     void properties();
 
-    /** Stores all settings and quits Dolphin. */
-    void quit();
-
     /**
      * Shows the error information of the job \a job
      * in the status bar.
@@ -229,6 +239,21 @@ private slots:
     /** Switches between an ascending and descending sorting order. */
     void toggleSortOrder();
 
+    /**
+     * 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();
+
+    /** Shows the size as additional information for the item. */
+    void showSizeInfo();
+
+    /** Shows the date as additional information for the item. */
+    void showDateInfo();
+
     /**
      * Switches between one and two views:
      * If one view is visible, it will get split into two views.
@@ -280,16 +305,16 @@ private slots:
      */
     void adjustViewProperties();
 
-    /** Goes back on step of the Url history. */
+    /** Goes back on step of the URL history. */
     void goBack();
 
-    /** Goes forward one step of the Url history. */
+    /** Goes forward one step of the URL history. */
     void goForward();
 
-    /** Goes up one hierarchy of the current Url. */
+    /** Goes up one hierarchy of the current URL. */
     void goUp();
 
-    /** Goes to the home Url. */
+    /** Goes to the home URL. */
     void goHome();
 
     /** Opens a terminal for the current shown directory. */
@@ -307,6 +332,9 @@ private slots:
     /** Updates the state of all 'View' menu actions. */
     void slotViewModeChanged();
 
+    /** Updates the state of the 'Show preview' menu action. */
+    void slotShowPreviewChanged();
+
     /** Updates the state of the 'Show hidden files' menu action. */
     void slotShowHiddenFilesChanged();
 
@@ -316,6 +344,9 @@ private slots:
     /** Updates the state of the 'Sort Ascending/Descending' action. */
     void slotSortOrderChanged(Qt::SortOrder order);
 
+    /** Updates the state of the 'Additional Information' actions. */
+    void slotAdditionalInfoChanged(KFileItemDelegate::AdditionalInformation info);
+
     /** Updates the state of the 'Edit' menu actions. */
     void slotSelectionChanged();
 
@@ -327,7 +358,7 @@ private slots:
 
     /**
      * Updates the caption of the main window and the state
-     * of all menu actions which depend from a changed Url.
+     * of all menu actions which depend from a changed URL.
      */
     void slotUrlChanged(const KUrl& url);
 
@@ -338,7 +369,7 @@ private slots:
     void openNewMainWindow();
 
 private:
-    DolphinMainWindow();
+    DolphinMainWindow(int id);
     void init();
     void loadSettings();
 
@@ -392,12 +423,13 @@ private:
     KNewMenu* m_newMenu;
     QSplitter* m_splitter;
     DolphinView* m_activeView;
+    int m_id;
 
     DolphinView* m_view[SecondaryIdx + 1];
 
     /// remember pending undo operations until they are finished
-    QList<KonqOperations::Operation> m_undoOperations;
+    QList<KonqUndoManager::CommandType> m_undoCommandTypes;
 };
 
-#endif // _DOLPHIN_H_
+#endif // DOLPHIN_MAINWINDOW_H