validators.h (3226B)
1 // Copyright (c) 2003 - 2009 Anselm R Garbe <anselm@garbe.us> 2 // See LICENSE for license details. 3 4 #ifndef __VALIDATORS_H 5 #define __VALIDATORS_H 6 7 #include "wmi.h" 8 9 #include "singleton.h" 10 11 class Kernel; 12 class Monitor; 13 14 class Validators; 15 16 /** Note: existance checks are qualified only on focused stuff. */ 17 class Validators : public Singleton<Validators> 18 { 19 20 public: 21 22 Validators(); 23 ~Validators(); 24 25 // validation methods 26 bool isAlwaysPossible(); 27 28 /** 29 * Return <code>true</code> if a client can be unhooked. 30 */ 31 bool validateUnhookClient(); 32 33 /** 34 * Return <code>true</code> if a client can be unhooked. 35 */ 36 bool validateHookClient(); 37 38 /** 39 * Returns <code>true</code> if a frame is focussed and there're 40 * more frames. 41 */ 42 bool validateCycleFrame(); 43 44 /** Returns <code>true</code> if the wmi kernel has recorded actions. */ 45 bool validateEndRecord(); 46 47 /** Returns <code>true</code> if the wmi is recording actions. */ 48 bool validateCancelRecord(); 49 50 /** Returns <code>true</code> if the wmi kernel is not recording actions. */ 51 bool validateBeginRecord(); 52 53 /** Returns <code>true</code> if a workspace exists. */ 54 bool isWorkspaceFocused(); 55 56 /** Returns <code>true</code> if at least two workspaces exist. */ 57 bool existMonitors(); 58 59 /** Returns <code>true</code> if at least two workspaces exist. */ 60 bool existWorkspaces(); 61 62 bool isEmptyWorkspaceFocused(); 63 bool validateDestroyWorkspace(); 64 bool validateDestroyFrame(); 65 66 bool validateDestroyAction(); 67 68 /** Validates directional grow/shrink actions. */ 69 bool validateResizeLeft(); 70 bool validateResizeRight(); 71 bool validateResizeUp(); 72 bool validateResizeDown(); 73 74 /** Returns <code>true</code> if a frame into direction exist. */ 75 bool existsFrameLeft(); 76 bool existsFrameRight(); 77 bool existsFrameUp(); 78 bool existsFrameDown(); 79 80 /** Returns <code>true</code> if a frame is focused. */ 81 bool isFrameFocused(); 82 83 /** Returns <code>true</code> if a frame or client exist. */ 84 bool isFrameOrClientFrameFocused(); 85 86 /** Returns <code>true</code> if at least two frames exist. */ 87 bool existFrames(); 88 89 /** Returns <code>true</code> if toggleMode is valid. */ 90 bool validateToggleMode(); 91 92 /** Returns <code>true</code> if a client frame exists. */ 93 bool isClientFrameFocused(); 94 95 /** Returns <code>true</code> if a client exists. */ 96 bool isClientFocused(); 97 98 /** Returns <code>true</code> if a floating client exists. */ 99 bool isFloatingClientFocused(); 100 101 /** Returns <code>true</code> if at least two clients exists. */ 102 bool existClients(); 103 104 /** Returns <code>true</code> if at least two clients exists. */ 105 bool existClientsWithinFrame(); 106 107 bool existsDetachedClient(); 108 bool existDetachedClients(); 109 110 /** Returns <code>true</code> if input mode is not active. */ 111 bool validateInputMode(); 112 113 /** 114 * Returns <code>true</code> if any client exists on the 115 * focused monitor. 116 */ 117 bool validateSelectClient(); 118 #ifdef SLOT_SUPPORT 119 bool existsSlotClient(); 120 bool existSlotTabs(); 121 #endif // SLOT_SUPPORT 122 123 }; 124 125 #endif // __VALIDATORS_H