messagingapp/msgappfw/msghistory/inc/msghistoryimpl.h
changeset 23 238255e8b033
equal deleted inserted replaced
5:4697dfb2d7ad 23:238255e8b033
       
     1 /*
       
     2  * Copyright (c) 2007 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:  Object for message history implementation.
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef __MSG_HISTORY_IMPL_H__
       
    19 #define __MSG_HISTORY_IMPL_H__
       
    20 
       
    21 #include <QObject>
       
    22 
       
    23 //FORWARD DECLARATIONS
       
    24 class MsgItem;
       
    25 class MsgHistoryPrivate;
       
    26 class MsgHistory;
       
    27 
       
    28 class MsgHistoryImpl : public QObject
       
    29     {
       
    30     Q_OBJECT
       
    31     
       
    32 public:    
       
    33     /*
       
    34      * constructor
       
    35      */
       
    36     explicit MsgHistoryImpl(QObject* parent = 0);
       
    37     
       
    38     /*
       
    39      * destructor
       
    40      */
       
    41     virtual ~MsgHistoryImpl();
       
    42     
       
    43 public:    
       
    44     /*
       
    45      * get all messages
       
    46      * @param contactId, contact id
       
    47      */
       
    48     bool getMessages(int contactId);
       
    49 
       
    50     /*
       
    51      * clear all messages
       
    52      * @param contactId, contact id
       
    53      */        
       
    54     bool clearMessages(int contactId);
       
    55 
       
    56     /*
       
    57      * mark message as read
       
    58      * @param contactId, contact id
       
    59      */
       
    60     bool markRead(int contactId);
       
    61 
       
    62     /*
       
    63      * subscribe for messages
       
    64      * @param contactId, contact id
       
    65      */
       
    66     bool subscribe(int contactId);
       
    67 
       
    68     /*
       
    69      * unsubscribe for messages
       
    70      * @param contactId, contact id
       
    71      */
       
    72     bool unSubscribe(int contactId);
       
    73   
       
    74 signals:    
       
    75    
       
    76    /*
       
    77     * messagesReady
       
    78     * @param msgs, list of messages
       
    79     */
       
    80    void messagesReady(QList<MsgItem>& msgs);
       
    81    
       
    82    /*
       
    83     * message Added
       
    84     * @param msg, MsgItem
       
    85     */
       
    86    void messageAdded(MsgItem& msg);
       
    87    
       
    88    /*
       
    89     * message Changed
       
    90     * @param msg, MsgItem
       
    91     */
       
    92    void messageChanged(MsgItem& msg);
       
    93    
       
    94    /*
       
    95     * message Deleted
       
    96     * @param msg, MsgItem
       
    97     */
       
    98    void messageDeleted(MsgItem& msg);
       
    99 
       
   100 
       
   101 public: 
       
   102    
       
   103    /*
       
   104     * messagesReadyEvent
       
   105     * emits messagesReady signal
       
   106     * @param msgs, list of messages
       
   107     */     
       
   108     void messagesReadyEvent(QList<MsgItem>& msgs);
       
   109     
       
   110     /*
       
   111      * messageAddedEvent
       
   112      * emits messageAdded signal
       
   113      * @param msg, MsgItem
       
   114      */
       
   115     void messageAddedEvent(MsgItem& msg);
       
   116     
       
   117     /*
       
   118      * messageChangedEvent
       
   119      * emits messageChanged signal
       
   120      * @param msg, MsgItem
       
   121      */
       
   122     void messageChangedEvent(MsgItem& msg);
       
   123     
       
   124     /*
       
   125      * messageDeletedEvent
       
   126      * emits messageDeleted signal
       
   127      * @param msg, MsgItem
       
   128      */
       
   129     void messageDeletedEvent(MsgItem& msg);
       
   130   
       
   131     
       
   132 private:
       
   133         
       
   134     /*
       
   135      * Private implementation
       
   136      * Own
       
   137      */
       
   138     MsgHistoryPrivate* d_ptr;
       
   139     };
       
   140 
       
   141 #endif // __MSG_HISTORY_IMPL_H__