kitchensync

helper.h

00001 /*
00002     This file is part of KitchenSync.
00003 
00004     Copyright (c) 2002,2003 Holger Freyther <freyther@kde.org>
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019     Boston, MA 02110-1301, USA.
00020 */
00021 #ifndef OpieHelperBase_H
00022 #define OpieHelperBase_H
00023 
00024 #include <sys/types.h>
00025 #include <stdlib.h>
00026 #include <time.h>
00027 
00028 #include <qdatetime.h>
00029 #include <qstring.h>
00030 #include <qstringlist.h>
00031 #include <qvaluelist.h>
00032 
00033 #include <ktempfile.h>
00034 
00035 #include <kontainer.h>
00036 #include <syncer.h>
00037 
00038 #include <idhelper.h>
00039 
00040 #include "extramap.h"
00041 #include "categoryedit.h"
00042 
00043 namespace OpieHelper {
00044     class Device;
00045     class Base {
00046     public:
00047         Base( CategoryEdit* edit =0,
00048               KSync::KonnectorUIDHelper* helper = 0,
00049               const QString &tz = QString::null,
00050               Device* d = 0);
00051         virtual ~Base();
00052     protected:
00053         // from tt GPLed
00054         time_t toUTC( const QDateTime& dt );
00055         QDateTime fromUTC( time_t time );
00056         // off tt code
00057 
00059         KTempFile* file();
00060 
00062         int newId();
00063 
00064         CategoryEdit* edit() { return m_edit; };
00065         KSync::KonnectorUIDHelper* helper() { return m_helper; };
00066 
00067     QString appendText(const QString& text, const QString& def);
00068 
00069         // returns a ; separated list of real ids
00070         // will also add the value m_kde2opie
00071         QString categoriesToNumber( const QStringList &categories,
00072                                     const QString &app= QString::null );
00073         // convience method
00074         QString konnectorId( const QString &appName,  const QString &uid );
00075         QString kdeId( const QString &appName, const QString &uid );
00076 
00077     const Device* device();
00078 
00079     CategoryEdit *m_edit;
00080         KSync::KonnectorUIDHelper *m_helper;
00081         Kontainer::ValueList m_kde2opie;
00082         QString m_tz;
00083     private:
00084         Device* m_device;
00085         class BasePrivate;
00086         BasePrivate *baseD;
00087     };
00088 
00090     QString escape(const QString&);
00091 
00092 }
00093 
00094 
00095 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys