Code

r11451@tres: ted | 2006-04-17 22:21:33 -0700
[inkscape.git] / src / dom / odf / odfdocument.h
1 #ifndef __ODF_DOCUMENT_H__\r
2 #define __ODF_DOCUMENT_H__\r
3 /**\r
4  *\r
5  * This class contains an ODF Document.\r
6  * Initially, we are just concerned with .odg content.xml + resources\r
7  *\r
8  * ---------------------------------------------------------------------\r
9  *\r
10  * Copyright (C) 2006 Bob Jamison\r
11  *\r
12  * This program is free software; you can redistribute it and/or modify\r
13  * it under the terms of the GNU General Public License as published by\r
14  * the Free Software Foundation; either version 3 of the License, or\r
15  * (at your option) any later version.\r
16  *\r
17  * This program is distributed in the hope that it will be useful,\r
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
20  * GNU General Public License for more details.\r
21  *\r
22  * You should have received a copy of the GNU General Public License\r
23  * along with this program; if not, write to the Free Software Foundation,\r
24  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\r
25  *\r
26  * For more information, please write to rwjj@earthlink.net\r
27  *\r
28  */\r
29 \r
30 #include <vector>\r
31 #include <string>\r
32 \r
33 #include "dom/dom.h"\r
34 \r
35 namespace odf\r
36 {\r
37 \r
38 \r
39 //########################################################################\r
40 //# I M A G E    D A T A\r
41 //########################################################################\r
42 \r
43 /**\r
44  *\r
45  */\r
46 class ImageData\r
47 {\r
48 public:\r
49 \r
50     /**\r
51      *\r
52      */\r
53     ImageData(const std::string &fileName,\r
54               const std::vector<unsigned char> &buf);\r
55 \r
56     /**\r
57      *\r
58      */\r
59     ImageData(const ImageData &other);\r
60 \r
61     /**\r
62      *\r
63      */\r
64     virtual ~ImageData();\r
65 \r
66     /**\r
67      *\r
68      */\r
69     virtual std::string getFileName();\r
70 \r
71     /**\r
72      *\r
73      */\r
74     virtual void setFileName(const std::string &val);\r
75 \r
76     /**\r
77      *\r
78      */\r
79     virtual std::vector<unsigned char> &getData();\r
80 \r
81     /**\r
82      *\r
83      */\r
84     virtual void setData(const std::vector<unsigned char> &buf);\r
85 \r
86 private:\r
87 \r
88     std::string fileName;\r
89 \r
90     std::vector<unsigned char> data;\r
91 \r
92 };\r
93 \r
94 \r
95 \r
96 \r
97 \r
98 //########################################################################\r
99 //# O D F    D O C U M E N T\r
100 //########################################################################\r
101 \r
102 \r
103 /**\r
104  *\r
105  */\r
106 class OdfDocument\r
107 {\r
108 public:\r
109 \r
110     /**\r
111      *\r
112      */\r
113     OdfDocument();\r
114 \r
115     /**\r
116      *  Copy constructor\r
117      */\r
118     OdfDocument(const OdfDocument &other);\r
119 \r
120     /**\r
121      *\r
122      */\r
123     virtual ~OdfDocument();\r
124 \r
125     /**\r
126      *\r
127      */\r
128     virtual bool readFile(const std::string &fileName);\r
129 \r
130     /**\r
131      *\r
132      */\r
133     virtual bool writeFile(const std::string &fileName);\r
134 \r
135 \r
136 private:\r
137 \r
138     org::w3c::dom::Document *content;\r
139 \r
140     std::vector<ImageData> images;\r
141 \r
142 };\r
143 \r
144 } //namespace odf\r
145 \r
146 \r
147 \r
148 #endif /*__ODF_DOCUMENT_H__*/\r
149 \r
150 //########################################################################\r
151 //# E N D    O F    F I L E\r
152 //########################################################################\r
153 \r