]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.h
Dolphin is now a KUniqueApplication. A lot of thanks go to Oscar Blumberg, who submit...
[dolphin.git] / src / dolphinmainwindow.h
index 6052ec5baf5395fd36ecbdce7c709830ac3e3579..7a71b685c2905801308b1d10ab0fea543be405f6 100644 (file)
@@ -47,13 +47,14 @@ 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();
 
@@ -97,6 +98,20 @@ public:
      */
     KNewMenu* newMenu() const { return m_newMenu; }
 
+public slots:
+    /**
+     * Returns the main windows ID, mainly used throught 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
@@ -147,9 +162,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.
@@ -171,6 +183,9 @@ private slots:
     /** Sets the text of the 'Undo' menu action to \a text. */
     void slotUndoTextChanged(const QString& text);
 
+    /** Performs the current undo operation. */
+    void undo();
+
     /**
      * Copies all selected items to the clipboard and marks
      * the items as cutted.
@@ -214,6 +229,15 @@ private slots:
     /** The sorting of the current view should be done by the date. */
     void sortByDate();
 
+    /** The sorting of the current view should be done by the permissions. */
+    void sortByPermissions();
+
+    /** The sorting of the current view should be done by the owner. */
+    void sortByOwner();
+
+    /** The sorting of the current view should be done by the group. */
+    void sortByGroup();
+
     /** Switches between an ascending and descending sorting order. */
     void toggleSortOrder();
 
@@ -326,7 +350,7 @@ private slots:
     void openNewMainWindow();
 
 private:
-    DolphinMainWindow();
+    DolphinMainWindow(int id);
     void init();
     void loadSettings();
 
@@ -351,10 +375,6 @@ private:
     void connectViewSignals(int viewIndex);
 
 private:
-    KNewMenu* m_newMenu;
-    QSplitter* m_splitter;
-    DolphinView* m_activeView;
-
     /**
      * DolphinMainWindowsupports only one or two views, which
      * are handled internally as primary and secondary view.
@@ -364,17 +384,14 @@ private:
         PrimaryIdx = 0,
         SecondaryIdx = 1
     };
-    DolphinView* m_view[SecondaryIdx + 1];
-
-    /// remember pending undo operations until they are finished
-    QList<KonqOperations::Operation> m_undoOperations;
 
     /**
      * Implements a custom error handling for the undo manager. This
      * assures that all errors are shown in the status bar of Dolphin
      * instead as modal error dialog with an OK button.
      */
-    class UndoUiInterface : public KonqUndoManager::UiInterface {
+    class UndoUiInterface : public KonqUndoManager::UiInterface
+    {
     public:
         UndoUiInterface(DolphinMainWindow* mainWin);
         virtual ~UndoUiInterface();
@@ -383,6 +400,16 @@ private:
     private:
         DolphinMainWindow* m_mainWin;
     };
+
+    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;
 };
 
 #endif // _DOLPHIN_H_