| 31 |      1 | /*
 | 
|  |      2 |  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
 | 
|  |      3 |  * All rights reserved.
 | 
|  |      4 |  * This component and the accompanying materials are made available
 | 
|  |      5 |  * under the terms of "Eclipse Public License v1.0"
 | 
|  |      6 |  * which accompanies this distribution, and is available
 | 
|  |      7 |  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
 | 
|  |      8 |  *
 | 
|  |      9 |  * Initial Contributors:
 | 
|  |     10 |  * Nokia Corporation - initial contribution.
 | 
|  |     11 |  *
 | 
|  |     12 |  * Contributors:
 | 
|  |     13 |  * 
 | 
|  |     14 |  * Description: Message Application service interface used for interfacing between
 | 
|  |     15 |  *              QT highway and other applications
 | 
|  |     16 |  *
 | 
|  |     17 |  */
 | 
|  |     18 | 
 | 
|  |     19 | #ifndef MSGSERVICEINTERFACE_H_
 | 
|  |     20 | #define MSGSERVICEINTERFACE_H_
 | 
|  |     21 | 
 | 
|  |     22 | // INCLUDES
 | 
|  |     23 | #include <xqserviceprovider.h>
 | 
|  |     24 | #include <qvariant.h>
 | 
|  |     25 | 
 | 
|  |     26 | //TODO: to be deprecated
 | 
|  |     27 | #include <QStringList>
 | 
|  |     28 | class ConvergedMessageAddress;
 | 
|  |     29 | 
 | 
|  |     30 | struct ContactDetail
 | 
|  |     31 | {
 | 
|  |     32 | public:
 | 
|  |     33 |     /**
 | 
|  |     34 |      * Constructor
 | 
|  |     35 |      */
 | 
|  |     36 |     ContactDetail():contactId(-1),displayName(QString()){};
 | 
|  |     37 |     
 | 
|  |     38 | public:
 | 
|  |     39 |     int contactId;
 | 
|  |     40 |     QString displayName;
 | 
|  |     41 |     QStringList addressList;
 | 
|  |     42 | };
 | 
|  |     43 | 
 | 
|  |     44 | class MsgViewManager;
 | 
|  |     45 | class MsgServiceInterface : public XQServiceProvider
 | 
|  |     46 |     {
 | 
|  |     47 |     Q_OBJECT
 | 
|  |     48 |     
 | 
|  |     49 | public:
 | 
|  |     50 |     /*
 | 
|  |     51 |      * Constructor
 | 
|  |     52 |      */
 | 
|  |     53 |     MsgServiceInterface(QObject* parent=0, MsgViewManager* manager =0);
 | 
|  |     54 |     
 | 
|  |     55 |     /*
 | 
|  |     56 |      * Destructor
 | 
|  |     57 |      */
 | 
|  |     58 |     ~MsgServiceInterface();
 | 
|  |     59 |     
 | 
|  |     60 | public slots:
 | 
|  |     61 |     
 | 
|  |     62 |     /**
 | 
|  |     63 |      * send called from phone book.
 | 
|  |     64 |      */
 | 
|  |     65 |     void send(const QString phoneNumber, const qint32 contactId, const QString displayName);
 | 
|  |     66 |     
 | 
|  |     67 |     /**
 | 
|  |     68 |      * called from indications.
 | 
|  |     69 |      */
 | 
|  |     70 |     void open(qint64 conversationId);
 | 
|  |     71 |     
 | 
|  |     72 |     /**
 | 
|  |     73 |      * called from send UI.
 | 
|  |     74 |      */
 | 
|  |     75 |     void send(QVariant data);
 | 
|  |     76 |     
 | 
|  |     77 |      /**
 | 
|  |     78 |      * Opens the viewer to view the message.
 | 
|  |     79 |      * @param msgId message id of the message.
 | 
|  |     80 |      */
 | 
|  |     81 |     void view(int msgId);
 | 
|  |     82 |     
 | 
|  |     83 |     /**
 | 
|  |     84 |      * depricated api. will be removed in future.
 | 
|  |     85 |      */
 | 
|  |     86 |     void openConversationView(QString number, QString name);
 | 
|  |     87 | 
 | 
|  |     88 |     /**
 | 
|  |     89 |      * send called with prepopulated message body.
 | 
|  |     90 |      */
 | 
|  |     91 |     void send(const QString phoneNumber, const QString alias, const QString bodyText);
 | 
|  |     92 | 
 | 
|  |     93 | signals:
 | 
|  |     94 | 
 | 
|  |     95 | private:
 | 
|  |     96 |     //TODO: to be deprecated
 | 
|  |     97 |     bool resolveContact(const ConvergedMessageAddress &address,
 | 
|  |     98 |             ContactDetail &contactDetail);
 | 
|  |     99 |  
 | 
|  |    100 | private:
 | 
|  |    101 | MsgViewManager* mViewManager;
 | 
|  |    102 |     
 | 
|  |    103 |     };
 | 
|  |    104 | 
 | 
|  |    105 | 
 | 
|  |    106 | #endif /* MsgServiceInterface_H_ */
 |