-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAxMenuConfigMailBox.h
227 lines (194 loc) · 8.93 KB
/
AxMenuConfigMailBox.h
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
#ifndef __AxMenuConfigMailBox_H__
#define __AxMenuConfigMailBox_H__
//=============================================================================
/*
* See the file README in the main directory for a description of
* this software, copyright information, and how to reach the author.
*
* Author: alex
* Date: 17.11.2003
*
* Last modfied:
* $Author: alex $
* $Date: 2013-11-02 09:26:18 +0100 (Sa, 02 Nov 2013) $
*/
//=============================================================================
//=============================================================================
// includes
//=============================================================================
//----- qt --------------------------------------------------------------------
//----- CORBA -----------------------------------------------------------------
//----- C++ -------------------------------------------------------------------
//----- C ---------------------------------------------------------------------
//----- vdr -------------------------------------------------------------------
#include <vdr/osd.h>
//----- AxLib -----------------------------------------------------------------
#include <Ax/Mail/MailBoxSetup.h>
#include <Ax/Vdr/OsdMenu.h>
//----- local -----------------------------------------------------------------
//----- other includes --------------------------------------------------------
//=============================================================================
// forward declarations
//=============================================================================
class AxPluginMailBox;
class AxPluginSetup;
//=============================================================================
// class AxMenuConfigMailBox
//=============================================================================
/** Menu to setup one mail account
*/
class AxMenuConfigMailBox : public Ax::Vdr::OsdMenu
{
//-------------------------------------------------------------------------
// typedefs
//-------------------------------------------------------------------------
typedef Ax::Vdr::OsdMenu PARENT;
typedef AxMenuConfigMailBox MYSELF;
protected:
//-------------------------------------------------------------------------
// enums
//-------------------------------------------------------------------------
enum AxEAction
{
A_FIRST = PARENT::A_LAST
, A_SAVE_AND_CLOSE = A_FIRST ///< save the current settings and close
, A_CHECK_ACCOUNT ///< check if the current config is accessible
, A_SELECT_FOLDER ///< open the menu to select a folder
, A_SHOW_LOG ///< show the log
, A_LAST
};
public:
//-------------------------------------------------------------------------
// AxMenuConfigMailBox()
//-------------------------------------------------------------------------
/** Constructor
*/
AxMenuConfigMailBox(AxPluginMailBox *thePlugin, Ax::Mail::MailBoxSetup &theMailBoxSetup);
//-------------------------------------------------------------------------
// ~AxMenuConfigMailBox()
//-------------------------------------------------------------------------
/** Destructor
*/
virtual ~AxMenuConfigMailBox();
//-------------------------------------------------------------------------
// MenuKind()
//-------------------------------------------------------------------------
virtual const char* MenuKind() { return "MenuMailboxConfig"; }
//-------------------------------------------------------------------------
// ProcessKey()
//-------------------------------------------------------------------------
/** Process key stroke: create appropriate osditems if
* if relevant settings were changed
*/
virtual eOSState ProcessKey(eKeys Key);
//-------------------------------------------------------------------------
// processAction()
//-------------------------------------------------------------------------
/** Process the given action
*/
virtual eOSState processAction(const Ax::Vdr::Action &theAction, eOSState = osUnknown);
protected:
//-------------------------------------------------------------------------
// informSubOSDClosed()
//-------------------------------------------------------------------------
virtual void informSubOSDClosed(const Ax::Vdr::Action &theAction, eKeys theKey);
//-------------------------------------------------------------------------
// informCurrentChanged()
//-------------------------------------------------------------------------
virtual void informCurrentChanged(int theOldCurrent);
private:
//-------------------------------------------------------------------------
// checkAccount()
//-------------------------------------------------------------------------
/** check if the current settings represent a selectable mail account
*
* @returns true if the current settings represent a usable mailbox
*/
bool checkAccount();
//-------------------------------------------------------------------------
// showLog()
//-------------------------------------------------------------------------
/** Show logs of c-client library
*/
eOSState showLog();
//-------------------------------------------------------------------------
// selectFolder()
//-------------------------------------------------------------------------
/** Open a sub-dialog to select a folder
*/
eOSState selectFolder();
//-------------------------------------------------------------------------
// setupItems()
//-------------------------------------------------------------------------
/** Create configuration items when osd is created and if some
* configuration options are changed which affect the number/type of
* possible options.
*/
void setupItems();
//-------------------------------------------------------------------------
// showMailBoxStr()
//-------------------------------------------------------------------------
/** Show the mailbox-string according to the current settings
*/
void showMailBoxStr();
//-------------------------------------------------------------------------
// convSetup2Dlg()
//-------------------------------------------------------------------------
/** convert the given MailBoxSetup to the attributes of this class
*/
void convSetup2Dlg(const Ax::Mail::MailBoxSetup &theSetup);
//-------------------------------------------------------------------------
// convDlg2Setup()
//-------------------------------------------------------------------------
/** convert the settings of this class to the given MailBoxSetup
*/
void convDlg2Setup(Ax::Mail::MailBoxSetup &theSetup);
//-------------------------------------------------------------------------
// attributes
//-------------------------------------------------------------------------
AxPluginMailBox *myPlugin;
Ax::Mail::MailBoxSetup &myMailBoxSetup;
/** used during check for accessiblity and during folder selection
*/
Ax::Mail::MailBox *myTmpMailBox;
/** only used for folder selection
*/
Ax::Mail::MailFolder *mySelectedFolder;
//-------------------------------------------------------------------------
// editable attributes
//-------------------------------------------------------------------------
char myAccountName [128];
char myMailBoxString[128];
char myHostName [ 64];
char myUserName [ 64];
char myPassword [ 64];
char myAccessCode [ 10];
char myFolder [128];
int myAccountType ;
int myAccessMode ;
int myBGCheck ; // BG_CHK_ON = 0x08 ///< do do background check
int myBGCheck_ExtApp ; // BG_EXT_ON = 0x01 ///< do start external app
int myBGCheck_OsdMsg ; // BG_MSG_ON = 0x02 ///< do display a message
int myBGCheck_Menu ; // BG_MEN_ON = 0x04 ///< do display in main menu
int myBGCheck_SIF ; // BG_SIF_ON = 0x10 ///< do affect service-interface
int myFAutoMarkSeen ;
int myFExpungeOnClose;
int myClientOptSec ;
int myClientOptRSH ;
int myClientOptSSL ;
int myClientOptTLS ;
int myClientOptCert ;
int myClientOptDbg ;
int myIndexFirstCClient;
int myIndexFolder ;
//-------------------------------------------------------------------------
// possible characters in edit items
//-------------------------------------------------------------------------
static const char *MailBoxNameChars;
static const char *HostNameChars;
static const char *UserNameChars;
static const char *PaswordChars;
static const char *MailBoxChars;
static const char *AccessCodeChars;
}; // class AxMenuConfigMailBox
#endif