1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     cec_MessageBox.h
4 
5   Copyright 2009 Nintendo.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13 <<<<<<< .working
14   $Date:: 2011-06-21#$
15   $Rev: 38774 $
16   $Author: sato_yoshinobu $
17 =======
18   $Rev: 38774 $
19 >>>>>>> .merge-right.r38771
20  *---------------------------------------------------------------------------*/
21 #ifndef __MESSAGE_BOX_SYSTEM_H__
22 #define __MESSAGE_BOX_SYSTEM_H__
23 
24 
25 #include <nn/cec/CTR/cec_Api.h>
26 
27 namespace nn {
28 namespace cec {
29 namespace CTR {
30 
31 
32 /* Please see man pages for details
33 
34 
35 
36 */
37 
38 class MessageBoxSystem : public MessageBox
39 {
40 
41  public:
42 
43     explicit  MessageBoxSystem(bool NoInitialize = false);
44     virtual ~MessageBoxSystem();
45 
46 
47     //
48     //
49 
50     u32     GetMessageBoxList(MessageBoxList& messageBoxList);
51 
52     /* Please see man pages for details
53 
54 
55 
56 
57 
58     */
59     u32     GetMessageBoxTitleIdList(TitleId* titleIdList, MessageBoxFlag flag);
60 
61     /* Please see man pages for details
62 
63 
64 
65 
66 
67 
68 
69 
70 
71 
72 
73 
74 
75 
76     */
77     nn::Result  CreateMessageBox_System(
78                 const TitleId cecTitleId, const u32 privateId,
79                 const char* hmacKey,
80                 MessageBoxFlag flag,
81                 size_t  inboxSizeMax = CEC_INBOX_SIZE_DEFAULT,
82                 size_t  outboxSizeMax = CEC_OUTBOX_SIZE_DEFAULT,
83                 size_t  inboxMessNumMax = CEC_INBOX_MESSNUM_DEFAULT,
84                 size_t  outboxMessNumMax = CEC_OUTBOX_MESSNUM_DEFAULT,
85                 size_t  messageSizeMax = CEC_MESSSIZEMAX_DEFAULT
86             );
87 
88     /* Please see man pages for details
89 
90 
91 
92 
93 
94 
95 
96 
97     */
98     nn::Result  GetMessageBoxDataDirect(TitleId cecTitleId, const u32 datatype, void* dataBuf, const size_t dataBufSize);
99 
100     nn::Result      DeleteAllBoxes();
101     void SetLastOpenedDate(const nn::fnd::DateTimeParameters& dateTime);
102     nn::fnd::DateTimeParameters GetLastOpenedDate();
103     nn::fnd::DateTimeParameters GetLastReceivedDate();
104 
105     nn::Result  DeleteOldestMessageBox(MessageBoxFlag flag);
106 
107     /* Please see man pages for details
108 
109 
110 
111 
112     */
113     virtual nn::Result      OpenMessageBoxForce(const TitleId cecTitleId);
114 
115     nn::Result    SetMessageBoxFlag(const MessageBoxFlag flag);
116 
117     nn::Result  SetMessageBodyDirect(const TitleId cecTitleId, const CecBoxType boxType, const MessageId& messageId, const void* dataBody, const size_t dataBodyLen);
118     size_t  GetMessageBodySizeDirect(const TitleId cecTitleId, const CecBoxType boxType, const MessageId& messageId);
119     nn::Result  GetMessageBodyDirect(const TitleId cecTitleId, const CecBoxType boxType, const MessageId& messageId, void* dataBody, const size_t dataBodyLen);
120 };
121 
122 } // namespace CTR
123 } // namespace cec
124 } // namespace nn
125 
126 /*
127 #define CEC_STATE_MFILTER_EXCHANGE  (0x1)
128 #define CEC_STATE_ID_EXCHANGE       (0x2)
129 #define CEC_STATE_LIST_EXCHANGE     (0x4)
130 */
131 
132 #endif  //__MESSAGE_BOX_SYSTEM_H__
133 
134