SyncAlarmInventory.h
/*
* This file is part of buteo-syncfw package
*
* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
*
* Contact: Sateesh Kavuri <sateesh.kavuri@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef SYNCALARMINVENTORY_H
#define SYNCALARMINVENTORY_H
#include <QObject>
#include <QDateTime>
#include <QtSql>
class SyncAlarmInventory : public QObject
{
Q_OBJECT
public:
SyncAlarmInventory();
~SyncAlarmInventory();
bool init();
int addAlarm(QDateTime alarmTime);
bool removeAlarm(int alarmId);
void removeAllAlarms();
signals:
void triggerAlarm(int alarmId);
private:
/* Deletes the alarm from DB */
bool deleteAlarmFromDb(int alarmName);
/* Method to add an alarm to the database */
int addAlarmToDb(QDateTime timeStamp);
/* Method to fetch the database handle */
QSqlDatabase *getDbHandle();
/* Timer object to keep tracke of alarm timers */
QTimer *iTimer;
/* Current alarm that is under work */
int currentAlarm;
/* Number of times that the alarm triggers */
int triggerCount;
/* Database handle */
QSqlDatabase iDbHandle;
/* Database connection name */
QString iConnectionName;
private slots:
void timerTriggered();
};
#endif
SyncAlarmInventory::removeAllAlarms
void removeAllAlarms()
Definition SyncAlarmInventory.cpp:166
SyncAlarmInventory::triggerAlarm
void triggerAlarm(int alarmId)
Signal triggered when an alarm expired.
SyncAlarmInventory::init
bool init()
Creates and Initialize the alarms database. also Creates the timers Please call this function to make...
Definition SyncAlarmInventory.cpp:45
SyncAlarmInventory::addAlarm
int addAlarm(QDateTime alarmTime)
Method to add an alarm.
Definition SyncAlarmInventory.cpp:98
SyncAlarmInventory::~SyncAlarmInventory
~SyncAlarmInventory()
Definition SyncAlarmInventory.cpp:86
SyncAlarmInventory::SyncAlarmInventory
SyncAlarmInventory()
Definition SyncAlarmInventory.cpp:37
SyncAlarmInventory::removeAlarm
bool removeAlarm(int alarmId)
Definition SyncAlarmInventory.cpp:155