xref: /aoo4110/main/oox/inc/oox/xls/excelfilter.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef OOX_XLS_EXCELFILTER_HXX
25 #define OOX_XLS_EXCELFILTER_HXX
26 
27 #include "oox/core/binaryfilterbase.hxx"
28 #include "oox/core/xmlfilterbase.hxx"
29 
30 namespace oox {
31 namespace xls {
32 
33 class WorkbookGlobals;
34 
35 // ============================================================================
36 
37 class ExcelFilterBase
38 {
39 public:
40     void                registerWorkbookGlobals( WorkbookGlobals& rBookGlob );
41     WorkbookGlobals&    getWorkbookGlobals() const;
42     void                unregisterWorkbookGlobals();
43 
44 protected:
45     explicit            ExcelFilterBase();
46     virtual             ~ExcelFilterBase();
47 
48 private:
49     WorkbookGlobals*    mpBookGlob;
50 };
51 
52 // ============================================================================
53 
54 class ExcelFilter : public ::oox::core::XmlFilterBase, public ExcelFilterBase
55 {
56 public:
57     explicit            ExcelFilter(
58                             const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
59                             throw( ::com::sun::star::uno::RuntimeException );
60     virtual             ~ExcelFilter();
61 
62     virtual bool        importDocument() throw();
63     virtual bool        exportDocument() throw();
64 
65     virtual const ::oox::drawingml::Theme* getCurrentTheme() const;
66     virtual ::oox::vml::Drawing* getVmlDrawing();
67 	virtual const ::oox::drawingml::table::TableStyleListPtr getTableStyles();
68     virtual ::oox::drawingml::chart::ChartConverter& getChartConverter();
69 
70 private:
71     virtual GraphicHelper* implCreateGraphicHelper() const;
72     virtual ::oox::ole::VbaProject* implCreateVbaProject() const;
73     virtual ::rtl::OUString implGetImplementationName() const;
74 };
75 
76 // ============================================================================
77 
78 class ExcelBiffFilter : public ::oox::core::BinaryFilterBase, public ExcelFilterBase
79 {
80 public:
81     explicit            ExcelBiffFilter(
82                             const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
83                             throw( ::com::sun::star::uno::RuntimeException );
84     virtual             ~ExcelBiffFilter();
85 
86     virtual bool        importDocument() throw();
87     virtual bool        exportDocument() throw();
88 
89 private:
90     virtual GraphicHelper* implCreateGraphicHelper() const;
91     virtual ::oox::ole::VbaProject* implCreateVbaProject() const;
92     virtual ::rtl::OUString implGetImplementationName() const;
93 };
94 
95 // ============================================================================
96 
97 class ExcelVbaProjectFilter : public ExcelBiffFilter
98 {
99 public:
100     explicit            ExcelVbaProjectFilter(
101                             const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
102                             throw( ::com::sun::star::uno::RuntimeException );
103 
104     virtual bool        importDocument() throw();
105     virtual bool        exportDocument() throw();
106 
107 private:
108     virtual ::rtl::OUString implGetImplementationName() const;
109 };
110  // ============================================================================
111 
112 } // namespace xls
113 } // namespace oox
114 
115 #endif
116