sAlarm 0.5
Public Slots | Signals | Public Member Functions
Scheduler Class Reference

Provides QTreeWiew component with some more functions. More...

#include <scheduler.h>

Collaboration diagram for Scheduler:
Collaboration graph
[legend]

List of all members.

Public Slots

void checkSchedules ()
 Checks schedules.
void postpone (int id)
 Postpones schedule with given ID.
void markTimeouted (int id)
 Marks schedule with given ID timeouted.

Signals

void scheduleTimeouted (int)
 This signal is emitted when the schedule timeouted.

Public Member Functions

 Scheduler (Database *sqlDb, QWidget *parent=0)
 Constructor.
 ~Scheduler ()
 Destructor.
void removeSchedule ()
 Removes schedule at current model index.
int addSchedule (const QString &title, const QString &text, const QDateTime &expiration, int categoryID=0)
 Adds a new schedule into Scheduler.
void addSchedule (Schedule *s)
void editSchedule (int id, const QString &title, const QString &text, const QDateTime &expiration, int categoryID=0)
 Edits schedule.
void makeConnections ()
 Makes connections between objects.
void generateXmlToFile (QFile *file)
 Generates XML file with schedules to given file.
void refreshSchedules ()
 Updates list of schedules.
int addScheduleCategory (const QString categoryName) const
 Adds new category into the database by given category name.
void removeScheduleCategory (int categoryID) const
 Removes current category from combo box.
QList< QPair< int, QString > > scheduleCategories () const
 Returns list of categories which are stored in QPair with their database ID.

Detailed Description

Provides QTreeWiew component with some more functions.


Constructor & Destructor Documentation

Scheduler::Scheduler ( Database sqlDb,
QWidget *  parent = 0 
) [explicit]

Constructor.

Parameters:
parentpointer to parent object

Member Function Documentation

int Scheduler::addSchedule ( const QString &  title,
const QString &  text,
const QDateTime &  expiration,
int  categoryID = 0 
)

Adds a new schedule into Scheduler.

Parameters:
titletitle of the schedule
textdescription text
expirationindicates when schedule expire
categoryIDschedule category database ID
Returns:
inserted schedule database ID
See also:
removeSchedule()
void Scheduler::addSchedule ( Schedule s)
Todo:
It's not implemented yet

Todo:
It's neccessary to edit Schedule class and adapt it

int Scheduler::addScheduleCategory ( const QString  categoryName) const

Adds new category into the database by given category name.

Parameters:
categoryNamename of the category
Returns:
inserted schedule category database ID
void Scheduler::checkSchedules ( ) [slot]

Checks schedules.

Todo:
Muze byt const? + ktere dalsi mohou

If some schedule timeouted it emites signal scheduleTimeouted(x) where "x" is schedule ID.

void Scheduler::editSchedule ( int  id,
const QString &  title,
const QString &  text,
const QDateTime &  expiration,
int  categoryID = 0 
)

Edits schedule.

Parameters:
idID of schedule which we want to edit
titletitle of schedule
textschedule description text
expirationnew date and time of schedule expiration
categoryIDschedule category ID
void Scheduler::generateXmlToFile ( QFile *  file)

Generates XML file with schedules to given file.

Parameters:
filefile for export

Todo:
It's necessary to escape variables with Qt::escape - it's not working -> Why?

void Scheduler::markTimeouted ( int  id) [slot]

Marks schedule with given ID timeouted.

Parameters:
idschedule ID
void Scheduler::postpone ( int  id) [slot]

Postpones schedule with given ID.

Postpone interval can be set in preferences.

Parameters:
idschedule ID
void Scheduler::refreshSchedules ( )

Updates list of schedules.

Todo:
dodelat ikonu u upominek

void Scheduler::removeSchedule ( )

Removes schedule at current model index.

See also:
addSchedule()
void Scheduler::removeScheduleCategory ( int  categoryID) const

Removes current category from combo box.

Parameters:
categoryIDcategory database ID
void Scheduler::scheduleTimeouted ( int  ) [signal]

This signal is emitted when the schedule timeouted.

Parameters:
intschedule database ID

The documentation for this class was generated from the following files:
 All Classes Functions Enumerations