summaryrefslogtreecommitdiff
authorzecke <zecke>2004-11-18 21:52:24 (UTC)
committer zecke <zecke>2004-11-18 21:52:24 (UTC)
commitc94afa23120bb72709973ae4711106e6e502fe65 (patch) (side-by-side diff)
tree700cb234878fdfa18dbf9fd0157fcabc7758e455
parent1e7f8f22fc10e3ed85b6563332ddc348c95792d0 (diff)
downloadopie-c94afa23120bb72709973ae4711106e6e502fe65.zip
opie-c94afa23120bb72709973ae4711106e6e502fe65.tar.gz
opie-c94afa23120bb72709973ae4711106e6e502fe65.tar.bz2
Opie PIM Update (1/2 of it implemented)
-Update opiepim.pro to add new files -Provide a stable precompileable headerfile
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/opiepim.pro3
-rw-r--r--libopie2/opiepim/stable_pch.h53
-rw-r--r--libopie2/opiepim/ui/opimmainwindow.cpp1
3 files changed, 56 insertions, 1 deletions
diff --git a/libopie2/opiepim/opiepim.pro b/libopie2/opiepim/opiepim.pro
index af8e63d..992fb8b 100644
--- a/libopie2/opiepim/opiepim.pro
+++ b/libopie2/opiepim/opiepim.pro
@@ -1,23 +1,26 @@
TEMPLATE = lib
CONFIG += qt warn_on
DESTDIR = $(OPIEDIR)/lib
INTERFACES =
TARGET = opiepim2
VERSION = 1.8.6
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lopiecore2
include ( $(OPIEDIR)/gen.pro )
include ( core/core.pro )
include ( backend/backends.pro )
include ( ui/ui.pro )
+include ( private/private.pro )
+
+PRECOMPILED_HEADER = stable_pch.h
!contains( platform, x11 ) {
include ( $(OPIEDIR)/include.pro )
}
contains( platform, x11 ) {
LIBS = -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib
}
diff --git a/libopie2/opiepim/stable_pch.h b/libopie2/opiepim/stable_pch.h
new file mode 100644
index 0000000..ea4d0d1
--- a/dev/null
+++ b/libopie2/opiepim/stable_pch.h
@@ -0,0 +1,53 @@
+#if defined __cplusplus
+
+#include "core/ocontactaccess.h"
+#include "core/odatebookaccess.h"
+#include "core/opimaccessfactory.h"
+#include "core/opimaccesstemplate.h"
+#include "core/opimcache.h"
+#include "core/opimcontactfields.h"
+#include "core/opimcontact.h"
+#include "core/opimdateconversion.h"
+#include "core/opimevent.h"
+#include "core/opimglobal.h"
+#include "core/opimmaintainer.h"
+#include "core/opimnotify.h"
+#include "core/opimnotifymanager.h"
+#include "core/opimoccurrence.h"
+#include "core/opimrecord.h"
+#include "core/opimrecordlist.h"
+#include "core/opimrecurrence.h"
+#include "core/opimresolver.h"
+#include "core/opimstate.h"
+#include "core/opimtemplatebase.h"
+#include "core/opimtimezone.h"
+#include "core/opimtodo.h"
+#include "core/opimxref.h"
+#include "core/opimxrefmanager.h"
+#include "core/opimxrefpartner.h"
+#include "core/otodoaccess.h"
+#include "backend/obackendfactory.h"
+#include "backend/ocontactaccessbackend.h"
+#include "backend/ocontactaccessbackend_vcard.h"
+#include "backend/ocontactaccessbackend_xml.h"
+#include "backend/odatebookaccessbackend.h"
+#include "backend/odatebookaccessbackend_xml.h"
+#include "backend/opimaccessbackend.h"
+#include "backend/opimbackendoccurrence.h"
+#include "backend/otodoaccessbackend.h"
+#include "backend/otodoaccessvcal.h"
+#include "backend/otodoaccessxml.h"
+#include "backend/otodoaccesssql.h"
+#include "backend/ocontactaccessbackend_sql.h"
+#include "backend/odatebookaccessbackend_sql.h"
+#include "ui/opimmainwindow.h"
+#include "ui/opimrecurrencewidget.h"
+#include "ui/todayconfigwidget.h"
+#include "ui/todayplugininterface.h"
+#include "private/vobject_p.h"
+#include "private/opimoccurrence_p.h"
+#include "private/opimsortvector.h"
+#include "private/opimtodosortvector.h"
+
+
+#endif
diff --git a/libopie2/opiepim/ui/opimmainwindow.cpp b/libopie2/opiepim/ui/opimmainwindow.cpp
index 8ce2062..058a428 100644
--- a/libopie2/opiepim/ui/opimmainwindow.cpp
+++ b/libopie2/opiepim/ui/opimmainwindow.cpp
@@ -1,188 +1,187 @@
/*
This file is part of the Opie Project
Copyright (C) Stefan Eilers (Eilers.Stefan@epost.de)
=. Copyright (C) The Opie Team <opie-devel@handhelds.org>
.=l.
.>+-=
_;:, .> :=|. This program is free software; you can
.> <`_, > . <= redistribute it and/or modify it under
:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
.="- .-=="i, .._ License as published by the Free Software
- . .-<_> .<> Foundation; either version 2 of the License,
._= =} : or (at your option) any later version.
.%`+i> _;_.
.i_,=:_. -<s. This program 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
..}^=.= = ; Library General Public License for more
++= -. .` .: details.
: = ...= . :.=-
-. .:....=;==+<; You should have received a copy of the GNU
-_. . . )=. = Library General Public License along with
-- :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "opimmainwindow.h"
/* OPIE */
#include <opie2/opimresolver.h>
#include <opie2/odebug.h>
#include <qpe/sound.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/qpeapplication.h>
/* QT */
#include <qapplication.h>
#include <qdatetime.h>
#include <qcopchannel_qws.h>
namespace Opie {
OPimMainWindow::OPimMainWindow( const QString& service, QWidget* parent,
const char* name, WFlags flag )
: QMainWindow( parent, name, flag ), m_rtti(-1), m_service( service ), m_fallBack(0l) {
/*
* let's generate our QCopChannel
*/
m_str = QString("QPE/"+m_service).local8Bit();
m_channel= new QCopChannel(m_str, this );
connect(m_channel, SIGNAL(received(const QCString&,const QByteArray&) ),
this, SLOT( appMessage(const QCString&,const QByteArray&) ) );
connect(qApp, SIGNAL(appMessage(const QCString&,const QByteArray&) ),
this, SLOT( appMessage(const QCString&,const QByteArray&) ) );
/* connect flush and reload */
connect(qApp, SIGNAL(flush() ),
this, SLOT(flush() ) );
connect(qApp, SIGNAL(reload() ),
this, SLOT(reload() ) );
}
OPimMainWindow::~OPimMainWindow() {
delete m_channel;
}
QCopChannel* OPimMainWindow::channel() {
return m_channel;
}
void OPimMainWindow::doSetDocument( const QString& ) {
}
void OPimMainWindow::appMessage( const QCString& cmd, const QByteArray& array ) {
bool needShow = false;
/*
* create demands to create
* a new record...
*/
QDataStream stream(array, IO_ReadOnly);
if ( cmd == "create()" ) {
raise();
int uid = create();
QCopEnvelope e(m_str, "created(int)" );
e << uid;
needShow = true;
}else if ( cmd == "remove(int)" ) {
int uid;
stream >> uid;
bool rem = remove( uid );
QCopEnvelope e(m_str, "removed(bool)" );
e << rem;
needShow = true;
}else if ( cmd == "beam(int)" ) {
int uid;
stream >> uid;
beam( uid);
}else if ( cmd == "show(int)" ) {
raise();
int uid;
stream >> uid;
show( uid );
needShow = true;
}else if ( cmd == "edit(int)" ) {
raise();
int uid;
stream >> uid;
edit( uid );
}else if ( cmd == "add(int,QByteArray)" ) {
int rtti;
QByteArray array;
stream >> rtti;
stream >> array;
m_fallBack = record(rtti, array );
if (!m_fallBack) return;
add( *m_fallBack );
delete m_fallBack;
}else if ( cmd == "alarm(QDateTime,int)" ) {
raise();
QDateTime dt; int uid;
stream >> dt;
stream >> uid;
- owarn << " Date: " << dt.toString() << " Uid: " << uid << "" << oendl;
QDateTime current = QDateTime::currentDateTime();
if ( current.time().hour() != dt.time().hour() && current.time().minute() != dt.time().minute() )
return;
doAlarm( dt, uid );
needShow = true;
}
if (needShow )
QPEApplication::setKeepRunning();
}
/* implement the url scripting here */
void OPimMainWindow::setDocument( const QString& str) {
doSetDocument( str );
}
/*
* we now try to get the array demarshalled
* check if the rtti matches this one
*/
OPimRecord* OPimMainWindow::record( int rtti, const QByteArray& array ) {
if ( service() != rtti )
return 0l;
OPimRecord* record = OPimResolver::self()->record( rtti );
QDataStream str(array, IO_ReadOnly );
if ( !record || !record->loadFromStream(str) ) {
delete record;
record = 0l;
}
return record;
}
/*
* get the rtti for the service
*/
int OPimMainWindow::service() {
if ( m_rtti == -1 )
m_rtti = OPimResolver::self()->serviceId( m_service );
return m_rtti;
}
void OPimMainWindow::doAlarm( const QDateTime&, int ) {
}
void OPimMainWindow::startAlarm(int count ) {
m_alarmCount = count;
m_playedCount = 0;
Sound::soundAlarm();
m_timerId = startTimer( 5000 );
}
void OPimMainWindow::killAlarm() {
killTimer( m_timerId );
}
void OPimMainWindow::timerEvent( QTimerEvent* e) {
if ( m_playedCount <m_alarmCount ) {
m_playedCount++;
Sound::soundAlarm();
}else {
killTimer( e->timerId() );
}
}
}