You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kshowmail/kshowmail/kshowmailview.h

158 lines
5.0 KiB

/***************************************************************************
kshowmailview.h - description
-------------------
begin : Sat May 6 12:13:57 MEST 2000
copyright : (C) 2000-2001 by Eggert Ehmke
email : eggert.ehmke@berlin.de
26 Sep 2002 - Allow for columns to be hidden. Allistar Melville
***************************************************************************/
/***************************************************************************
* *
* 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 KSHOWMAILVIEW_H
#define KSHOWMAILVIEW_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
//Qt headers
#include <qwidget.h>
#include <qsplitter.h>
#include <qcursor.h>
#include <qpopupmenu.h>
//KDE headers
#include <klistview.h>
#include <kconfig.h>
#include <kapplication.h>
//KShowmail headers
#include "configlist.h"
#include "showlistviewitem.h"
class ConfigList;
class KshowmailDoc;
/** The KshowmailView class provides the view widget for the KShowMailApp instance.
* The View instance inherits QWidget as a base class and represents the view object of a KMainWindow.
* As KshowmailView is part of the document-view model, it needs a reference to the document object
* connected with it by the KShowMailApp class to manipulate and display
* the document structure provided by the KshowmailDoc class.
*
* @author Source Framework Automatically Generated by KDevelop, (c) The KDevelop Team.
* @author Ulrich Weigelt <ulrich.weigelt@gmx.de>
* @version KDevelop version 0.4 code generation
*/
class KshowmailView : public QSplitter
{
Q_OBJECT
public:
/**
* Constructor for the main view
*/
KshowmailView(QWidget *parent = 0, const char *name=0);
/**
* Destructor for the main view
*/
~KshowmailView();
/**
* Saves the options
*/
void saveOptions( KConfig* config );
/**
* Clears the mail list view.
*/
void clearMailListView();
/**
* Creates a mail list view item with the given content and
* inserts it into the mail list view.
* @param number mail number
* @param account account name
* @param from sender of the mail
* @param to recipient of the mail
* @param subject mail subject
* @param date date on which the mail was sent, formated to the current locale's conventions.
* @param size size of the mail
* @param content content type
* @param state new or old
* @param time send date, formated to the ISO 8601 extended specification (YYYY-MM-DDTHH:MM:SS)
* @return pointer to the created list view item
*/
ShowListViewItem* insertMail( QString& number, QString& account, QString& from, QString& to, QString& subject, QString& date, QString& size, QString& content, QString& state, QString& time );
/**
* Refreshes the geometry.
* Reads from the config file the properties about show or hide columns.
* If a shown column should be hidden, the current width will be saved and the column will be hidden.
* If a hidden column should be shown, it will be set to the old saved width.
*/
void refreshSetup();
KListView* m_pListAccounts;
KListView* m_pListMessages;
private:
QPixmap* m_pixOk;
/**
* Connector to the configuration file
*/
KConfig* config;
/**
* Reads the some geometry options from the application config file.
*/
void readOptions();
private slots:
/**
* Connected with signal rightButtonClicked of m_pListMessages.
* Invoked, when the user has clicked on a list item with the right mouse button.
* Selects the clicked item and shows the popup menu mail_context_popup defined in
* kshowmailui.rc.
*/
void slotMessageContext( QListViewItem*, const QPoint&, int );
void slotMessageDoubleClicked (QListViewItem*);
void slotMessageClicked (QListViewItem*);
/**
* Connected with signal rightButtonClicked of m_pListAccounts.
* Invoked, when the user has clicked on a list item with the right mouse button.
* Selects the clicked item and shows the popup menu account_context_popup defined in
* kshowmailui.rc.
*/
void slotAccountContext( QListViewItem*, const QPoint &, int );
/**
* Connected with signal clicked of the account list.
* Activate or deactivate the account, if the user has clicked in the first column
*/
void slotAccountClicked( QListViewItem*, const QPoint& point, int col );
signals:
void signalActiveChanged ();
};
#endif // KSHOWMAILVIEW_H