New thread class (OperationodeToggler) created in DeviceControl module to send sub...
[qtmeetings] / src / IO / DeviceControl / OperationModeToggler.h
1 #ifndef OPERATIONMODETOGGLER_H_
2 #define OPERATIONMODETOGGLER_H_
3
4 #include "DeviceManager.h"
5
6 #include <QThread>
7
8 class StartupSettings;
9 class AlarmSender;
10 class DeviceConfigurator;
11 class DeviceDataStorage;
12
13 class OperationModeToggler : public QThread
14 {
15         Q_OBJECT
16         
17 public:
18         //! Constructor.
19         /*!
20          * Constructor for HWKeyListener class
21          */
22         OperationModeToggler( 
23                         DeviceManager::OperationMode aMode, 
24                         StartupSettings *aSettings, 
25                         AlarmSender *aAlarmSender, 
26                         DeviceConfigurator *aConfigurator, 
27                         DeviceDataStorage *aDataStorage 
28                         );
29         
30         //! Destructor.
31         virtual ~OperationModeToggler();
32         //! Run method of the class.
33         /*!
34          * Run method of the class.
35          */
36         void run();
37         bool success();
38         //! Stores the current operation mode.
39         /*!
40          * Stores the current operation mode by asking the DeviceDataStorage to write it to the internal
41          * data storage.
42          * \param aMode The operation mode that user wants to activate.
43          * \return True if operation mode storing succeeds; otherwise, false.
44          */
45         static bool storeOperationMode( DeviceManager::OperationMode aMode, DeviceDataStorage *aDataStorage );
46
47 signals:
48         void error( DeviceManager::ErrorCode aCode );
49         void toggleErrorSending( bool aToggle );
50         void changingMode( const QString &aMessage );
51         
52 private:
53         DeviceManager::OperationMode iMode;
54         StartupSettings *iSettings;
55         AlarmSender *iAlarmSender;
56         DeviceConfigurator *iConfigurator;
57         DeviceDataStorage *iDataStorage;
58         bool iSuccess; 
59 };
60
61 #endif /*OPERATIONMODETOGGLER_H_*/