Add tag for the 120219 release.
[pub/USBasp.git] / Demos / Device / Incomplete / Sideshow / Lib / SideshowContent.h
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2012.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaim all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
31 #ifndef _SIDESHOW_CONTENT_H_
32 #define _SIDESHOW_CONTENT_H_
33
34 /* Includes: */
35 #include <avr/io.h>
36 #include <stdbool.h>
37 #include <string.h>
38 #include <stdio.h>
39
40 #include "SideshowCommon.h"
41 #include "SideshowApplications.h"
42
43 /* Enums: */
44 enum SideShow_ContentTypes_t
45 {
46 Content_Menu = 0,
47 Content_Content = 1,
48 Content_MenuItem = 2,
49 Content_Button = 3,
50 Content_Text = 4,
51 Content_EndOfContent = 5
52 };
53
54 enum SideShow_ActionTypes_t
55 {
56 TODO
57 };
58
59 enum SideShow_AlignmentTypes_t
60 {
61 TODO2
62 };
63
64 /* Type Defines: */
65 typedef struct
66 {
67 uint8_t ContentType;
68 uint8_t ContentSize;
69 } SideShow_Content_Header_t;
70
71 typedef struct
72 {
73 SideShow_Content_Header_t Header;
74
75 uint32_t ItemID;
76 uint8_t ActionType;
77 char Title[];
78 } SideShow_Content_Menu_t;
79
80 typedef struct
81 {
82 SideShow_Content_Header_t Header;
83
84 uint32_t ItemID;
85 uint32_t Target;
86 bool IsSelected;
87 char Text[];
88 } SideShow_Content_MenuItem_t;
89
90 typedef struct
91 {
92 SideShow_Content_Header_t Header;
93
94 uint8_t Key;
95 uint32_t Target;
96 } SideShow_Content_Button_t;
97
98 typedef struct
99 {
100 SideShow_Content_Header_t Header;
101
102 uint32_t ItemID;
103 uint32_t AssociatedMenuID;
104 char Title[];
105 } SideShow_Content_Content_t;
106
107 typedef struct
108 {
109 SideShow_Content_Header_t Header;
110
111 char Text[];
112 } SideShow_Content_Text_t;
113
114 /* Defines: */
115 #define XML_START_TAG "<body>"
116 #define XML_END_TAG "</body>"
117
118 /* Function Prototypes: */
119 bool SideShow_AddSimpleContent(SideShow_PacketHeader_t* const PacketHeader,
120 SideShow_Application_t* const Application);
121
122 #if defined(INCLUDE_FROM_SIDESHOWCONTENT_C)
123 static void SideShow_ProcessXMLContent(void* ContentData,
124 uint32_t ContentSize);
125 #endif
126
127 #endif
128