summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core
authoralwin <alwin>2004-02-20 02:06:52 (UTC)
committer alwin <alwin>2004-02-20 02:06:52 (UTC)
commit55f4d502486e01927356908223622e435c975f7e (patch) (side-by-side diff)
tree824b5c1e8992564677c4f39473bc108a32a2cf2a /libopie2/opiepim/core
parent060b4fc7a3fd5c1b5f745167fe084f7486719b7e (diff)
downloadopie-55f4d502486e01927356908223622e435c975f7e.zip
opie-55f4d502486e01927356908223622e435c975f7e.tar.gz
opie-55f4d502486e01927356908223622e435c975f7e.tar.bz2
moved the opie pim stuff to libopie2 - pim. Tried to resort them, may be someone should take a look for a better file order. but now all applications can start using libopiepim2 instead of libopie1-pim-stuff.
Diffstat (limited to 'libopie2/opiepim/core') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/core/core.pro21
-rw-r--r--libopie2/opiepim/core/ocontactaccess.cpp80
-rw-r--r--libopie2/opiepim/core/ocontactaccess.h105
-rw-r--r--libopie2/opiepim/core/oconversion.cpp47
-rw-r--r--libopie2/opiepim/core/oconversion.h50
-rw-r--r--libopie2/opiepim/core/odatebookaccess.cpp35
-rw-r--r--libopie2/opiepim/core/odatebookaccess.h33
-rw-r--r--libopie2/opiepim/core/opimaccesstemplate.h43
-rw-r--r--libopie2/opiepim/core/opimcache.h33
-rw-r--r--libopie2/opiepim/core/opimmaintainer.cpp34
-rw-r--r--libopie2/opiepim/core/opimmaintainer.h31
-rw-r--r--libopie2/opiepim/core/opimnotify.cpp33
-rw-r--r--libopie2/opiepim/core/opimnotify.h32
-rw-r--r--libopie2/opiepim/core/opimnotifymanager.cpp37
-rw-r--r--libopie2/opiepim/core/opimnotifymanager.h33
-rw-r--r--libopie2/opiepim/core/opimrecord.cpp33
-rw-r--r--libopie2/opiepim/core/opimrecord.h33
-rw-r--r--libopie2/opiepim/core/opimresolver.cpp38
-rw-r--r--libopie2/opiepim/core/opimresolver.h33
-rw-r--r--libopie2/opiepim/core/opimstate.cpp31
-rw-r--r--libopie2/opiepim/core/opimstate.h31
-rw-r--r--libopie2/opiepim/core/opimxref.cpp34
-rw-r--r--libopie2/opiepim/core/opimxref.h34
-rw-r--r--libopie2/opiepim/core/opimxrefmanager.cpp33
-rw-r--r--libopie2/opiepim/core/opimxrefmanager.h33
-rw-r--r--libopie2/opiepim/core/opimxrefpartner.cpp34
-rw-r--r--libopie2/opiepim/core/opimxrefpartner.h30
-rw-r--r--libopie2/opiepim/core/orecur.cpp36
-rw-r--r--libopie2/opiepim/core/orecur.h31
-rw-r--r--libopie2/opiepim/core/otemplatebase.h33
-rw-r--r--libopie2/opiepim/core/otimezone.cpp37
-rw-r--r--libopie2/opiepim/core/otimezone.h33
-rw-r--r--libopie2/opiepim/core/otodoaccess.cpp37
-rw-r--r--libopie2/opiepim/core/otodoaccess.h37
34 files changed, 1096 insertions, 192 deletions
diff --git a/libopie2/opiepim/core/core.pro b/libopie2/opiepim/core/core.pro
new file mode 100644
index 0000000..dae37f1
--- a/dev/null
+++ b/libopie2/opiepim/core/core.pro
@@ -0,0 +1,21 @@
+HEADERS += core/oconversion.h \
+ core/opimcache.h \
+ core/opimmaintainer.h \
+ core/opimresolver.h \
+ core/opimstate.h \
+ core/opimxref.h \
+ core/opimxrefmanager.h \
+ core/opimxrefpartner.h \
+ core/orecur.h \
+ core/otemplatebase.h \
+ core/otimezone.h \
+
+SOURCES += core/oconversion.cpp \
+ core/opimmaintainer.cpp \
+ core/opimresolver.cpp \
+ core/opimstate.cpp \
+ core/opimxref.cpp \
+ core/opimxrefmanager.cpp \
+ core/opimxrefpartner.cpp \
+ core/orecur.cpp \
+ core/otimezone.cpp \
diff --git a/libopie2/opiepim/core/ocontactaccess.cpp b/libopie2/opiepim/core/ocontactaccess.cpp
index 2e3ec1f..f67a40c 100644
--- a/libopie2/opiepim/core/ocontactaccess.cpp
+++ b/libopie2/opiepim/core/ocontactaccess.cpp
@@ -1,86 +1,68 @@
/*
- * Class to manage the Contacts.
- *
- * Copyright (c) 2002 by Stefan Eilers (Eilers.Stefan@epost.de)
- *
- * =====================================================================
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- * =====================================================================
- * Info: This class could just work with a change in the header-file
- * of the Contact class ! Therefore our libopie only compiles
- * with our version of libqpe
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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.
+*/
+/*
* =====================================================================
* ToDo: XML-Backend: Automatic reload if something was changed...
*
*
- * =====================================================================
- * Version: $Id$
- * =====================================================================
- * History:
- * $Log$
- * Revision 1.8 2003/05/08 13:55:09 tille
- * search stuff
- * and match, toRichText & toShortText in oevent
- *
- * Revision 1.7 2002/11/13 14:14:51 eilers
- * Added sorted for Contacts..
- *
- * Revision 1.6 2002/11/01 15:10:42 eilers
- * Added regExp-search in database for all fields in a contact.
- *
- * Revision 1.5 2002/10/16 10:52:40 eilers
- * Added some docu to the interface and now using the cache infrastucture by zecke.. :)
- *
- * Revision 1.4 2002/10/14 16:21:54 eilers
- * Some minor interface updates
- *
- * Revision 1.3 2002/10/07 17:34:24 eilers
- * added OBackendFactory for advanced backend access
- *
- * Revision 1.2 2002/10/02 16:18:11 eilers
- * debugged and seems to work almost perfectly ..
- *
- * Revision 1.1 2002/09/27 17:11:44 eilers
- * Added API for accessing the Contact-Database ! It is compiling, but
- * please do not expect that anything is working !
- * I will debug that stuff in the next time ..
- * Please read README_COMPILE for compiling !
- *
- *
*/
#include "ocontactaccess.h"
#include "obackendfactory.h"
#include <qasciidict.h>
#include <qdatetime.h>
#include <qfile.h>
#include <qregexp.h>
#include <qlist.h>
#include <qcopchannel_qws.h>
//#include <qpe/qcopenvelope_qws.h>
#include <qpe/global.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
-#include "ocontactaccessbackend_xml.h"
+#include <opie2/ocontactaccessbackend_xml.h>
+namespace Opie {
OContactAccess::OContactAccess ( const QString appname, const QString ,
OContactAccessBackend* end, bool autosync ):
OPimAccessTemplate<OContact>( end )
{
/* take care of the backend. If there is no one defined, we
* will use the XML-Backend as default (until we have a cute SQL-Backend..).
*/
if( end == 0 ) {
qWarning ("Using BackendFactory !");
end = OBackendFactory<OContactAccessBackend>::Default( "contact", appname );
}
@@ -157,12 +139,14 @@ void OContactAccess::copMessage( const QCString &msg, const QByteArray & )
if ( msg == "addressbookUpdated()" ){
qWarning ("OContactAccess: Received addressbokUpdated()");
emit signalChanged ( this );
} else if ( msg == "flush()" ) {
qWarning ("OContactAccess: Received flush()");
save ();
} else if ( msg == "reload()" ) {
qWarning ("OContactAccess: Received reload()");
reload ();
emit signalChanged ( this );
}
}
+
+}
diff --git a/libopie2/opiepim/core/ocontactaccess.h b/libopie2/opiepim/core/ocontactaccess.h
index bd6da40..505c87b 100644
--- a/libopie2/opiepim/core/ocontactaccess.h
+++ b/libopie2/opiepim/core/ocontactaccess.h
@@ -1,98 +1,60 @@
/*
- * Class to manage the Contacts.
- *
- * Copyright (c) 2002 by Stefan Eilers (Eilers.Stefan@epost.de)
- * Copyright (c) 2002 by Holger Freyther (zecke@handhelds.org)
- *
- * =====================================================================
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation;
- * either version 2 of the License, or (at your option) any later
- * version.
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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.
+*/
+/*
* =====================================================================
* ToDo: Define enum for query settings
* =====================================================================
- * Version: $Id$
- * =====================================================================
- * History:
- * $Log$
- * Revision 1.10 2003/12/22 10:19:26 eilers
- * Finishing implementation of sql-backend for datebook. But I have to
- * port the PIM datebook application to use it, before I could debug the
- * whole stuff.
- * Thus, PIM-Database backend is finished, but highly experimental. And some
- * parts are still generic. For instance, the "queryByExample()" methods are
- * not (or not fully) implemented. Todo: custom-entries not stored.
- * The big show stopper: matchRegExp() (needed by OpieSearch) needs regular
- * expression search in the database, which is not supported by sqlite !
- * Therefore we need either an extended sqlite or a workaround which would
- * be very slow and memory consuming..
- *
- * Revision 1.9 2003/08/01 12:30:16 eilers
- * Merging changes from BRANCH_1_0 to HEAD
- *
- * Revision 1.8.2.1 2003/06/30 14:34:19 eilers
- * Patches from Zecke:
- * Fixing and cleaning up extraMap handling
- * Adding d_ptr for binary compatibility in the future
- *
- * Revision 1.8 2003/05/08 13:55:09 tille
- * search stuff
- * and match, toRichText & toShortText in oevent
- *
- * Revision 1.7 2003/04/13 18:07:10 zecke
- * More API doc
- * QString -> const QString&
- * QString = 0l -> QString::null
- *
- * Revision 1.6 2003/01/02 14:27:12 eilers
- * Improved query by example: Search by date is possible.. First step
- * for a today plugin for birthdays..
- *
- * Revision 1.5 2002/11/13 14:14:51 eilers
- * Added sorted for Contacts..
- *
- * Revision 1.4 2002/11/01 15:10:42 eilers
- * Added regExp-search in database for all fields in a contact.
- *
- * Revision 1.3 2002/10/16 10:52:40 eilers
- * Added some docu to the interface and now using the cache infrastucture by zecke.. :)
- *
- * Revision 1.2 2002/10/14 16:21:54 eilers
- * Some minor interface updates
- *
- * Revision 1.1 2002/09/27 17:11:44 eilers
- * Added API for accessing the Contact-Database ! It is compiling, but
- * please do not expect that anything is working !
- * I will debug that stuff in the next time ..
- * Please read README_COMPILE for compiling !
- *
- * =====================================================================
*/
#ifndef _OCONTACTACCESS_H
#define _OCONTACTACCESS_H
#include <qobject.h>
#include <qpe/qcopenvelope_qws.h>
#include <qvaluelist.h>
#include <qfileinfo.h>
-#include "ocontact.h"
-#include "ocontactaccessbackend.h"
-#include "opimaccesstemplate.h"
+#include <opie2/ocontact.h>
+#include <opie2/ocontactaccessbackend.h>
+#include <opie2/opimaccesstemplate.h>
+namespace Opie {
/**
* Class to access the contacts database.
* This is just a frontend for the real database handling which is
* done by the backend.
* This class is used to access the Contacts on a system. This class as any OPIE PIM
* class is backend independent.
* @author Stefan Eilers, Holger Freyther
* @see OPimAccessTemplate
*/
class OContactAccess: public QObject, public OPimAccessTemplate<OContact>
{
Q_OBJECT
@@ -181,13 +143,16 @@ class OContactAccess: public QObject, public OPimAccessTemplate<OContact>
// OContactAccessPrivate* d;
OContactAccessBackend *m_backEnd;
bool m_loading:1;
private slots:
void copMessage( const QCString &msg, const QByteArray &data );
private:
class Private;
Private *d;
};
+
+}
+
#endif
diff --git a/libopie2/opiepim/core/oconversion.cpp b/libopie2/opiepim/core/oconversion.cpp
index 0d15414..b7eebef 100644
--- a/libopie2/opiepim/core/oconversion.cpp
+++ b/libopie2/opiepim/core/oconversion.cpp
@@ -1,29 +1,47 @@
-/**********************************************************************
-** Copyright (C) 2003 by Stefan Eilers (eilers.stefan@epost.de)
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU Lesser General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-**********************************************************************/
-
-#include "oconversion.h"
+/*
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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 <opie2/oconversion.h>
#include <qpe/timeconversion.h>
+namespace Opie {
+
QString OConversion::dateToString( const QDate &d )
{
if ( d.isNull() || !d.isValid() )
return QString::null;
// ISO format in year, month, day (YYYYMMDD); e.g. 20021231
QString year = QString::number( d.year() );
QString month = QString::number( d.month() );
month = month.rightJustify( 2, '0' );
QString day = QString::number( d.day() );
day = day.rightJustify( 2, '0' );
@@ -102,12 +120,13 @@ QDateTime OConversion::dateTimeFromString( const QString& str) {
int month = str.mid(2, 2).toInt();
int year = str.mid(4, 4).toInt();
int hour = str.mid(8, 2).toInt();
int min = str.mid(10, 2).toInt();
int sec = str.mid(12, 2).toInt();
QDate date( year, month, day );
QTime time( hour, min, sec );
QDateTime dt( date, time );
return dt;
}
+} \ No newline at end of file
diff --git a/libopie2/opiepim/core/oconversion.h b/libopie2/opiepim/core/oconversion.h
index 4c0a497..3c4fdf3 100644
--- a/libopie2/opiepim/core/oconversion.h
+++ b/libopie2/opiepim/core/oconversion.h
@@ -1,48 +1,62 @@
-/**********************************************************************
-** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
-** Copyright (C) 2002-2003 by Stefan Eilers (eilers.stefan@epost.de)
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**********************************************************************/
+/*
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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.
+*/
#ifndef __oconversion_h__
#define __oconversion_h__
/* #include <time.h> */
/* #include <sys/types.h> */
#include <qdatetime.h>
-/* FIXME namespace? -zecke */
+namespace Opie {
+
class OConversion
{
public:
static QString dateToString( const QDate &d );
static QDate dateFromString( const QString &datestr );
/**
* simple function to store DateTime as string and read from string
* no timezone changing is done
* DDMMYYYYHHMMSS is the simple format
*/
static QString dateTimeToString( const QDateTime& );
static QDateTime dateTimeFromString( const QString& );
private:
class Private;
Private* d;
};
+}
+
#endif // __oconversion_h__
diff --git a/libopie2/opiepim/core/odatebookaccess.cpp b/libopie2/opiepim/core/odatebookaccess.cpp
index d95fed6..8c527f6 100644
--- a/libopie2/opiepim/core/odatebookaccess.cpp
+++ b/libopie2/opiepim/core/odatebookaccess.cpp
@@ -1,15 +1,44 @@
-#include "obackendfactory.h"
-#include "odatebookaccess.h"
+/*
+ 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 <opie2/obackendfactory.h>
+#include <opie2/odatebookaccess.h>
+namespace Opie {
/**
* Simple constructor
* It takes a ODateBookAccessBackend as parent. If it is 0 the default implementation
* will be used!
* @param back The backend to be used or 0 for the default backend
* @param ac What kind of access is intended
*/
ODateBookAccess::ODateBookAccess( ODateBookAccessBackend* back, enum Access ac )
: OPimAccessTemplate<OEvent>( back )
{
if (!back )
back = OBackendFactory<ODateBookAccessBackend>::Default("datebook", QString::null );
@@ -70,12 +99,14 @@ OEffectiveEvent::ValueList ODateBookAccess::effectiveEvents( const QDateTime& st
* @param from Include all events from...
* @param to Include all events to...
*/
OEffectiveEvent::ValueList ODateBookAccess::effectiveNonRepeatingEvents( const QDate& from, const QDate& to ) const {
return m_backEnd->effectiveNonRepeatingEvents( from, to );
}
/**
* @return all non repeating events at a given datetime
*/
OEffectiveEvent::ValueList ODateBookAccess::effectiveNonRepeatingEvents( const QDateTime& start ) const {
return m_backEnd->effectiveNonRepeatingEvents( start );
}
+
+}
diff --git a/libopie2/opiepim/core/odatebookaccess.h b/libopie2/opiepim/core/odatebookaccess.h
index 62196da..38dc754 100644
--- a/libopie2/opiepim/core/odatebookaccess.h
+++ b/libopie2/opiepim/core/odatebookaccess.h
@@ -1,20 +1,49 @@
+/*
+ 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.
+*/
#ifndef OPIE_DATE_BOOK_ACCESS_H
#define OPIE_DATE_BOOK_ACCESS_H
#include "odatebookaccessbackend.h"
#include "opimaccesstemplate.h"
-#include "oevent.h"
+#include <opie2/oevent.h>
+namespace Opie {
/**
* This is the object orientated datebook database. It'll use OBackendFactory
* to query for a backend.
* All access to the datebook should be done via this class.
* Make sure to load and save the datebook this is not part of
* destructing and creating the object
*
* @author Holger Freyther, Stefan Eilers
*/
class ODateBookAccess : public OPimAccessTemplate<OEvent> {
public:
ODateBookAccess( ODateBookAccessBackend* = 0l, enum Access acc = Random );
@@ -32,13 +61,15 @@ public:
/* return non repeating events (from,to) */
OEffectiveEvent::ValueList effectiveEvents( const QDate& from, const QDate& to ) const;
OEffectiveEvent::ValueList effectiveEvents( const QDateTime& start ) const;
OEffectiveEvent::ValueList effectiveNonRepeatingEvents( const QDate& from, const QDate& to ) const;
OEffectiveEvent::ValueList effectiveNonRepeatingEvents( const QDateTime& start ) const;
private:
ODateBookAccessBackend* m_backEnd;
class Private;
Private* d;
};
+}
+
#endif
diff --git a/libopie2/opiepim/core/opimaccesstemplate.h b/libopie2/opiepim/core/opimaccesstemplate.h
index ecbeb68..5826cbc 100644
--- a/libopie2/opiepim/core/opimaccesstemplate.h
+++ b/libopie2/opiepim/core/opimaccesstemplate.h
@@ -1,23 +1,53 @@
+/*
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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.
+*/
#ifndef OPIE_PIM_ACCESS_TEMPLATE_H
#define OPIE_PIM_ACCESS_TEMPLATE_H
#include <qarray.h>
-#include <opie/opimrecord.h>
-#include <opie/opimaccessbackend.h>
-#include <opie/orecordlist.h>
+#include <opie2/opimrecord.h>
+#include <opie2/opimaccessbackend.h>
+#include <opie2/orecordlist.h>
-#include "opimcache.h"
-#include "otemplatebase.h"
+#include <opie2/opimcache.h>
+#include <opie2/otemplatebase.h>
+
+namespace Opie {
class OPimAccessTemplatePrivate;
/**
* Thats the frontend to our OPIE PIM
* Library. Either you want to use it's
* interface or you want to implement
* your own Access lib
* Just create a OPimRecord and inherit from
* the plugins
*/
template <class T = OPimRecord >
@@ -290,13 +320,16 @@ template <class T>
void OPimAccessTemplate<T>::cache( const T& t ) const{
/* hacky we need to work around the const*/
((OPimAccessTemplate<T>*)this)->m_cache.add( t );
}
template <class T>
void OPimAccessTemplate<T>::setSaneCacheSize( int size ) {
m_cache.setSize( size );
}
template <class T>
void OPimAccessTemplate<T>::setReadAhead( uint count ) {
m_backEnd->setReadAhead( count );
}
+
+}
+
#endif
diff --git a/libopie2/opiepim/core/opimcache.h b/libopie2/opiepim/core/opimcache.h
index 7f7cff5..e70a910 100644
--- a/libopie2/opiepim/core/opimcache.h
+++ b/libopie2/opiepim/core/opimcache.h
@@ -1,19 +1,48 @@
+/*
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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.
+*/
#ifndef OPIE_PIM_CACHE_H
#define OPIE_PIM_CACHE_H
#include <qintcache.h>
-#include "opimrecord.h"
+#include <opie2/opimrecord.h>
+namespace Opie {
class OPimCacheItemPrivate;
template <class T = OPimRecord>
class OPimCacheItem {
public:
OPimCacheItem( const T& t = T() );
OPimCacheItem( const OPimCacheItem& );
~OPimCacheItem();
OPimCacheItem &operator=( const OPimCacheItem& );
T record()const;
@@ -119,13 +148,15 @@ void OPimCache<T>::add( const T& t ) {
template <class T>
void OPimCache<T>::remove( int uid ) {
m_cache.remove( uid );
}
template <class T>
void OPimCache<T>::replace( const T& t) {
Item *it = m_cache.find( t.uid() );
if ( it ) {
it->setRecord( t );
}
}
+}
+
#endif
diff --git a/libopie2/opiepim/core/opimmaintainer.cpp b/libopie2/opiepim/core/opimmaintainer.cpp
index 92cb25a..b2eff12 100644
--- a/libopie2/opiepim/core/opimmaintainer.cpp
+++ b/libopie2/opiepim/core/opimmaintainer.cpp
@@ -1,14 +1,44 @@
-#include "opimmaintainer.h"
+/*
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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 <opie2/opimmaintainer.h>
+
+namespace Opie {
OPimMaintainer::OPimMaintainer( int mode, int uid )
: m_mode(mode), m_uid(uid )
{}
OPimMaintainer::~OPimMaintainer() {
}
OPimMaintainer::OPimMaintainer( const OPimMaintainer& main ) {
*this = main;
}
OPimMaintainer &OPimMaintainer::operator=( const OPimMaintainer& main ) {
m_mode = main.m_mode;
m_uid = main.m_uid;
@@ -26,12 +56,14 @@ bool OPimMaintainer::operator!=( const OPimMaintainer& main ) {
int OPimMaintainer::mode()const {
return m_mode;
}
int OPimMaintainer::uid()const {
return m_uid;
}
void OPimMaintainer::setMode( int mo) {
m_mode = mo;
}
void OPimMaintainer::setUid( int uid ) {
m_uid = uid;
}
+
+}
diff --git a/libopie2/opiepim/core/opimmaintainer.h b/libopie2/opiepim/core/opimmaintainer.h
index 793d066..46bc9d2 100644
--- a/libopie2/opiepim/core/opimmaintainer.h
+++ b/libopie2/opiepim/core/opimmaintainer.h
@@ -1,17 +1,46 @@
+/*
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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.
+*/
#ifndef OPIE_PIM_MAINTAINER_H
#define OPIE_PIM_MAINTAINER_H
#include <qstring.h>
+namespace Opie {
/**
* Who maintains what?
*/
class OPimMaintainer {
public:
enum Mode { Undefined = -1,
Nothing = 0,
Responsible,
DoneBy,
Coordinating,
};
OPimMaintainer( int mode = Undefined, int uid = 0);
@@ -28,13 +57,15 @@ public:
void setMode( int mode );
void setUid( int uid );
private:
int m_mode;
int m_uid;
class Private;
Private *d;
};
+}
+
#endif
diff --git a/libopie2/opiepim/core/opimnotify.cpp b/libopie2/opiepim/core/opimnotify.cpp
index af5514b..c61f9da 100644
--- a/libopie2/opiepim/core/opimnotify.cpp
+++ b/libopie2/opiepim/core/opimnotify.cpp
@@ -1,15 +1,45 @@
+/*
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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 <qshared.h>
-#include "opimnotify.h"
+#include <opie2/opimnotify.h>
+
+namespace Opie {
struct OPimNotify::Data : public QShared {
Data() : QShared(),dur(-1),parent(0) {
}
QDateTime start;
int dur;
QString application;
int parent;
};
OPimNotify::OPimNotify( const QDateTime& start, int duration, int parent ) {
@@ -216,12 +246,13 @@ void OPimReminder::deref() {
if ( data->deref() ) {
delete data;
data = 0l;
}
}
void OPimReminder::copyIntern() {
if ( data->count != 1 ) {
Data* da = new Data;
da->record = data->record;
data = da;
}
}
+}
diff --git a/libopie2/opiepim/core/opimnotify.h b/libopie2/opiepim/core/opimnotify.h
index 58417db..fed3970 100644
--- a/libopie2/opiepim/core/opimnotify.h
+++ b/libopie2/opiepim/core/opimnotify.h
@@ -1,18 +1,48 @@
+/*
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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.
+*/
#ifndef OPIE_PIM_NOTIFY_H
#define OPIE_PIM_NOTIFY_H
#include <qdatetime.h>
#include <qvaluelist.h>
+
+namespace Opie {
/**
* This is the base class of Notifiers. Possible
* notifiers would be Alarms, Reminders
* What they share is that they have
* A DateTime, Type, Duration
* This is what this base class takes care of
* on top of that it's shared
*/
/*
* TALK to eilers: have a class OPimDuration which sets the Duration
* given on the Due/Start Date? -zecke
* discuss: do we need a uid for the notify? -zecke
@@ -132,13 +162,15 @@ public:
void setRecordUid( int uid );
private:
void deref();
void copyIntern();
struct Data;
Data* data;
class Private;
Private *d;
};
+}
+
#endif
diff --git a/libopie2/opiepim/core/opimnotifymanager.cpp b/libopie2/opiepim/core/opimnotifymanager.cpp
index d6f0ead..1771fad 100644
--- a/libopie2/opiepim/core/opimnotifymanager.cpp
+++ b/libopie2/opiepim/core/opimnotifymanager.cpp
@@ -1,18 +1,48 @@
-#include "opimnotifymanager.h"
-
-#include "oconversion.h"
+/*
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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 <opie2/opimnotifymanager.h>
+
+#include <opie2/oconversion.h>
#include <qstringlist.h>
+namespace Opie {
+
OPimNotifyManager::OPimNotifyManager( const Reminders& rem, const Alarms& al)
: m_rem( rem ), m_al( al )
{}
OPimNotifyManager::~OPimNotifyManager() {
}
/* use static_cast and type instead of dynamic... */
void OPimNotifyManager::add( const OPimNotify& noti) {
if ( noti.type() == QString::fromLatin1("OPimReminder") ) {
const OPimReminder& rem = static_cast<const OPimReminder&>(noti);
m_rem.append( rem );
}else if ( noti.type() == QString::fromLatin1("OPimAlarm") ) {
const OPimAlarm& al = static_cast<const OPimAlarm&>(noti);
@@ -151,12 +181,13 @@ void OPimNotifyManager::alarmsFromString( const QString& str )
}
void OPimNotifyManager::remindersFromString( const QString& str )
{
QStringList rems = QStringList::split(";", str );
for (QStringList::Iterator it = rems.begin(); it != rems.end(); ++it ) {
OPimReminder rem( (*it).toInt() );
add( rem );
}
}
+}
diff --git a/libopie2/opiepim/core/opimnotifymanager.h b/libopie2/opiepim/core/opimnotifymanager.h
index f3c22f9..0272e5d 100644
--- a/libopie2/opiepim/core/opimnotifymanager.h
+++ b/libopie2/opiepim/core/opimnotifymanager.h
@@ -1,19 +1,48 @@
+/*
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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.
+*/
#ifndef OPIE_PIM_NOTIFY_MANAGER_H
#define OPIE_PIM_NOTIFY_MANAGER_H
#include <qvaluelist.h>
-#include <opie/opimnotify.h>
+#include <opie2/opimnotify.h>
+namespace Opie {
/**
* The notify manager keeps track of the Notifiers....
*/
class OPimNotifyManager {
public:
typedef QValueList<OPimReminder> Reminders;
typedef QValueList<OPimAlarm> Alarms;
OPimNotifyManager( const Reminders& rems = Reminders(), const Alarms& alarms = Alarms() );
~OPimNotifyManager();
/* we will cast it for you ;) */
void add( const OPimNotify& );
@@ -79,13 +108,15 @@ public:
private:
Reminders m_rem;
Alarms m_al;
class Private;
Private *d;
};
+}
+
#endif
diff --git a/libopie2/opiepim/core/opimrecord.cpp b/libopie2/opiepim/core/opimrecord.cpp
index 2365748..72bb372 100644
--- a/libopie2/opiepim/core/opimrecord.cpp
+++ b/libopie2/opiepim/core/opimrecord.cpp
@@ -1,19 +1,48 @@
+/*
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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 <qarray.h>
#include <qpe/categories.h>
#include <qpe/categoryselect.h>
-#include "opimrecord.h"
+#include <opie2/opimrecord.h>
+namespace Opie {
Qtopia::UidGen OPimRecord::m_uidGen( Qtopia::UidGen::Qtopia );
OPimRecord::OPimRecord( int uid )
: Qtopia::Record() {
m_lastHit = -1;
setUid( uid );
}
OPimRecord::~OPimRecord() {
}
OPimRecord::OPimRecord( const OPimRecord& rec )
@@ -171,12 +200,14 @@ OPimXRefPartner OPimRecord::partner( QDataStream& stream ) {
void OPimRecord::setLastHitField( int lastHit )const {
m_lastHit = lastHit;
}
int OPimRecord::lastHitField()const{
return m_lastHit;
}
QMap<QString, QString> OPimRecord::toExtraMap()const {
return customMap;
}
void OPimRecord::setExtraMap( const QMap<QString, QString>& map) {
customMap = map;
}
+
+}
diff --git a/libopie2/opiepim/core/opimrecord.h b/libopie2/opiepim/core/opimrecord.h
index 3d774e2..63a3a98 100644
--- a/libopie2/opiepim/core/opimrecord.h
+++ b/libopie2/opiepim/core/opimrecord.h
@@ -1,29 +1,58 @@
+/*
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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.
+*/
#ifndef OPIE_PIM_RECORD_H
#define OPIE_PIM_RECORD_H
#include <qdatastream.h>
#include <qmap.h>
#include <qstring.h>
#include <qstringlist.h>
/*
* we need to get customMap which is private...
*/
#define private protected
#include <qpe/palmtoprecord.h>
#undef private
-#include <opie/opimxrefmanager.h>
+#include <opie2/opimxrefmanager.h>
+namespace Opie {
/**
* This is the base class for
* all PIM Records
*
*/
class OPimRecord : public Qtopia::Record {
public:
/**
* c'tor
* uid of 0 isEmpty
* uid of 1 will be assigned a new one
*/
@@ -144,15 +173,15 @@ protected:
private:
class OPimRecordPrivate;
OPimRecordPrivate *d;
OPimXRefManager m_xrefman;
static Qtopia::UidGen m_uidGen;
private:
void flush( const OPimXRefPartner&, QDataStream& stream )const;
OPimXRefPartner partner( QDataStream& );
};
-
+}
#endif
diff --git a/libopie2/opiepim/core/opimresolver.cpp b/libopie2/opiepim/core/opimresolver.cpp
index 4ebbd6e..eceabcb 100644
--- a/libopie2/opiepim/core/opimresolver.cpp
+++ b/libopie2/opiepim/core/opimresolver.cpp
@@ -1,21 +1,51 @@
+/*
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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 <qcopchannel_qws.h>
#include <qpe/qcopenvelope_qws.h>
-#include "otodoaccess.h"
-#include "ocontactaccess.h"
+#include <opie2/otodoaccess.h>
+#include <opie2/ocontactaccess.h>
//#include "opimfactory.h"
-#include "opimresolver.h"
+#include <opie2/opimresolver.h>
+
+namespace Opie {
OPimResolver* OPimResolver::m_self = 0l;
OPimResolver::OPimResolver() {
/* the built in channels */
m_builtIns << "Todolist" << "Addressbook" << "Datebook";
}
OPimResolver* OPimResolver::self() {
if (!m_self)
m_self = new OPimResolver();
return m_self;
@@ -187,12 +217,14 @@ OPimBase* OPimResolver::backend( int rtti ) {
case AddressBook:
base = new OContactAccess("Resolver");
break;
default:
break;
}
// FIXME for 3rd party
if (!base )
;
return base;
}
+
+}
diff --git a/libopie2/opiepim/core/opimresolver.h b/libopie2/opiepim/core/opimresolver.h
index 1ce1619..adc7c16 100644
--- a/libopie2/opiepim/core/opimresolver.h
+++ b/libopie2/opiepim/core/opimresolver.h
@@ -1,20 +1,49 @@
+/*
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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.
+*/
#ifndef OPIE_PIM_RESOLVER
#define OPIE_PIM_RESOLVER
#include <qstring.h>
#include <qvaluelist.h>
-#include <opie/otemplatebase.h>
+#include <opie2/otemplatebase.h>
+namespace Opie {
/**
* OPimResolver is a MetaClass to access
* available backends read only.
* It will be used to resolve uids + app names
* to full informations
* to traverse through a list of alarms, reminders
* to get access to built in PIM functionality
* and to more stuff
* THE PERFORMANCE will depend on THE BACKEND
* USING XML is a waste of memory!!!!!
*/
class OPimResolver {
@@ -78,13 +107,15 @@ private:
OPimRecord* recordExtern( const QString&, int );
OPimRecord* recordExtern( const QString& );
static OPimResolver* m_self;
struct Data;
class Private;
Data* data;
Private* d;
QStringList m_builtIns;
};
+}
+
#endif
diff --git a/libopie2/opiepim/core/opimstate.cpp b/libopie2/opiepim/core/opimstate.cpp
index 6fb2feb..1013a1c 100644
--- a/libopie2/opiepim/core/opimstate.cpp
+++ b/libopie2/opiepim/core/opimstate.cpp
@@ -1,16 +1,45 @@
+/*
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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 <qshared.h>
#include "opimstate.h"
+namespace Opie {
/*
* for one int this does not make
* much sense but never the less
* we will do it for the future
*/
struct OPimState::Data : public QShared {
Data() : QShared(),state(Undefined) {
}
int state;
};
OPimState::OPimState( int state ) {
@@ -53,12 +82,14 @@ void OPimState::deref() {
data = 0l;
}
}
void OPimState::copyInternally() {
/* we need to change it */
if ( data->count != 1 ) {
data->deref();
Data* d2 = new Data;
d2->state = data->state;
data = d2;
}
}
+
+}
diff --git a/libopie2/opiepim/core/opimstate.h b/libopie2/opiepim/core/opimstate.h
index cf6af46..78e8cd0 100644
--- a/libopie2/opiepim/core/opimstate.h
+++ b/libopie2/opiepim/core/opimstate.h
@@ -1,17 +1,46 @@
+/*
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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.
+*/
#ifndef OPIE_PIM_STATE_H
#define OPIE_PIM_STATE_H
#include <qstring.h>
+namespace Opie {
/**
* The State of a Task
* This class encapsules the state of a todo
* and it's shared too
*/
/*
* in c a simple struct would be enough ;)
* g_new_state();
* g_do_some_thing( state_t* );
* ;)
*/
class OPimState {
@@ -33,14 +62,14 @@ public:
int state()const;
private:
void deref();
inline void copyInternally();
struct Data;
Data* data;
class Private;
Private *d;
};
-
+}
#endif
diff --git a/libopie2/opiepim/core/opimxref.cpp b/libopie2/opiepim/core/opimxref.cpp
index 8eefbd8..85d3345 100644
--- a/libopie2/opiepim/core/opimxref.cpp
+++ b/libopie2/opiepim/core/opimxref.cpp
@@ -1,13 +1,43 @@
-#include "opimxref.h"
+/*
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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 <opie2/opimxref.h>
+
+namespace Opie {
OPimXRef::OPimXRef( const OPimXRefPartner& one, const OPimXRefPartner& two )
: m_partners(2)
{
m_partners[0] = one;
m_partners[1] = two;
}
OPimXRef::OPimXRef()
: m_partners(2)
{
}
@@ -36,12 +66,14 @@ void OPimXRef::setPartner( enum Partners par, const OPimXRefPartner& part) {
bool OPimXRef::containsString( const QString& string ) const{
if ( m_partners[One].service() == string ||
m_partners[Two].service() == string ) return true;
return false;
}
bool OPimXRef::containsUid( int uid ) const{
if ( m_partners[One].uid() == uid ||
m_partners[Two].uid() == uid ) return true;
return false;
}
+
+}
diff --git a/libopie2/opiepim/core/opimxref.h b/libopie2/opiepim/core/opimxref.h
index 6852651..820c9c4 100644
--- a/libopie2/opiepim/core/opimxref.h
+++ b/libopie2/opiepim/core/opimxref.h
@@ -1,20 +1,50 @@
+/*
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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.
+*/
+
#ifndef OPIM_XREF_H
#define OPIM_XREF_H
#include <qarray.h>
#include <qvaluelist.h>
-#include <opie/opimxrefpartner.h>
+#include <opie2/opimxrefpartner.h>
+namespace Opie {
/**
* this is a Cross Referecne between
* two Cross Reference Partners
*/
class OPimXRef {
public:
typedef QValueList<OPimXRef> ValueList;
enum Partners { One, Two };
OPimXRef( const OPimXRefPartner& ONE, const OPimXRefPartner& );
OPimXRef();
OPimXRef( const OPimXRef& );
~OPimXRef();
@@ -27,13 +57,15 @@ public:
void setPartner( enum Partners, const OPimXRefPartner& );
bool containsString( const QString& service)const;
bool containsUid( int uid )const;
private:
QArray<OPimXRefPartner> m_partners;
class Private;
Private *d;
};
+}
+
#endif
diff --git a/libopie2/opiepim/core/opimxrefmanager.cpp b/libopie2/opiepim/core/opimxrefmanager.cpp
index 58bfd24..bf6fed6 100644
--- a/libopie2/opiepim/core/opimxrefmanager.cpp
+++ b/libopie2/opiepim/core/opimxrefmanager.cpp
@@ -1,14 +1,43 @@
-#include "opimxrefmanager.h"
+/*
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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 <opie2/opimxrefmanager.h>
+namespace Opie {
OPimXRefManager::OPimXRefManager() {
}
OPimXRefManager::OPimXRefManager( const OPimXRefManager& ref) {
m_list = ref.m_list;
}
OPimXRefManager::~OPimXRefManager() {
}
OPimXRefManager &OPimXRefManager::operator=( const OPimXRefManager& ref) {
m_list = ref.m_list;
return *this;
}
@@ -60,12 +89,14 @@ OPimXRef::ValueList OPimXRefManager::list( const QString& appName )const{
}
OPimXRef::ValueList OPimXRefManager::list( int uid )const {
OPimXRef::ValueList list;
OPimXRef::ValueList::ConstIterator it;
for ( it = m_list.begin(); it != m_list.end(); ++it ) {
if ( (*it).containsUid( uid ) )
list.append( (*it) );
}
return list;
}
+
+}
diff --git a/libopie2/opiepim/core/opimxrefmanager.h b/libopie2/opiepim/core/opimxrefmanager.h
index c485e98..fa2d7f4 100644
--- a/libopie2/opiepim/core/opimxrefmanager.h
+++ b/libopie2/opiepim/core/opimxrefmanager.h
@@ -1,19 +1,48 @@
+/*
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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.
+*/
#ifndef OPIM_XREF_MANAGER_H
#define OPIM_XREF_MANAGER_H
#include <qstringlist.h>
-#include <opie/opimxref.h>
+#include <opie2/opimxref.h>
+namespace Opie {
/**
* This is a simple manager for
* OPimXRefs.
* It allows addition, removing, replacing
* clearing and 'querying' the XRef...
*/
class OPimXRefManager {
public:
OPimXRefManager();
OPimXRefManager( const OPimXRefManager& );
~OPimXRefManager();
@@ -31,13 +60,15 @@ public:
*/
QStringList apps()const;
OPimXRef::ValueList list()const;
OPimXRef::ValueList list( const QString& service )const;
OPimXRef::ValueList list( int uid )const;
private:
OPimXRef::ValueList m_list;
class Private;
Private *d;
};
+}
+
#endif
diff --git a/libopie2/opiepim/core/opimxrefpartner.cpp b/libopie2/opiepim/core/opimxrefpartner.cpp
index 6ef3efb..f6ccc7f 100644
--- a/libopie2/opiepim/core/opimxrefpartner.cpp
+++ b/libopie2/opiepim/core/opimxrefpartner.cpp
@@ -1,13 +1,43 @@
-#include "opimxrefpartner.h"
+/*
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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 <opie2/opimxrefpartner.h>
+
+namespace Opie {
OPimXRefPartner::OPimXRefPartner( const QString& appName,
int uid, int field )
: m_app(appName), m_uid(uid), m_field( field ) {
}
OPimXRefPartner::OPimXRefPartner( const OPimXRefPartner& ref ) {
*this = ref;
}
OPimXRefPartner::~OPimXRefPartner() {
}
OPimXRefPartner &OPimXRefPartner::operator=( const OPimXRefPartner& par ) {
m_app = par.m_app;
@@ -32,12 +62,14 @@ int OPimXRefPartner::uid()const {
int OPimXRefPartner::field()const {
return m_field;
}
void OPimXRefPartner::setService( const QString& appName ) {
m_app = appName;
}
void OPimXRefPartner::setUid( int uid ) {
m_uid = uid;
}
void OPimXRefPartner::setField( int field ) {
m_field = field;
}
+
+}
diff --git a/libopie2/opiepim/core/opimxrefpartner.h b/libopie2/opiepim/core/opimxrefpartner.h
index d76e384..6853d5b 100644
--- a/libopie2/opiepim/core/opimxrefpartner.h
+++ b/libopie2/opiepim/core/opimxrefpartner.h
@@ -1,17 +1,46 @@
+/*
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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.
+*/
#ifndef OPIM_XREF_PARTNER_H
#define OPIM_XREF_PARTNER_H
#include <qstring.h>
+namespace Opie {
/**
* This class represents one partner
* of a Cross Reference.
* In Opie one application
* can link one uid
* with one tableId( fieldId ) to another.
*/
class OPimXRefPartner {
public:
OPimXRefPartner( const QString& service = QString::null,
int uid = 0, int field = -1 );
OPimXRefPartner( const OPimXRefPartner& );
@@ -27,14 +56,15 @@ public:
void setService( const QString& service );
void setUid( int uid );
void setField( int field );
private:
QString m_app;
int m_uid;
int m_field;
class Private;
Private* d;
};
+}
#endif
diff --git a/libopie2/opiepim/core/orecur.cpp b/libopie2/opiepim/core/orecur.cpp
index f46f22e..033f264 100644
--- a/libopie2/opiepim/core/orecur.cpp
+++ b/libopie2/opiepim/core/orecur.cpp
@@ -1,21 +1,51 @@
+/*
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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 <time.h>
#include <qshared.h>
#include <qtopia/timeconversion.h>
-#include "otimezone.h"
-#include "orecur.h"
+#include <opie2/otimezone.h>
+#include <opie2/orecur.h>
+namespace Opie {
struct ORecur::Data : public QShared {
Data() : QShared() {
type = ORecur::NoRepeat;
freq = -1;
days = 0;
pos = 0;
create = QDateTime::currentDateTime();
hasEnd = FALSE;
end = QDate::currentDate();
}
char days; // Q_UINT8 for 8 seven days;)
ORecur::RepeatType type;
@@ -582,12 +612,14 @@ void ORecur::fromMap( const QMap<int, QString>& map )
#if 0
// FIXME: Exceptions currently not supported...
// Convert the list of exceptions from QString into ExceptionList
data -> list.clear();
QString exceptStr = map[ ORecur::Exceptions ];
QStringList exceptList = QStringList::split( " ", exceptStr );
...
#endif
}
+
+} \ No newline at end of file
diff --git a/libopie2/opiepim/core/orecur.h b/libopie2/opiepim/core/orecur.h
index d7ecd90..60508f5 100644
--- a/libopie2/opiepim/core/orecur.h
+++ b/libopie2/opiepim/core/orecur.h
@@ -1,26 +1,52 @@
/*
- * GPL from TT
- */
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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.
+*/
#ifndef OPIE_RECUR_H
#define OPIE_RECUR_H
#include <sys/types.h>
#include <qdatetime.h>
#include <qvaluelist.h>
#include <qmap.h>
+namespace Opie {
/**
* Class to handle Recurrencies..
*/
class ORecur {
public:
typedef QValueList<QDate> ExceptionList;
enum RepeatType{ NoRepeat = -1, Daily, Weekly, MonthlyDay,
MonthlyDate, Yearly };
enum Days { MON = 0x01, TUE = 0x02, WED = 0x04, THU = 0x08,
FRI = 0x10, SAT = 0x20, SUN = 0x40 };
enum Fields{ RType = 0, RWeekdays, RPosition, RFreq, RHasEndDate,
@@ -95,13 +121,14 @@ private:
/* Converts rType to String */
QString rTypeString() const;
/* Returns a map to convert Stringname for RType to RepeatType */
QMap<QString, RepeatType> rTypeValueConvertMap() const;
class Data;
Data* data;
class ORecurPrivate;
ORecurPrivate *d;
};
+}
#endif
diff --git a/libopie2/opiepim/core/otemplatebase.h b/libopie2/opiepim/core/otemplatebase.h
index cadac74..17d9961 100644
--- a/libopie2/opiepim/core/otemplatebase.h
+++ b/libopie2/opiepim/core/otemplatebase.h
@@ -1,20 +1,49 @@
+/*
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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.
+*/
#ifndef OPIE_TEMPLATE_BASE_H
#define OPIE_TEMPLATE_BASE_H
#include <qarray.h>
-#include <opie/opimrecord.h>
+#include <opie2/opimrecord.h>
+namespace Opie {
/**
* Templates do not have a base class, This is why
* we've this class
* this is here to give us the possibility
* to have a common base class
* You may not want to use that interface internaly
* POOR mans interface
*/
class OPimBasePrivate;
struct OPimBase {
/**
* return the rtti
@@ -86,13 +115,15 @@ OPimRecord* OTemplateBase<T>::record()const {
template <class T>
OPimRecord* OTemplateBase<T>::record(int uid )const {
T t2 = find(uid );
T* t1 = new T(t2);
return t1;
};
template <class T>
T* OTemplateBase<T>::rec() {
return new T;
}
+}
+
#endif
diff --git a/libopie2/opiepim/core/otimezone.cpp b/libopie2/opiepim/core/otimezone.cpp
index 34659c3..dab68af 100644
--- a/libopie2/opiepim/core/otimezone.cpp
+++ b/libopie2/opiepim/core/otimezone.cpp
@@ -1,20 +1,49 @@
+/*
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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 <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
-#include "otimezone.h"
+#include <opie2/otimezone.h>
-namespace {
+namespace Opie {
QDateTime utcTime( time_t t) {
tm* broken = ::gmtime( &t );
QDateTime ret;
ret.setDate( QDate( broken->tm_year + 1900, broken->tm_mon +1, broken->tm_mday ) );
ret.setTime( QTime( broken->tm_hour, broken->tm_min, broken->tm_sec ) );
return ret;
}
QDateTime utcTime( time_t t, const QString& zone) {
QCString org = ::getenv( "TZ" );
#ifndef Q_OS_MACX // Following line causes bus errors on Mac
::setenv( "TZ", zone.latin1(), true );
@@ -50,24 +79,26 @@ namespace {
::setenv( "TZ", str.latin1(), true );
::tzset();
time_t ti = ::mktime( &broken );
::setenv( "TZ", org, true );
#else
#warning "Need a replacement for MacOSX!!"
time_t ti = ::mktime( &broken );
#endif
return ti;
}
}
+
+namespace Opie {
OTimeZone::OTimeZone( const ZoneName& zone )
: m_name(zone) {
}
OTimeZone::~OTimeZone() {
}
bool OTimeZone::isValid()const {
return !m_name.isEmpty();
}
/*
* we will get the current timezone
@@ -102,12 +133,14 @@ time_t OTimeZone::fromUTCDateTime( const QDateTime& time ) {
}
OTimeZone OTimeZone::current() {
QCString str = ::getenv("TZ");
OTimeZone zone( str );
return zone;
}
OTimeZone OTimeZone::utc() {
return OTimeZone("UTC");
}
QString OTimeZone::timeZone()const {
return m_name;
}
+
+}
diff --git a/libopie2/opiepim/core/otimezone.h b/libopie2/opiepim/core/otimezone.h
index bb08349..28ae6cb 100644
--- a/libopie2/opiepim/core/otimezone.h
+++ b/libopie2/opiepim/core/otimezone.h
@@ -1,18 +1,49 @@
+/*
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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.
+*/
+
#ifndef OPIE_TIME_ZONE_H
#define OPIE_TIME_ZONE_H
#include <time.h>
#include <qdatetime.h>
+namespace Opie
+{
/**
* A very primitive class to convert time
* from one timezone to another
* and to localtime
* and time_t
*/
class OTimeZone {
public:
typedef QString ZoneName;
OTimeZone( const ZoneName& = ZoneName::null );
virtual ~OTimeZone(); // just in case.
@@ -57,15 +88,15 @@ class OTimeZone {
*/
time_t fromUTCDateTime( const QDateTime& );
static OTimeZone current();
static OTimeZone utc();
QString timeZone()const;
private:
ZoneName m_name;
class Private;
Private* d;
};
-
+};
#endif
diff --git a/libopie2/opiepim/core/otodoaccess.cpp b/libopie2/opiepim/core/otodoaccess.cpp
index 37f6fbc..2a3695d 100644
--- a/libopie2/opiepim/core/otodoaccess.cpp
+++ b/libopie2/opiepim/core/otodoaccess.cpp
@@ -1,27 +1,56 @@
+/*
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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 <qdatetime.h>
#include <qpe/alarmserver.h>
// #include "otodoaccesssql.h"
-#include "otodoaccess.h"
-#include "obackendfactory.h"
+#include <opie2/otodoaccess.h>
+#include <opie2/obackendfactory.h>
+namespace Opie {
OTodoAccess::OTodoAccess( OTodoAccessBackend* end, enum Access )
: QObject(), OPimAccessTemplate<OTodo>( end ), m_todoBackEnd( end )
{
// if (end == 0l )
// m_todoBackEnd = new OTodoAccessBackendSQL( QString::null);
- // Zecke: Du musst hier noch für das XML-Backend einen Appnamen übergeben !
+ // Zecke: Du musst hier noch fr das XML-Backend einen Appnamen bergeben !
if (end == 0l )
m_todoBackEnd = OBackendFactory<OTodoAccessBackend>::Default ("todo", QString::null);
setBackEnd( m_todoBackEnd );
}
OTodoAccess::~OTodoAccess() {
// qWarning("~OTodoAccess");
}
void OTodoAccess::mergeWith( const QValueList<OTodo>& list ) {
QValueList<OTodo>::ConstIterator it;
for ( it = list.begin(); it != list.end(); ++it ) {
replace( (*it) );
@@ -51,12 +80,14 @@ OTodoAccess::List OTodoAccess::sorted( bool ascending, int sort,int filter, int
OTodoAccess::List list( ints, this );
return list;
}
void OTodoAccess::removeAllCompleted() {
m_todoBackEnd->removeAllCompleted();
}
QBitArray OTodoAccess::backendSupport( const QString& ) const{
return m_todoBackEnd->supports();
}
bool OTodoAccess::backendSupports( int attr, const QString& ar) const{
return backendSupport(ar).testBit( attr );
}
+
+}
diff --git a/libopie2/opiepim/core/otodoaccess.h b/libopie2/opiepim/core/otodoaccess.h
index 916923f..e13d277 100644
--- a/libopie2/opiepim/core/otodoaccess.h
+++ b/libopie2/opiepim/core/otodoaccess.h
@@ -1,22 +1,51 @@
+/*
+ This file is part of the Opie Project
+ Copyright (C) The Main Author <main-author@whereever.org>
+ =. 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.
+*/
#ifndef OPIE_TODO_ACCESS_H
#define OPIE_TODO_ACCESS_H
#include <qobject.h>
#include <qvaluelist.h>
-#include "otodo.h"
-#include "otodoaccessbackend.h"
-#include "opimaccesstemplate.h"
+#include <opie2/otodo.h>
+#include <opie2/otodoaccessbackend.h>
+#include <opie2/opimaccesstemplate.h>
+namespace Opie {
/**
* OTodoAccess
* the class to get access to
* the todolist
*/
class OTodoAccess : public QObject, public OPimAccessTemplate<OTodo> {
Q_OBJECT
public:
enum SortOrder { Completed = 0,
Priority,
Description,
@@ -93,13 +122,15 @@ signals:
*/
void changed( const OTodoAccess* );
void changed( const OTodoAccess*, int uid );
void added( const OTodoAccess*, int uid );
void removed( const OTodoAccess*, int uid );
private:
int m_cat;
OTodoAccessBackend* m_todoBackEnd;
class OTodoAccessPrivate;
OTodoAccessPrivate* d;
};
+}
+
#endif