summaryrefslogtreecommitdiffstats
path: root/kshowmail/kcmconfigs/senderlistdialog.h
blob: 87a0c37b91be1284fa4eaf57063c1ca238ef5897 (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
//
// C++ Interface: senderlistdialog
//
// Description:
//
//
// Author: Ulrich Weigelt <ulrich.weigelt@gmx.de>, (C) 2007
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef SENDERLISTDIALOG_H
#define SENDERLISTDIALOG_H

//TQt headers
#include <tqlayout.h>
#include <tqtooltip.h>
#include <tqradiobutton.h>
#include <tqbuttongroup.h>
#include <tqpushbutton.h>

//KDE headers
#include <kdialogbase.h>
#include <tdeapplication.h>
#include <keditlistbox.h>
#include <tdelocale.h>
#include <klineedit.h>
#include <tdeconfig.h>

//KShowmail headers
#include "../constants.h"

//Button IDs
#define ID_BUTTON_FILTER_SENDERLIST_DELETE 1
#define ID_BUTTON_FILTER_SENDERLIST_MARK   2

/**
 * @brief This is a dialog to edit the blacklist and whitelist. It is used by the class ConfigFilter.
 * @author Ulrich Weigelt <ulrich.weigelt@gmx.de>
 */
class SenderListDialog : public KDialogBase
{

  Q_OBJECT

  public:

    /**
     * Type of list.
     */
    enum ListType { Black, White };

    /**
     * Constructor
     * @param parent parent widget
     * @param list list which shall be opened
     * @param name widget name
     */
    SenderListDialog( TQWidget *parent = 0, ListType list = Black, const char *name = 0 );

    /**
     * Destructor
     */
    ~SenderListDialog();

  private:

    /**
     * list which shall be opened
     */
    ListType list;

    /**
     * Application Config Object
     */
    TDEConfig* config;

    /**
     * Edit Frame
     */
    KEditListBox* editFrame;

    /**
     * Combines the action radio buttons for the blacklist.
     */
    TQButtonGroup* grpAction;

    /**
     * Reads the entries for the dialog from the config file fill them in it.
     */
    void fillDialog();

  private slots:

    /**
     * Connected with add button of the edit frame.
     * Sorts the content of the list box.
     */
    void slotSort();

    /**
     * Overwritten method of KDialogBase.
     * Called if OK was clicked.
     * Stores the entered values.
     * After then it invokes slotOk() of KDialogBase.
     */
    void slotOk();


};

#endif