]> icculus.org git repositories - icculus/iodoom3.git/blob - neo/framework/DeclPDA.h
Various Mac OS X tweaks to get this to build. Probably breaking things.
[icculus/iodoom3.git] / neo / framework / DeclPDA.h
1 /*
2 ===========================================================================
3
4 Doom 3 GPL Source Code
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company. 
6
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).  
8
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code.  If not, see <http://www.gnu.org/licenses/>.
21
22 In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code.  If not, please request a copy in writing from id Software at the address below.
23
24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
25
26 ===========================================================================
27 */
28
29 #ifndef __DECLPDA_H__
30 #define __DECLPDA_H__
31
32 /*
33 ===============================================================================
34
35         idDeclPDA
36
37 ===============================================================================
38 */
39
40
41 class idDeclEmail : public idDecl {
42 public:
43                                                         idDeclEmail() {}
44
45         virtual size_t                  Size( void ) const;
46         virtual const char *    DefaultDefinition( void ) const;
47         virtual bool                    Parse( const char *text, const int textLength );
48         virtual void                    FreeData( void );
49         virtual void                    Print( void ) const;
50         virtual void                    List( void ) const;
51
52         const char *                    GetFrom() const { return from; }
53         const char *                    GetBody() const { return text; }
54         const char *                    GetSubject() const { return subject; }
55         const char *                    GetDate() const { return date; }
56         const char *                    GetTo() const { return to; }
57         const char *                    GetImage() const { return image; }
58
59 private:
60         idStr                                   text;
61         idStr                                   subject;
62         idStr                                   date;
63         idStr                                   to;
64         idStr                                   from;
65         idStr                                   image;
66 };
67
68
69 class idDeclVideo : public idDecl {
70 public:
71                                                         idDeclVideo() {};
72
73         virtual size_t                  Size( void ) const;
74         virtual const char *    DefaultDefinition( void ) const;
75         virtual bool                    Parse( const char *text, const int textLength );
76         virtual void                    FreeData( void );
77         virtual void                    Print( void ) const;
78         virtual void                    List( void ) const;
79
80         const char *                    GetRoq() const { return video; }
81         const char *                    GetWave() const { return audio; }
82         const char *                    GetVideoName() const { return videoName; }
83         const char *                    GetInfo() const { return info; }
84         const char *                    GetPreview() const { return preview; }
85
86 private:
87         idStr                                   preview;
88         idStr                                   video;
89         idStr                                   videoName;
90         idStr                                   info;
91         idStr                                   audio;
92 };
93
94
95 class idDeclAudio : public idDecl {
96 public:
97                                                         idDeclAudio() {};
98
99         virtual size_t                  Size( void ) const;
100         virtual const char *    DefaultDefinition( void ) const;
101         virtual bool                    Parse( const char *text, const int textLength );
102         virtual void                    FreeData( void );
103         virtual void                    Print( void ) const;
104         virtual void                    List( void ) const;
105
106         const char *                    GetAudioName() const { return audioName; }
107         const char *                    GetWave() const { return audio; }
108         const char *                    GetInfo() const { return info; }
109         const char *                    GetPreview() const { return preview; }
110
111 private:
112         idStr                                   audio;
113         idStr                                   audioName;
114         idStr                                   info;
115         idStr                                   preview;
116 };
117
118
119 class idDeclPDA : public idDecl {
120 public:
121                                                         idDeclPDA() { originalEmails = originalVideos = 0; };
122
123         virtual size_t                  Size( void ) const;
124         virtual const char *    DefaultDefinition( void ) const;
125         virtual bool                    Parse( const char *text, const int textLength );
126         virtual void                    FreeData( void );
127         virtual void                    Print( void ) const;
128         virtual void                    List( void ) const;
129
130         virtual void                    AddVideo( const char *name, bool unique = true ) const;
131         virtual void                    AddAudio( const char *name, bool unique = true ) const;
132         virtual void                    AddEmail( const char *name, bool unique = true ) const;
133         virtual void                    RemoveAddedEmailsAndVideos() const;
134
135         virtual const int               GetNumVideos() const;
136         virtual const int               GetNumAudios() const;
137         virtual const int               GetNumEmails() const;
138         virtual const idDeclVideo *GetVideoByIndex( int index ) const;
139         virtual const idDeclAudio *GetAudioByIndex( int index ) const;
140         virtual const idDeclEmail *GetEmailByIndex( int index ) const;
141
142         virtual void                    SetSecurity( const char *sec ) const;
143
144         const char *                    GetPdaName() const { return pdaName; }
145         const char *                    GetSecurity() const {return security; }
146         const char *                    GetFullName() const { return fullName; }
147         const char *                    GetIcon() const { return icon; }
148         const char *                    GetPost() const { return post; }
149         const char *                    GetID() const { return id; }
150         const char *                    GetTitle() const { return title; }
151
152 private:
153         mutable idStrList               videos;
154         mutable idStrList               audios;
155         mutable idStrList               emails;
156         idStr                                   pdaName;
157         idStr                                   fullName;
158         idStr                                   icon;
159         idStr                                   id;
160         idStr                                   post;
161         idStr                                   title;
162         mutable idStr                   security;
163         mutable int                             originalEmails;
164         mutable int                             originalVideos;
165 };
166
167 #endif /* !__DECLPDA_H__ */