Logo Search packages:      
Sourcecode: kmess version File versions

chathistorydialog.h

 /***************************************************************************
                          chathistorydialog.h  -  chat logs browser
                             -------------------
    begin                : Sun Feb 22 2009
    copyright            : (C) 2009 by Dario Freddi
    email                : drf54321@gmail.com
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef CHATHISTORYDIALOG_H
#define CHATHISTORYDIALOG_H

#include <KDialog>

#include "ui_chathistorydialog.h"


// Forward declarations
class ChatMessageView;
class QSortFilterProxyModel;
class QStandardItemModel;



class ChatHistoryDialog : public KDialog, private Ui::historyDialog
{
  Q_OBJECT

  public:
    // Constructor
                           ChatHistoryDialog( QWidget *parent = 0 );
    // Destructor
    virtual               ~ChatHistoryDialog();
    // Set the contact for whom the logs will be initially shown
    void                   setContact( const QString &handle );

    void                   migrateOldLogs();

  private:
    // Load the list of contacts for which logs are available
    void                   loadContactsList();
    // Load the list of conversation for the selected contact
    void                   loadConversationList();

  private slots:
    // Reload the current chat log history
    void                   reloadLogs();
    // Caches the XML for the selected contact. Makes things a lot faster
    void                   cacheContactXml(const QModelIndex &index);

  private:
    // View used to show the chat logs
    ChatMessageView       *chatView_;
    // Model for the list of contacts
    QStandardItemModel    *model_;
    // Filter for the list of contacts
    QSortFilterProxyModel *proxyModel_;
    // Cache to store a contact's entire chat history
    QByteArray             xml_;
};



#endif /* CHATHISTORYDIALOG_H */

Generated by  Doxygen 1.6.0   Back to index