summaryrefslogtreecommitdiffstats
path: root/src/app/Panel/krselectionmode.h
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2025-08-28 22:44:34 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2025-08-31 23:25:26 +0900
commit086012dcad8a976a0dabbb7cbc20c9cb612cdfa9 (patch)
tree56c9bfcfd7cd13b17707dc8862f26932e9814973 /src/app/Panel/krselectionmode.h
parent409e7f624d202c7f96b4d0ab2da1834135169f8b (diff)
downloadkrusader-master.tar.gz
krusader-master.zip
Restructure source foldersHEADmaster
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'src/app/Panel/krselectionmode.h')
-rw-r--r--src/app/Panel/krselectionmode.h97
1 files changed, 97 insertions, 0 deletions
diff --git a/src/app/Panel/krselectionmode.h b/src/app/Panel/krselectionmode.h
new file mode 100644
index 0000000..1e6770a
--- /dev/null
+++ b/src/app/Panel/krselectionmode.h
@@ -0,0 +1,97 @@
+#ifndef KR_SELECTION_MODE_H
+#define KR_SELECTION_MODE_H
+
+/**
+ Every selection mode inherits this class, and has to implement init().
+ Usage:
+ KrSelectionMode::getSelectionHandler()->whateverFunctionYouNeed()
+
+ \note You can call KrSelectionMode::resetSelectionHandler() if you want the
+ selection mode to be re-read. This is useful after a configuration where you
+ changed the selection mode. calling resetSelectionHandler() will cause the next
+ call to getSelectionHandler() to (possibly) select a different mode.
+*/
+class KrSelectionMode {
+public:
+ static KrSelectionMode * getSelectionHandler();
+ static void resetSelectionHandler();
+
+ virtual void init() = 0; // everyone must implement this in order to be a selection mode
+ inline bool useTQTSelection() { return _useTQTSelection; }
+ inline bool spaceMovesDown() { return _spaceMovesDown; }
+ inline bool insertMovesDown() { return _insertMovesDown; }
+ inline bool spaceCalculatesDiskSpace() { return _spaceCalculatesDiskSpace; }
+ inline bool rightButtonSelects() { return _rightButtonSelects; }
+ inline bool leftButtonSelects() { return _leftButtonSelects; }
+ inline bool rightButtonPreservesSelection() { return _rightButtonPreservesSelection; }
+ inline bool leftButtonPreservesSelection() { return _leftButtonPreservesSelection; }
+ inline bool shiftCtrlRightButtonSelects() { return _shiftCtrlRightButtonSelects; }
+ inline bool shiftCtrlLeftButtonSelects() { return _shiftCtrlLeftButtonSelects; }
+ inline int showContextMenu() { return _showContextMenu; } // 0: no, -1: yes, n>0: after n milliseconds
+
+ virtual ~KrSelectionMode() {}
+
+protected:
+ bool _useTQTSelection, _spaceMovesDown, _insertMovesDown, _spaceCalculatesDiskSpace;
+ bool _rightButtonSelects, _leftButtonSelects, _rightButtonPreservesSelection;
+ bool _leftButtonPreservesSelection, _shiftCtrlRightButtonSelects, _shiftCtrlLeftButtonSelects;
+ int _showContextMenu;
+};
+
+class KonqSelectionMode : public KrSelectionMode {
+public:
+ void init() {
+ _useTQTSelection = true;
+ _spaceMovesDown = false;
+ _insertMovesDown = true;
+ _spaceCalculatesDiskSpace = false;
+ _rightButtonSelects = true;
+ _leftButtonSelects = true;
+ _rightButtonPreservesSelection = false;
+ _leftButtonPreservesSelection = false;
+ _shiftCtrlRightButtonSelects = false;
+ _shiftCtrlLeftButtonSelects = false;
+ _showContextMenu = -1;
+ }
+};
+
+class OriginalSelectionMode : public KrSelectionMode {
+public:
+ void init() {
+ _useTQTSelection = false;
+ _spaceMovesDown = true;
+ _insertMovesDown = true;
+ _spaceCalculatesDiskSpace = true;
+ _rightButtonSelects = true;
+ _leftButtonSelects = true;
+ _rightButtonPreservesSelection = false;
+ _leftButtonPreservesSelection = false;
+ _shiftCtrlRightButtonSelects = false;
+ _shiftCtrlLeftButtonSelects = false;
+ _showContextMenu = -1;
+ }
+};
+
+class TCSelectionMode : public KrSelectionMode {
+public:
+ void init() {
+ _useTQTSelection = false;
+ _spaceMovesDown = false;
+ _insertMovesDown = true;
+ _spaceCalculatesDiskSpace = true;
+ _rightButtonSelects = true;
+ _leftButtonSelects = false;
+ _rightButtonPreservesSelection = true;
+ _leftButtonPreservesSelection = false;
+ _shiftCtrlRightButtonSelects = false;
+ _shiftCtrlLeftButtonSelects = true;
+ _showContextMenu = 500;
+ }
+};
+
+class UserSelectionMode: public KrSelectionMode {
+public:
+ void init();
+};
+
+#endif // KR_SELECTION_MODE_H