InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IIdleTaskMgr Class Referenceabstract
Inheritance diagram for IIdleTaskMgr:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IIDLETASKMGR }
 
enum  IdleTaskEvents {
  SleepEvent, WakeEvent, MouseClickEvent, KeyEvent,
  AppOutOfFocus, AppInFocus
}
 
enum  ApplicationStateFlags {
  kInBackground = 1, kModalDialogUp = 2, kMenuUp = 4, kMouseTracking = 8,
  kUserActive = 16, kApplicationMinimized = 32, kMainThreadTaskQueued = 64
}
 
typedef enum
IIdleTaskMgr::ApplicationStateFlags 
ApplicationStateFlags
 

Public Member Functions

virtual void SetApplicationState (uint32 flags)=0
 
virtual uint32 GetApplicationState ()=0
 
virtual void AddTask (IIdleTask *newTask, uint32 initialMillisecondDelay=0)=0
 
virtual uint32 RemoveTask (IIdleTask *taskToRemove)=0
 
virtual uint32 RunOverdueTasks (const char *(*EventsPendingFunction)())=0
 
uint32 RunAllTasks (const char *(*EventsPendingFunction)())
 
virtual void Shutdown ()=0
 
virtual IPMUnknownQueryRunningTask (PMIID iid)=0
 
virtual bool16 GetSleepFlag ()=0
 
virtual void SetSleepFlag (bool16 sleepFlag)=0
 
virtual void SetSleepFlagOnEvents (IdleTaskEvents idleTaskEvent)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Member Typedef Documentation

Member Enumeration Documentation

The state of the application
Enumerator
kUserActive 

i.e., a real event caused this trip through the event loop as opposed to a sleep timeout

kMainThreadTaskQueued 

a task was enqueued to the main thread queue

Member Function Documentation

virtual void IIdleTaskMgr::AddTask (IIdleTasknewTask,
uint32 initialMillisecondDelay = 0 
)
pure virtual

Add a new task to the list of active tasks. Note that it is illegal to add the same task twice.

Parameters
newTaskis the new task
initialMillisecondDelayis the number of milliseconds to wait until the first time this task is run
virtual uint32 IIdleTaskMgr::GetApplicationState ()
pure virtual

Get the application state flags

virtual bool16 IIdleTaskMgr::GetSleepFlag ()
pure virtual

FOR INTERNAL USE ONLY Returns Sleep Flag used for disabling idletasks while going to sleep.

virtual IPMUnknown* IIdleTaskMgr::QueryRunningTask (PMIID iid)
pure virtual

Query the current task for a particular interface

Parameters
iidis the interface to query on the current task
virtual uint32 IIdleTaskMgr::RemoveTask (IIdleTasktaskToRemove)
pure virtual

Remove a task from the list of tasks to run. Note that it is significantly more efficient to have a task remove itself when its RunTask method is called.

See Also
IIdleTask
Parameters
taskToRemoveis the task to remove
Returns
the number of milliseconds before this task was scheduled to run. If it was already overdue, it returns zero. If the task wasn't installed or it is currently running, returns IIdleTask::kEndOfTime. May return IIdleTask::kOnFlagChange or IIdleTask::kNextEventCycle if the task to remove was suspended.
uint32 IIdleTaskMgr::RunAllTasks (const char *(*)() EventsPendingFunction)
inline

Run the idle tasks. Iterates through the list of idle tasks, calling Run() on each one.

Parameters
EventsPendingFunctionis a function that returns the name of a pending event or nil if none
Returns
the delay in milliseconds before RunAllTasks should be called again
virtual uint32 IIdleTaskMgr::RunOverdueTasks (const char *(*)() EventsPendingFunction)
pure virtual

Run the idle tasks. Iterates through the list of idle tasks, calling Run() on each one.

Parameters
EventsPendingFunctionis a function that returns the name of a pending event or nil if none
Returns
the delay in milliseconds before RunOverdueTasks should be called again
virtual void IIdleTaskMgr::SetApplicationState (uint32 flags)
pure virtual

Set the application state flags

virtual void IIdleTaskMgr::SetSleepFlag (bool16 sleepFlag)
pure virtual

FOR INTERNAL USE ONLY [Deprecated] Sets Sleep Flag used for disabling idletasks while going to sleep.

Parameters
sleepFlag,Bypasscall to RunOverdueTasks() if set to kTrue, else execute RunOverdueTasks() normally.
virtual void IIdleTaskMgr::SetSleepFlagOnEvents (IdleTaskEvents idleTaskEvent)
pure virtual

FOR INTERNAL USE ONLY Sets Sleep Flag used for disabling idletasks while going to sleep.

Parameters
idleTaskEvent,Bypasscall to RunOverdueTasks() on wake,keydown and mouseclick event.
virtual void IIdleTaskMgr::Shutdown ()
pure virtual

Remove all idle tasks, in preparation for shutdown