Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef OOX_XLS_WORKSHEETFRAGMENT_HXX
21 : #define OOX_XLS_WORKSHEETFRAGMENT_HXX
22 :
23 : #include "excelhandlers.hxx"
24 :
25 : namespace oox {
26 : namespace xls {
27 :
28 : // ============================================================================
29 :
30 0 : class DataValidationsContext : public WorksheetContextBase
31 : {
32 : public:
33 : explicit DataValidationsContext( WorksheetFragmentBase& rFragment );
34 :
35 : protected:
36 : virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
37 : virtual void onCharacters( const ::rtl::OUString& rChars );
38 : virtual void onEndElement();
39 :
40 : virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
41 :
42 : private:
43 : /** Imports the dataValidation element containing data validation settings. */
44 : void importDataValidation( const AttributeList& rAttribs );
45 : /** Imports the DATAVALIDATION record containing data validation settings. */
46 : void importDataValidation( SequenceInputStream& rStrm );
47 :
48 : private:
49 : ::std::auto_ptr< ValidationModel > mxValModel;
50 : };
51 :
52 : // ============================================================================
53 :
54 50 : class WorksheetFragment : public WorksheetFragmentBase
55 : {
56 : public:
57 : explicit WorksheetFragment(
58 : const WorksheetHelper& rHelper,
59 : const ::rtl::OUString& rFragmentPath );
60 :
61 : protected:
62 : virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
63 : virtual void onCharacters( const ::rtl::OUString& rChars );
64 :
65 : virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
66 :
67 : virtual const ::oox::core::RecordInfo* getRecordInfos() const;
68 : virtual void initializeImport();
69 : virtual void finalizeImport();
70 :
71 : private:
72 : /** Imports page settings from a pageSetUpPr element. */
73 : void importPageSetUpPr( const AttributeList& rAttribs );
74 : /** Imports the dimension element containing the used area of the sheet. */
75 : void importDimension( const AttributeList& rAttribs );
76 : /** Imports sheet format properties from a sheetFormatPr element. */
77 : void importSheetFormatPr( const AttributeList& rAttribs );
78 : /** Imports column settings from a col element. */
79 : void importCol( const AttributeList& rAttribs );
80 : /** Imports a merged cell range from a mergeCell element. */
81 : void importMergeCell( const AttributeList& rAttribs );
82 : /** Imports the hyperlink element containing a hyperlink for a cell range. */
83 : void importHyperlink( const AttributeList& rAttribs );
84 : /** Imports individual break that is either within row or column break context. */
85 : void importBrk( const AttributeList& rAttribs, bool bRowBreak );
86 : /** Imports the the relation identifier for the DrawingML part. */
87 : void importDrawing( const AttributeList& rAttribs );
88 : /** Imports the the relation identifier for the legacy VML drawing part. */
89 : void importLegacyDrawing( const AttributeList& rAttribs );
90 : /** Imports additional data for an OLE object. */
91 : void importOleObject( const AttributeList& rAttribs );
92 : /** Imports additional data for an OCX form control. */
93 : void importControl( const AttributeList& rAttribs );
94 :
95 : /** Imports the DIMENSION record containing the used area of the sheet. */
96 : void importDimension( SequenceInputStream& rStrm );
97 : /** Imports sheet format properties from a SHEETFORMATPR record. */
98 : void importSheetFormatPr( SequenceInputStream& rStrm );
99 : /** Imports column settings from a COL record. */
100 : void importCol( SequenceInputStream& rStrm );
101 : /** Imports a merged cell range from a MERGECELL record. */
102 : void importMergeCell( SequenceInputStream& rStrm );
103 : /** Imports a hyperlink for a cell range from a HYPERLINK record. */
104 : void importHyperlink( SequenceInputStream& rStrm );
105 : /** Imports the BRK record for an individual row or column page break. */
106 : void importBrk( SequenceInputStream& rStrm, bool bRowBreak );
107 : /** Imports the DRAWING record containing the relation identifier for the DrawingML part. */
108 : void importDrawing( SequenceInputStream& rStrm );
109 : /** Imports the LEGACYDRAWING record containing the relation identifier for the VML drawing part. */
110 : void importLegacyDrawing( SequenceInputStream& rStrm );
111 : /** Imports additional data for an OLE object. */
112 : void importOleObject( SequenceInputStream& rStrm );
113 : /** Imports additional data for an OCX form control. */
114 : void importControl( SequenceInputStream& rStrm );
115 :
116 : /** Imports the binary data of an embedded OLE object from the fragment with the passed ID. */
117 : void importEmbeddedOleData( StreamDataSequence& orEmbeddedData, const ::rtl::OUString& rRelId );
118 : };
119 :
120 : } // namespace xls
121 : } // namespace oox
122 :
123 : #endif
124 :
125 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|