01: /* ====================================================================
02: Licensed to the Apache Software Foundation (ASF) under one or more
03: contributor license agreements. See the NOTICE file distributed with
04: this work for additional information regarding copyright ownership.
05: The ASF licenses this file to You under the Apache License, Version 2.0
06: (the "License"); you may not use this file except in compliance with
07: the License. You may obtain a copy of the License at
08:
09: http://www.apache.org/licenses/LICENSE-2.0
10:
11: Unless required by applicable law or agreed to in writing, software
12: distributed under the License is distributed on an "AS IS" BASIS,
13: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: See the License for the specific language governing permissions and
15: limitations under the License.
16: ==================================================================== */
17:
18: package org.apache.poi.hslf.model;
19:
20: /**
21: * This class represents a slide's notes in a PowerPoint Document. It
22: * allows access to the text within, and the layout. For now, it only
23: * does the text side of things though
24: *
25: * @author Nick Burch
26: */
27:
28: public class Notes extends Sheet {
29: private TextRun[] _runs;
30:
31: /**
32: * Constructs a Notes Sheet from the given Notes record.
33: * Initialises TextRuns, to provide easier access to the text
34: *
35: * @param notes the Notes record to read from
36: */
37: public Notes(org.apache.poi.hslf.record.Notes notes) {
38: super (notes, notes.getNotesAtom().getSlideID());
39:
40: // Now, build up TextRuns from pairs of TextHeaderAtom and
41: // one of TextBytesAtom or TextCharsAtom, found inside
42: // EscherTextboxWrapper's in the PPDrawing
43: _runs = findTextRuns(getPPDrawing());
44:
45: // Set the sheet on each TextRun
46: for (int i = 0; i < _runs.length; i++)
47: _runs[i].setSheet(this );
48: }
49:
50: // Accesser methods follow
51:
52: /**
53: * Returns an array of all the TextRuns found
54: */
55: public TextRun[] getTextRuns() {
56: return _runs;
57: }
58:
59: /**
60: * Return <code>null</code> - Notes Masters are not yet supported
61: */
62: public MasterSheet getMasterSheet() {
63: return null;
64: }
65:
66: }
|