summaryrefslogtreecommitdiffstats
path: root/kshowmail/kshowmailview.h
blob: bf12c46e54b68fcd14ea23c9935873c7eb87534b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
/***************************************************************************
                          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

//TQt headers
#include <tqwidget.h>
#include <tqsplitter.h>
#include <tqcursor.h>
#include <tqpopupmenu.h>

//KDE headers
#include <tdelistview.h>
#include <tdeconfig.h>
#include <tdeapplication.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 TQWidget as a base class and represents the view object of a TDEMainWindow.
 * 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 TQSplitter
{
  Q_OBJECT

  public:

    /**
     * Constructor for the main view
     */
    KshowmailView(TQWidget *parent = 0, const char *name=0);


    /**
     * Destructor for the main view
     */
    ~KshowmailView();

    /**
     * Saves the options
     */
    void saveOptions( TDEConfig* 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( TQString& number, TQString& account, TQString& from, TQString& to, TQString& subject, TQString& date, TQString& size, TQString& content, TQString& state, TQString& 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();

    TDEListView* m_pListAccounts;
    TDEListView* m_pListMessages;

  private:

    TQPixmap* m_pixOk;

    /**
     * Connector to the configuration file
     */
    TDEConfig* 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( TQListViewItem*, const TQPoint&, int );

	void slotMessageDoubleClicked (TQListViewItem*);
	void slotMessageClicked (TQListViewItem*);

  /**
   * 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( TQListViewItem*, const TQPoint &, 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( TQListViewItem*, const TQPoint& point, int col );

signals:
	void signalActiveChanged ();
};

#endif // KSHOWMAILVIEW_H