Removed some lines used for debugging purposes
[qtmeetings] / src / IO / DeviceControl / DeviceConfigurator.h
1 #ifndef DEVICECONFIGURATOR_H_
2 #define DEVICECONFIGURATOR_H_
3
4 #include "DeviceDataStorage.h"
5
6 //! DeviceControl class. Configures the device behavior.
7 /*!
8  * DeviceControl class. DeviceControl class. Configures the device behavior. Updates the device system 
9  * files, activates/deactivates the application initialization script, uses the gconftool to configure
10  * some parameters of the device and uses the devstopper binary to restart the device to activate
11  * the changes. The changes it makes affect to the hardware keys, the screen dimming enabling/disabling
12  * and the automated turning on/off the device. These are all supported features of the "kiosk mode".  
13  */
14 class DeviceConfigurator : public QObject 
15 {
16         Q_OBJECT
17
18 public:
19         //! Constructor.
20         /*!
21          * Constructor to initialize an AlarmSender instance
22          * \param aDataStorage Pointer to the DataStorage class instance.
23          */
24         DeviceConfigurator( DeviceDataStorage *aDataStorage );
25         //! Destructor.
26         virtual ~DeviceConfigurator();
27         //! Toggles the screen switching on/off and dimming options of the device.
28         /*!
29          * Toggles the screen switching on/off and dimming options of the device. Asks DeviceDataStorage to
30          * read/store the screen related original parameters. Uses systemIO( ... ) method to execute
31          * gconftool system commands to change the configurations.
32          * \param aEnable Indicates if the screen switchin off and dimming are wanted to be enabled.
33          * \return True if configuring of screen options succeeds; otherwise, false. 
34          */
35         bool toggleScreenSwitchOff( bool aEnable );
36         //! Toggles the enabling of the "home"-hardware key of the device.
37         /*!
38          * Toggles the enabling of the "home"-hardware key of the device. Asks DeviceDataStorage to
39          * read/store the hardware key related original parameters. Uses the DeviceDataStorage to manipulate
40          * the device system file /etc/mce/mce.ini to enable/disable the hw key. 
41          * \param aEnable Indicates if the "home"-hardware key is wanted to be enabled.
42          * \return True if configuring of the hw-key succeeds; otherwise, false. 
43          */
44         bool toggleHWKeys( bool aEnable );
45         //! Toggles the activation of the application initialization script.
46         /*!
47          * Toggles the activation of the application initialization script. Uses the systemIO( ... ) method 
48          * to execute the script that uses update-rc.d system command to install/remove the init script 
49          * qtmeetings-launcher. 
50          * \param aEnable Indicates if the script is wanted to be activated/deactivated
51          * \return True if activating/deactivating of the script succeeds; otherwise, false. 
52          */
53         bool toggleInitScript( bool aEnable );
54         //! Restarts the device.
55         /*!
56          * Restarts the device by using the systemIO( ... ) method to execute devstopper executable.
57          * \return True if resrating of the device succeeds; otherwise, false.
58          */
59         bool restartDevice();
60         //! Resolves the currently used account of the device.
61         /*!
62          * Resolves the currently used account of the device by using the systemIO( ... ) method to execute 
63          * whoami system command.
64          * \return True if resolving the account succeeds; otherwise, false.
65          */
66         static bool whoAmI( QByteArray &aName );
67         //! Consists and executes a system command and stores the received output.
68         /*!
69          * Consists and executes a system command and stores the received output.
70          * \param aCommand The whole system command or just the "binary"-part of the command
71          * \param aArgs The possible arguments for the "binary"
72          * \param aResult The place to put the output of the command 
73          * \return True if executing the system command succeeds; otherwise, false.
74          */
75         static bool systemIO( const QString &aCommand, const QStringList &aArgs, QByteArray &aResult );
76
77 signals:
78         //! Signal. Emitted if error occured during configuring the device.
79         /*!
80          * Signal. Emitted if error occured during configuring the device.
81          * \param aErrorCode The error code.
82          */
83         void configuringError( DeviceManager::ErrorCode aErrorCode );
84
85 private:
86         DeviceDataStorage *iDataStorage;
87 };
88
89 #endif /*DEVICECONFIGURATOR_H_*/