diff options
author | Tobias Madl <tobias.madl.dev@gmail.com> | 2015-02-26 07:33:59 +0000 |
---|---|---|
committer | Tobias Madl <tobias.madl.dev@gmail.com> | 2015-03-06 12:27:10 +0000 |
commit | f33d6800fbdc42aa75477e31be0bba5a4a5a52c1 (patch) | |
tree | 031608831e7cc2b3ceb1decc45eab74fb1f06041 /include/vcl/idle.hxx | |
parent | 8f9b0c869222e57f738bc25d51cc6364e3c6a65a (diff) |
Idle Timer: Invented Base Class
Change-Id: I03db46afcc0cb5e5d7a134b1bdd327abb542e63c
Diffstat (limited to 'include/vcl/idle.hxx')
-rw-r--r-- | include/vcl/idle.hxx | 49 |
1 files changed, 5 insertions, 44 deletions
diff --git a/include/vcl/idle.hxx b/include/vcl/idle.hxx index 3a63e6ef286a..9cb734546fb0 100644 --- a/include/vcl/idle.hxx +++ b/include/vcl/idle.hxx @@ -21,62 +21,23 @@ #define INCLUDED_VCL_IDLE_HXX #include <tools/link.hxx> -#include <tools/solar.h> -#include <vcl/dllapi.h> +#include <vcl/scheduler.hxx> -struct ImplIdleData; -struct ImplSVData; - -enum class IdlePriority { - HIGHEST = 0, - HIGH = 1, - REPAINT = 2, - RESIZE = 3, - MEDIUM = 3, - LOW = 4, - LOWER = 5, - LOWEST = 6 -}; - -class VCL_DLLPUBLIC Idle +class VCL_DLLPUBLIC Idle : public Scheduler { protected: - ImplIdleData* mpIdleData; // Pointer to element in idle list - sal_Int32 miPriority; // Idle priority ( maybe divergent to default) - IdlePriority meDefaultPriority; // Default idle priority - bool mbActive; // Currently in the scheduler Link maIdleHdl; // Callback Link - friend struct ImplIdleData; - public: Idle(); Idle( const Idle& rIdle ); - virtual ~Idle(); - - void SetPriority( IdlePriority ePriority ); - void SetSchedulingPriority( sal_Int32 iPriority ); - sal_Int32 GetPriority() const { return miPriority; } - IdlePriority GetDefaultPriority() const { return meDefaultPriority; } /// Make it possible to associate a callback with this idle handler - /// of course, you can also sub-class and override 'DoIdle' + /// of course, you can also sub-class and override 'Invoke' void SetIdleHdl( const Link& rLink ) { maIdleHdl = rLink; } const Link& GetIdleHdl() const { return maIdleHdl; } - - // Call idle handler - virtual void DoIdle(); - - void Start(); - void Stop(); - - bool IsActive() const { return mbActive; } - - Idle& operator=( const Idle& rIdle ); - static void ImplDeInitIdle(); - - /// Process all pending idle tasks ahead of time in priority order. - static void ProcessAllIdleHandlers(); + virtual void Invoke() SAL_OVERRIDE; + Idle& operator=( const Idle& rIdle ); }; #endif // INCLUDED_VCL_IDLE_HXX |