Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ocontactaccess.h

Go to the documentation of this file.
00001 /*
00002                              This file is part of the Opie Project
00003                              Copyright (C) The Main Author <main-author@whereever.org>
00004               =.             Copyright (C) The Opie Team <opie-devel@handhelds.org>
00005             .=l.
00006            .>+-=
00007  _;:,     .>    :=|.         This program is free software; you can
00008 .> <`_,   >  .   <=          redistribute it and/or  modify it under
00009 :`=1 )Y*s>-.--   :           the terms of the GNU Library General Public
00010 .="- .-=="i,     .._         License as published by the Free Software
00011  - .   .-<_>     .<>         Foundation; either version 2 of the License,
00012      ._= =}       :          or (at your option) any later version.
00013     .%`+i>       _;_.
00014     .i_,=:_.      -<s.       This program is distributed in the hope that
00015      +  .  -:.       =       it will be useful,  but WITHOUT ANY WARRANTY;
00016     : ..    .:,     . . .    without even the implied warranty of
00017     =_        +     =;=|`    MERCHANTABILITY or FITNESS FOR A
00018   _.=:.       :    :=>`:     PARTICULAR PURPOSE. See the GNU
00019 ..}^=.=       =       ;      Library General Public License for more
00020 ++=   -.     .`     .:       details.
00021  :     =  ...= . :.=-
00022  -.   .:....=;==+<;          You should have received a copy of the GNU
00023   -_. . .   )=.  =           Library General Public License along with
00024     --        :-=`           this library; see the file COPYING.LIB.
00025                              If not, write to the Free Software Foundation,
00026                              Inc., 59 Temple Place - Suite 330,
00027                              Boston, MA 02111-1307, USA.
00028 */
00029 /*
00030  * =====================================================================
00031  * ToDo: Define enum for query settings
00032  * =====================================================================
00033  */
00034 #ifndef _OCONTACTACCESS_H
00035 #define _OCONTACTACCESS_H
00036 
00037 #include <qobject.h>
00038 
00039 #include <qpe/qcopenvelope_qws.h>
00040 
00041 #include <qvaluelist.h>
00042 #include <qfileinfo.h>
00043 
00044 #include <opie2/opimcontact.h>
00045 #include <opie2/ocontactaccessbackend.h>
00046 #include <opie2/opimaccesstemplate.h>
00047 
00048 namespace Opie {
00058 class OPimContactAccess: public QObject, public OPimAccessTemplate<OPimContact>
00059 {
00060     Q_OBJECT
00061 
00062  public:
00067     enum SortFilter {
00069         DoNotShowWithoutChildren        = FilterCustom<<1,
00071         DoNotShowWithoutAnniversary     = FilterCustom<<2,
00073         DoNotShowWithoutBirthday        = FilterCustom<<3,
00075         DoNotShowWithoutHomeAddress     = FilterCustom<<4,
00077         DoNotShowWithoutBusinessAddress = FilterCustom<<5,
00079         DoNotShowWithCategory = FilterCustom << 6
00080     };
00081 
00086     enum SortOrder {
00087         SortTitle = SortCustom,
00088         SortFirstName,
00089         SortMiddleName,
00090                 SortLastName,
00091         SortSuffix,
00092         SortEmail,
00093         SortNickname,
00094         SortFileAsName,
00095         SortAnniversary,
00096         SortBirthday,
00097         SortGender,
00098         SortBirthdayWithoutYear,
00099         SortAnniversaryWithoutYear
00100     };
00101 
00116         OPimContactAccess (const QString appname, const QString filename = 0l,
00117                            OPimContactAccessBackend* backend = 0l, bool handlesync = true);
00118         ~OPimContactAccess ();
00119 
00120 
00125         bool wasChangedExternally()const;
00126 
00127 
00132         bool save();
00133 
00137         int rtti() const;
00138 
00139  signals:
00140         /* Signal is emitted if the database was changed. Therefore
00141          * we may need to reload to stay consistent.
00142          * @param which Pointer to the database who created this event. This pointer
00143          * is useful if an application has to handle multiple databases at the same time.
00144          * @see reload()
00145          */
00146         void signalChanged ( const OPimContactAccess *which );
00147 
00148 
00149  private:
00150         OPimContactAccessBackend *m_backEnd;
00151         bool m_loading:1;
00152 
00153  private slots:
00154         void copMessage( const QCString &msg, const QByteArray &data );
00155 
00156  private:
00157         class Private;
00158         Private *d;
00159 
00160 };
00161 
00162 }
00163 
00164 #endif

Generated on Sat Nov 5 16:16:18 2005 for OPIE by  doxygen 1.4.2