summaryrefslogtreecommitdiffstats
path: root/kshowmail/serverdialog.h
blob: 8db7fff5f59d98f20cb6666657eef3f89eb82413 (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
158
159
160
161
162
163
164
165
166
167
168
/***************************************************************************
                          serverdialog.h  -  description
                             -------------------
    begin                : Sun Oct 28 2001
    copyright            : (C) 2001 by Eggert Ehmke
    email                : eggert.ehmke@berlin.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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 SERVERDIALOG_H
#define SERVERDIALOG_H

//TQt headers
#include <ntqlayout.h>
#include <ntqlabel.h>
#include <ntqtooltip.h>
#include <ntqspinbox.h>
#include <ntqgroupbox.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqcheckbox.h>

//KDE headers
#include <kdialogbase.h>
#include <tdelocale.h>
#include <klineedit.h>
#include <kcombobox.h>
#include <kdebug.h>
#include <tdemessagebox.h>
#include <kpassdlg.h>

//KShowmail headers
#include "configelem.h"
#include "constants.h"
#include "encryption.h"
#include "tdewalletaccess.h"
#include <ktabwidget.h>

//radio button IDs
#define ID_BUTTON_PASSWORD_DONT_SAVE 1
#define ID_BUTTON_PASSWORD_SAVE_FILE 2
#define ID_BUTTON_PASSWORD_SAVE_TDEWALLET 3
#define ID_BUTTON_SECLOGIN_NONE 1
#define ID_BUTTON_SECLOGIN_APOP 2
#define ID_BUTTON_SECLOGIN_SASL 3
#define ID_BUTTON_SECTRANSFER_NONE 1
#define ID_BUTTON_SECTRANSFER_SSL 2
#define ID_BUTTON_SECTRANSFER_TLS 3

/**
 * @brief Dialog to edit account options. You can not create a new account or edit the account name.
 * @author Eggert Ehmke
 * @author Ulrich Weigelt <ulrich.weigelt@gmx.de>
 */

class ServerDialog : public KDialogBase
{
   Q_OBJECT
  public:

  public:

    /**
     * General constructor
     * @param parent parent of the dialog
     * @param item account to setup
     */
    ServerDialog( TQWidget* parent, ConfigElem* item = NULL );

    /**
     * Destructor
     */
    ~ServerDialog();

  private:

    /**
     * account to setup
     */
    ConfigElem* account;

    /**
     * Edit line which contains the unique account name.
     */
    KLineEdit* txtAccount;

    /**
     * Edit line which contains the server name.
     */
    KLineEdit* txtServer;

    /**
     * Combo box to choose the protocol.
     */
    KComboBox* cboProtocol;

    /**
     * Spinbox to choose the tcp port.
     */
    TQSpinBox* spbPort;

    /**
     * Edit line which contains the user name.
     */
    KLineEdit* txtUser;

    /**
     * Edit line which contains the password.
     */
    KPasswordEdit* txtPassword;

    /**
     * Check box to select whether the account is active or not.
     */
    TQCheckBox* chkActive;

    /**
     * Combines the radio buttons of password storage.
     */
    TQButtonGroup* grpPasswordStorage;

    /**
     * Combines the radio buttons of secure transfer.
     */
    TQButtonGroup* grpSecureTransfer;

  protected slots:

    /**
   * Connected with the password button group.
   * Enabled or disabled the password edit line.
   * @param id button identifier
     */
    void slotPasswordStorageChanged( int id );

    /**
     * Connected with the secure transfer button group.
     * Changes the port number.
     * @param id button identifier
     */
    void slotSecureTransferChanged( int id );

    /**
     * Overwritten methode of KDialogBase.
     * Called if OK was clicked.
     * Stores the entered values into the given account item.
     * If no item was given, it creates a new one.
     * After then it invokes slotOk() of KDialogBase.
     */
    void slotOk();

  protected:

    /**
   * Writes the values of the account into the dialog items.
     */
    void fillDialog();
};

#endif