qtmobility/examples/keepintouch/addressfinder.h
changeset 1 2b40d63a9c3d
child 5 453da2cfceef
equal deleted inserted replaced
0:cfcbf08528c4 1:2b40d63a9c3d
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
       
     6 **
       
     7 ** This file is part of the Qt Mobility Components.
       
     8 **
       
     9 ** $QT_BEGIN_LICENSE:LGPL$
       
    10 ** No Commercial Usage
       
    11 ** This file contains pre-release code and may not be distributed.
       
    12 ** You may use this file in accordance with the terms and conditions
       
    13 ** contained in the Technology Preview License Agreement accompanying
       
    14 ** this package.
       
    15 **
       
    16 ** GNU Lesser General Public License Usage
       
    17 ** Alternatively, this file may be used under the terms of the GNU Lesser
       
    18 ** General Public License version 2.1 as published by the Free Software
       
    19 ** Foundation and appearing in the file LICENSE.LGPL included in the
       
    20 ** packaging of this file.  Please review the following information to
       
    21 ** ensure the GNU Lesser General Public License version 2.1 requirements
       
    22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    23 **
       
    24 ** In addition, as a special exception, Nokia gives you certain additional
       
    25 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    27 **
       
    28 ** If you have questions regarding the use of this file, please contact
       
    29 ** Nokia at qt-info@nokia.com.
       
    30 **
       
    31 **
       
    32 **
       
    33 **
       
    34 **
       
    35 **
       
    36 **
       
    37 **
       
    38 ** $QT_END_LICENSE$
       
    39 **
       
    40 ****************************************************************************/
       
    41 #ifndef ADDRESSFINDER_H
       
    42 #define ADDRESSFINDER_H
       
    43 
       
    44 #include "qtmessaging.h"
       
    45 
       
    46 #include <QMap>
       
    47 #include <QObject>
       
    48 #include <QPair>
       
    49 #include <QSet>
       
    50 #include <QWidget>
       
    51 #include <QMainWindow>
       
    52 
       
    53 QT_BEGIN_NAMESPACE
       
    54 class QCheckBox;
       
    55 class QComboBox;
       
    56 class QListWidget;
       
    57 class QPushButton;
       
    58 class QTabWidget;
       
    59 QT_END_NAMESPACE
       
    60 
       
    61 #if !defined(Q_OS_WIN) || !defined(_WIN32_WCE)
       
    62 // Don't use a 'Search' Button in CE
       
    63 #define USE_SEARCH_BUTTON
       
    64 #endif
       
    65 
       
    66 QTM_USE_NAMESPACE
       
    67 
       
    68 class AddressFinder : public QMainWindow
       
    69 {
       
    70     Q_OBJECT
       
    71 
       
    72 public:
       
    73     AddressFinder(QWidget *parent = 0, Qt::WindowFlags flags = 0);
       
    74     ~AddressFinder();
       
    75 
       
    76 private slots:
       
    77     void includePeriodChanged(int);
       
    78     void excludePeriodEnabled(int);
       
    79     void addressSelected(const QString&);
       
    80     void searchMessages();
       
    81     void stateChanged(QMessageService::State a);
       
    82     void messagesFound(const QMessageIdList &ids);
       
    83     void continueSearch();
       
    84 #ifndef USE_SEARCH_BUTTON
       
    85     void tabChanged(int index);
       
    86 #endif
       
    87     void messageIndexChanged(int index);
       
    88     void showMessage();
       
    89     void forwardMessage();
       
    90 
       
    91 private:
       
    92     void setupUi();
       
    93     void setSearchActionEnabled(bool val);
       
    94 
       
    95 private:
       
    96     QTabWidget *tabWidget;
       
    97     QComboBox *includePeriod;
       
    98     QComboBox *excludePeriod;
       
    99     QCheckBox *excludeCheckBox;
       
   100 
       
   101     QAction *searchAction;
       
   102     QPushButton *searchButton;
       
   103 
       
   104     QListWidget *contactList;
       
   105     QComboBox *messageCombo;
       
   106     QPushButton *showButton;
       
   107     QPushButton *forwardButton;
       
   108 
       
   109     QMessageService service;
       
   110 
       
   111     QMessageFilter inclusionFilter;
       
   112 
       
   113     QMessageIdList inclusionMessages;
       
   114     QMessageIdList exclusionMessages;
       
   115 
       
   116     QSet<QString> excludedAddresses;
       
   117     
       
   118     QStringList addressList;
       
   119     QMap<QString, QList<QPair<QString, QMessageId> > > addressMessages;
       
   120 };
       
   121 
       
   122 #endif