]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/admin/workerintegration.h
Add margins to the zoom menu entry
[dolphin.git] / src / admin / workerintegration.h
index 51230374460677531680330bcb4bf1d8a37197dd..1e32c33d37b2f1470d1cff787cfc12234a2dcc22 100644 (file)
@@ -11,6 +11,7 @@
 #include <QObject>
 
 class DolphinMainWindow;
+class DolphinViewContainer;
 class KActionCollection;
 class QAction;
 class QUrl;
@@ -22,6 +23,15 @@ class QUrl;
  */
 namespace Admin
 {
+/**
+ * When a user starts Dolphin with arguments that imply that they want to use administrative rights, this method is called.
+ * This function acts like a command line program that guides users towards installing kio-admin. It will not return until this is accomplished.
+ * This function will do nothing if kio-admin is already installed.
+ */
+void guideUserTowardsInstallingAdminWorker();
+
+void guideUserTowardsUsingAdminWorker();
+
 /**
  * Used with the KMessageBox API so users can disable the warning.
  * @see KMessageBox::saveDontShowAgainContinue()
@@ -49,9 +59,18 @@ public:
     static void createActAsAdminAction(KActionCollection *actionCollection, DolphinMainWindow *dolphinMainWindow);
 
     /**
-     * Triggers the m_actAsAdminAction only if it is currently checked.
+     * An interface that only allows friend classes to show the WorkerIntegration::m_actAsAdminAction to users.
+     * Aside from these friend classes the action is only accessible through the actionCollection of DolphinMainWindow.
      */
-    static void exitAdminMode();
+    class FriendAccess
+    {
+        /** @returns WorkerIntegration::m_actAsAdminAction or crashes if WorkerIntegration::createActAsAdminAction() has not been called previously. */
+        static QAction *actAsAdminAction();
+
+        friend class Bar; /// Allows the bar to access the actAsAdminAction, so users can use the bar to change who they are acting as.
+        friend DolphinViewContainer; // Allows the view container to access the actAsAdminAction, so the action can be shown to users when they are trying to
+                                     // view a folder for which they are lacking read permissions.
+    };
 
 private:
     WorkerIntegration(DolphinMainWindow *parent, QAction *actAsAdminAction);