docs/ikteam: Delete most files.
[haiku.git] / src / preferences / repositories / TaskTimer.h
blob6da087356794ea7a6c05fe0094f6f319a8cdb60b
1 /*
2 * Copyright 2017 Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Brian Hill
7 */
8 #ifndef TASKTIMER_H
9 #define TASKTIMER_H
12 #include <Alert.h>
13 #include <Invoker.h>
14 #include <Looper.h>
15 #include <Message.h>
16 #include <MessageRunner.h>
17 #include <Messenger.h>
18 #include <String.h>
20 #include "RepoRow.h"
22 class TaskTimer;
23 class TaskLooper;
26 typedef struct {
27 RepoRow* rowItem;
28 int32 taskType;
29 BString name, taskParam;
30 thread_id threadId;
31 TaskLooper* owner;
32 BString resultName, resultErrorDetails;
33 TaskTimer* fTimer;
34 } Task;
37 class TaskTimer : public BLooper {
38 public:
39 TaskTimer(const BMessenger& target, Task* owner);
40 ~TaskTimer();
41 virtual bool QuitRequested();
42 virtual void MessageReceived(BMessage*);
43 void Start(const char* name);
44 void Stop(const char* name);
46 private:
47 int32 _NextAlertStackCount();
49 int32 fTimeoutMicroSeconds;
50 bool fTimerIsRunning;
51 BString fRepositoryName;
52 BMessenger fReplyTarget;
53 BMessenger fMessenger;
54 BMessageRunner* fMessageRunner;
55 BMessage fTimeoutMessage;
56 BAlert* fTimeoutAlert;
57 BInvoker fTimeoutAlertInvoker;
58 Task* fOwner;
62 #endif