-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAxMenuFolders.h
179 lines (156 loc) · 7.04 KB
/
AxMenuFolders.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
#ifndef __AxMenuFolders_H__
#define __AxMenuFolders_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: 10.12.2004
*
* Last modfied:
* $Author: alex $
* $Date: 2004-09-21 23:21:04 +0200 (Di, 21 Sep 2004) $
*/
//=============================================================================
//=============================================================================
// includes
//=============================================================================
//----- qt --------------------------------------------------------------------
//----- CORBA -----------------------------------------------------------------
//----- C++ -------------------------------------------------------------------
//----- C ---------------------------------------------------------------------
//----- vdr -------------------------------------------------------------------
//----- AxLib -----------------------------------------------------------------
#include <Ax/Vdr/OsdMenu.h>
//----- local -----------------------------------------------------------------
//----- other includes --------------------------------------------------------
//=============================================================================
// forward declarations
//=============================================================================
namespace Ax {
namespace Mail {
class MailFolder;
}
}
class AxFolderItem;
//=============================================================================
// class AxMenuFolders
//=============================================================================
/** Menu to select a mail account and to call the mail-list-view.
*
* If the menu is closed (with osBack) the given folder (theBaseFolder -> myFolder)
* either points:
*
* - to the selected folder (accepted)
* or
* - to 0 (rejected)
*
*/
class AxMenuFolders : public Ax::Vdr::OsdMenu
{
//-------------------------------------------------------------------------
// typedefs
//-------------------------------------------------------------------------
typedef Ax::Vdr::OsdMenu PARENT;
typedef AxMenuFolders MYSELF;
protected:
//-------------------------------------------------------------------------
// enums
//-------------------------------------------------------------------------
enum AxEAction
{
A_FIRST = PARENT::A_LAST
, A_ACCEPT_FOLDER = A_FIRST ///< accept the current folder and close
, A_REJECT_FOLDER ///< reject the selection and close
, A_CHECK_FOLDER ///< check if the current folder is accessible
, A_OPEN_FOLDER ///< open the current folder
, A_CLOSE_FOLDER ///< close the current folder
, A_SHOW_LOG ///< show the log
, A_LAST
};
public:
//-------------------------------------------------------------------------
// AxMenuFolders()
//-------------------------------------------------------------------------
/** Constructor
*
* Show all folders of the mailbox assigned to theBaseFolder and
* preselect theBaseFolder
*
*/
AxMenuFolders(Ax::Mail::MailFolder *&theBaseFolder);
//-------------------------------------------------------------------------
// ~AxMenuFolders()
//-------------------------------------------------------------------------
/** Destructor
*/
virtual ~AxMenuFolders();
//-------------------------------------------------------------------------
// MenuKind()
//-------------------------------------------------------------------------
virtual const char* MenuKind() { return "MenuMailboxFolders"; }
//-------------------------------------------------------------------------
// processAction()
//-------------------------------------------------------------------------
/** Process the action with the given ActionCode
*/
virtual eOSState processAction(const Ax::Vdr::Action &theAction, eOSState = osUnknown);
//-------------------------------------------------------------------------
// delItem()
//-------------------------------------------------------------------------
bool delItem(cOsdItem *theItem);
//-------------------------------------------------------------------------
// getFolderItem()
//-------------------------------------------------------------------------
AxFolderItem *getFolderItem(std::string theFolderPath);
protected:
//-------------------------------------------------------------------------
// informSubOSDClosed()
//-------------------------------------------------------------------------
/** This methods is called from within ProcessKey() whenever a sub-dialog
* is closed
*/
virtual void informSubOSDClosed(const Ax::Vdr::Action &theAction, eKeys theKey);
//-------------------------------------------------------------------------
// informCurrentChanged()
//-------------------------------------------------------------------------
virtual void informCurrentChanged(int theOldCurrent);
private:
//-------------------------------------------------------------------------
// getCurrentFolder()
//-------------------------------------------------------------------------
/** returns the currently selected folder or 0 if no folder selected.
*/
Ax::Mail::MailFolder *getCurrentFolder();
//-------------------------------------------------------------------------
// updateActions()
//-------------------------------------------------------------------------
/** Update the enabled state of the actions depending on the current folder
*/
void updateActions();
//-------------------------------------------------------------------------
// setup()
//-------------------------------------------------------------------------
/** Clear all folder items and create items for all folders below
* (and not including) the root-folder of the mailbox
*/
bool setup();
//-------------------------------------------------------------------------
// checkCurrentFolder()
//-------------------------------------------------------------------------
/** Check if the current folder is accessible
*
* If the current folder isn't accessible an error-message is displayed
*
* @param fShowStatus show success-status if accessible
* @returns true if the current folder is accessible
*/
bool checkCurrentFolder(bool fShowStatus);
//-------------------------------------------------------------------------
// attributes
//-------------------------------------------------------------------------
Ax::Mail::MailBox *myMailBox;
Ax::Mail::MailFolder *&myFolder;
}; // class AxMenuFolders
#endif