author | alwin <alwin> | 2005-03-16 20:10:47 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-03-16 20:10:47 (UTC) |
commit | ea80ab0e1d30bd52d87b7330a934e63354716f2e (patch) (unidiff) | |
tree | e6e3e902454d54240f553993ccba7a84017aaa11 /core/pim/datebook/holiday/birthday/birthday.cpp | |
parent | 176c8e8bb543603b68e853660db93d6068c52bfa (diff) | |
download | opie-ea80ab0e1d30bd52d87b7330a934e63354716f2e.zip opie-ea80ab0e1d30bd52d87b7330a934e63354716f2e.tar.gz opie-ea80ab0e1d30bd52d87b7330a934e63354716f2e.tar.bz2 |
added birthday display into datebook
Diffstat (limited to 'core/pim/datebook/holiday/birthday/birthday.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/datebook/holiday/birthday/birthday.cpp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/core/pim/datebook/holiday/birthday/birthday.cpp b/core/pim/datebook/holiday/birthday/birthday.cpp new file mode 100644 index 0000000..a32e0ea --- a/dev/null +++ b/core/pim/datebook/holiday/birthday/birthday.cpp | |||
@@ -0,0 +1,56 @@ | |||
1 | #include "birthday.h" | ||
2 | |||
3 | #include <opie2/ocontactaccess.h> | ||
4 | |||
5 | #include <qobject.h> | ||
6 | |||
7 | Birthday::Birthday() | ||
8 | :Opie::Datebook::HolidayPlugin() | ||
9 | { | ||
10 | m_contactdb = new Opie::OPimContactAccess("addressplugin"); | ||
11 | /* | ||
12 | connect( m_contactdb, SIGNAL( signalChanged(const Opie::OPimContactAccess*) ), | ||
13 | this, SLOT( refresh(const Opie::OPimContactAccess*) ) ); | ||
14 | */ | ||
15 | } | ||
16 | |||
17 | QString Birthday::description() | ||
18 | { | ||
19 | return QObject::tr("Birthdays","holidays"); | ||
20 | } | ||
21 | |||
22 | QStringList Birthday::entries(const QDate&aDate) | ||
23 | { | ||
24 | QStringList ret; | ||
25 | if ( m_contactdb->hasQuerySettings( Opie::OPimContactAccess::DateDay ) ){ | ||
26 | Opie::OPimContact querybirthdays; | ||
27 | querybirthdays.setBirthday(aDate); | ||
28 | m_list = m_contactdb->queryByExample( querybirthdays,Opie::OPimContactAccess::DateDay| Opie::OPimContactAccess::DateMonth); | ||
29 | if ( m_list.count() > 0 ){ | ||
30 | QString pre = QObject::tr("Birthday","holidays")+" "; | ||
31 | int z = 0; | ||
32 | for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) { | ||
33 | if (z) { | ||
34 | pre+=", "; | ||
35 | } | ||
36 | pre+=((*m_it).fullName()); | ||
37 | ++z; | ||
38 | } | ||
39 | ret.append(pre); | ||
40 | } | ||
41 | } | ||
42 | return ret; | ||
43 | } | ||
44 | |||
45 | QStringList Birthday::entries(unsigned year, unsigned month, unsigned day) | ||
46 | { | ||
47 | return entries(QDate(year,month,day)); | ||
48 | } | ||
49 | |||
50 | QMap<QDate,QStringList> Birthday::entries(const QDate&,const QDate&) | ||
51 | { | ||
52 | QMap<QDate,QStringList> ret; | ||
53 | return ret; | ||
54 | } | ||
55 | |||
56 | EXPORT_HOLIDAY_PLUGIN(Birthday); | ||