summaryrefslogtreecommitdiff
authoralwin <alwin>2005-03-16 20:10:47 (UTC)
committer alwin <alwin>2005-03-16 20:10:47 (UTC)
commitea80ab0e1d30bd52d87b7330a934e63354716f2e (patch) (unidiff)
treee6e3e902454d54240f553993ccba7a84017aaa11
parent176c8e8bb543603b68e853660db93d6068c52bfa (diff)
downloadopie-ea80ab0e1d30bd52d87b7330a934e63354716f2e.zip
opie-ea80ab0e1d30bd52d87b7330a934e63354716f2e.tar.gz
opie-ea80ab0e1d30bd52d87b7330a934e63354716f2e.tar.bz2
added birthday display into datebook
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/pim/datebook/holiday/birthday/birthday.cpp56
-rw-r--r--core/pim/datebook/holiday/birthday/birthday.h28
-rw-r--r--core/pim/datebook/holiday/birthday/birthdays.pro20
-rw-r--r--core/pim/datebook/holiday/birthday/config.in4
-rw-r--r--core/pim/datebook/holiday/christian/chrisholiday.cpp0
-rw-r--r--core/pim/datebook/holiday/config.in1
-rw-r--r--packages1
7 files changed, 110 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
7Birthday::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
17QString Birthday::description()
18{
19 return QObject::tr("Birthdays","holidays");
20}
21
22QStringList 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
45QStringList Birthday::entries(unsigned year, unsigned month, unsigned day)
46{
47 return entries(QDate(year,month,day));
48}
49
50QMap<QDate,QStringList> Birthday::entries(const QDate&,const QDate&)
51{
52 QMap<QDate,QStringList> ret;
53 return ret;
54}
55
56EXPORT_HOLIDAY_PLUGIN(Birthday);
diff --git a/core/pim/datebook/holiday/birthday/birthday.h b/core/pim/datebook/holiday/birthday/birthday.h
new file mode 100644
index 0000000..5c9aacd
--- a/dev/null
+++ b/core/pim/datebook/holiday/birthday/birthday.h
@@ -0,0 +1,28 @@
1#ifndef __DUMMY_HOLIDAY_H
2#define __DUMMY_HOLIDAY_H
3
4#include <opie2/oholidayplugin.h>
5#include <opie2/oholidaypluginif.h>
6#include <opie2/ocontactaccess.h>
7
8#include <qmap.h>
9
10class Birthday:public Opie::Datebook::HolidayPlugin
11{
12typedef QMap<QDate,QStringList> tDayMap;
13
14public:
15 Birthday();
16 virtual ~Birthday(){}
17
18 virtual QString description();
19 virtual QStringList entries(const QDate&);
20 virtual QStringList entries(unsigned year, unsigned month, unsigned day);
21 virtual QMap<QDate,QStringList> entries(const QDate&,const QDate&);
22protected:
23 Opie::OPimContactAccess * m_contactdb;
24 Opie::OPimContactAccess::List m_list;
25 Opie::OPimContactAccess::List::Iterator m_it;
26};
27
28#endif
diff --git a/core/pim/datebook/holiday/birthday/birthdays.pro b/core/pim/datebook/holiday/birthday/birthdays.pro
new file mode 100644
index 0000000..b78dbd1
--- a/dev/null
+++ b/core/pim/datebook/holiday/birthday/birthdays.pro
@@ -0,0 +1,20 @@
1TEMPLATE = lib
2CONFIG -= moc
3CONFIG += qt plugin
4
5# Input
6HEADERS = birthday.h
7SOURCES = birthday.cpp
8INTERFACES=
9
10INCLUDEPATH += $(OPIEDIR)/include \
11 ../ ../library
12DEPENDPATH += $(OPIEDIR)/include \
13 ../ ../library
14
15LIBS+= -lqpe -lopiecore2 -lopieui2
16
17DESTDIR = $(OPIEDIR)/plugins/datebook/holiday
18TARGET = birthdayplugin
19
20include( $(OPIEDIR)/include.pro )
diff --git a/core/pim/datebook/holiday/birthday/config.in b/core/pim/datebook/holiday/birthday/config.in
new file mode 100644
index 0000000..0a3f3ff
--- a/dev/null
+++ b/core/pim/datebook/holiday/birthday/config.in
@@ -0,0 +1,4 @@
1 config DATEBOOK_BIRTHDAYS_HOLIDAY
2 boolean "opie-datebook-birthdays"
3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2UI && LIBOPIE2PIM
diff --git a/core/pim/datebook/holiday/christian/chrisholiday.cpp b/core/pim/datebook/holiday/christian/chrisholiday.cpp
index 3427b73..be16bd0 100644
--- a/core/pim/datebook/holiday/christian/chrisholiday.cpp
+++ b/core/pim/datebook/holiday/christian/chrisholiday.cpp
diff --git a/core/pim/datebook/holiday/config.in b/core/pim/datebook/holiday/config.in
index e00f023..1912dbe 100644
--- a/core/pim/datebook/holiday/config.in
+++ b/core/pim/datebook/holiday/config.in
@@ -1,4 +1,5 @@
1menu "Holiday Plugins" 1menu "Holiday Plugins"
2 source core/pim/datebook/holiday/birthday/config.in
2 source core/pim/datebook/holiday/christian/config.in 3 source core/pim/datebook/holiday/christian/config.in
3 source core/pim/datebook/holiday/dummy/config.in 4 source core/pim/datebook/holiday/dummy/config.in
4endmenu 5endmenu
diff --git a/packages b/packages
index 228bdb8..6181b00 100644
--- a/packages
+++ b/packages
@@ -32,6 +32,7 @@ CONFIG_DAGGER noncore/apps/dagger dagger.pro
32 CONFIG_DASHER inputmethods/dasherdasher.pro 32 CONFIG_DASHER inputmethods/dasherdasher.pro
33 CONFIG_DATEBOOK2 core/pim/datebook2datebook2.pro 33 CONFIG_DATEBOOK2 core/pim/datebook2datebook2.pro
34 CONFIG_DATEBOOK core/pim/datebookdatebook.pro 34 CONFIG_DATEBOOK core/pim/datebookdatebook.pro
35CONFIG_DATEBOOK_BIRTHDAYS_HOLIDAY core/pim/datebook/holiday/birthday birthdays.pro
35CONFIG_DATEBOOK_CHRISTIAN_HOLIDAY core/pim/datebook/holiday/christian christian-holidays.pro 36CONFIG_DATEBOOK_CHRISTIAN_HOLIDAY core/pim/datebook/holiday/christian christian-holidays.pro
36CONFIG_DATEBOOK_DUMMY_HOLIDAY core/pim/datebook/holiday/dummy dummy.pro 37CONFIG_DATEBOOK_DUMMY_HOLIDAY core/pim/datebook/holiday/dummy dummy.pro
37 CONFIG_DECO_FLAT noncore/decorations/flatflat.pro 38 CONFIG_DECO_FLAT noncore/decorations/flatflat.pro