aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/render/rtf
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2004-10-01 09:03:24 +0000
committerJeremias Maerki <jeremias@apache.org>2004-10-01 09:03:24 +0000
commit404d010a67d28257381359f3cfbb2cbab39c0e97 (patch)
tree708a5d9242a2d418ef0f905b0c54d2126407f7ca /src/java/org/apache/fop/render/rtf
parent5b16935cec9ca38de47ba4bf50fb91b7ec91154d (diff)
downloadxmlgraphics-fop-404d010a67d28257381359f3cfbb2cbab39c0e97.tar.gz
xmlgraphics-fop-404d010a67d28257381359f3cfbb2cbab39c0e97.zip
Add support for the generator element which identifies the generating application (just to start finding my way into RTF).
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197989 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render/rtf')
-rw-r--r--src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfGenerator.java55
-rw-r--r--src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfHeader.java2
2 files changed, 57 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfGenerator.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfGenerator.java
new file mode 100644
index 000000000..91a63f26e
--- /dev/null
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfGenerator.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.render.rtf.rtflib.rtfdoc;
+
+import java.io.IOException;
+import java.io.Writer;
+
+import org.apache.fop.apps.Fop;
+
+/**
+ * Represents a generator element which says who generated the RTF document.
+ */
+public class RtfGenerator extends RtfElement {
+
+ /** Default constructor for the generator element. */
+ public RtfGenerator(RtfHeader h, Writer w) throws IOException {
+ super(h, w);
+ }
+
+ /**
+ * @see org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement#writeRtfContent()
+ */
+ protected void writeRtfContent() throws IOException {
+ parent.writeGroupMark(true);
+ parent.writeStarControlWord("generator");
+ parent.writer.write("Apache FOP ");
+ parent.writer.write(Fop.getVersion());
+ parent.writer.write(";");
+ parent.writeGroupMark(false);
+ }
+
+ /**
+ * @see org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement#isEmpty()
+ */
+ public boolean isEmpty() {
+ return false;
+ }
+
+}
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfHeader.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfHeader.java
index d1925d929..c63b0a8e3 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfHeader.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfHeader.java
@@ -47,6 +47,7 @@ class RtfHeader extends RtfContainer {
RtfHeader(RtfFile f, Writer w) throws IOException {
super(f, w);
new RtfFontTable(this, w);
+ new RtfGenerator(this, w);
// m_userProperties.put("jforVersion",JForVersionInfo.getLongVersionInfo());
}
@@ -59,6 +60,7 @@ class RtfHeader extends RtfContainer {
RtfTemplate.getInstance().writeTemplate(this);
RtfStyleSheetTable.getInstance().writeStyleSheet(this);
writeFootnoteProperties();
+
}
/** write user properties if any */