Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ***********************************************************************/
28 : :
29 : : #ifndef OOX_XLS_STYLESFRAGMENT_HXX
30 : : #define OOX_XLS_STYLESFRAGMENT_HXX
31 : :
32 : : #include "excelhandlers.hxx"
33 : : #include "stylesbuffer.hxx"
34 : :
35 : : namespace oox {
36 : : namespace xls {
37 : :
38 : : // ============================================================================
39 : :
40 [ # # ]: 0 : class IndexedColorsContext : public WorkbookContextBase
41 : : {
42 : : public:
43 : : explicit IndexedColorsContext( WorkbookFragmentBase& rFragment );
44 : :
45 : : protected:
46 : : virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
47 : : virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
48 : : };
49 : :
50 : : // ============================================================================
51 : :
52 [ + - ][ - + ]: 222 : class FontContext : public WorkbookContextBase
53 : : {
54 : : public:
55 : : template< typename ParentType >
56 : 111 : inline explicit FontContext( ParentType& rParent, const FontRef& rxFont ) :
57 [ + - ][ # # ]: 111 : WorkbookContextBase( rParent ), mxFont( rxFont ) {}
58 : :
59 : : protected:
60 : : virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
61 : :
62 : : private:
63 : : FontRef mxFont;
64 : : };
65 : :
66 : : // ============================================================================
67 : :
68 [ + - ][ - + ]: 48 : class BorderContext : public WorkbookContextBase
69 : : {
70 : : public:
71 : : template< typename ParentType >
72 : 24 : inline explicit BorderContext( ParentType& rParent, const BorderRef& rxBorder ) :
73 [ + - ][ # # ]: 24 : WorkbookContextBase( rParent ), mxBorder( rxBorder ) {}
74 : :
75 : : protected:
76 : : virtual void onStartElement( const AttributeList& rAttribs );
77 : : virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
78 : :
79 : : private:
80 : : BorderRef mxBorder;
81 : : };
82 : :
83 : : // ============================================================================
84 : :
85 [ + - ][ - + ]: 102 : class FillContext : public WorkbookContextBase
86 : : {
87 : : public:
88 : : template< typename ParentType >
89 : 51 : inline explicit FillContext( ParentType& rParent, const FillRef& rxFill ) :
90 [ + - ][ # # ]: 51 : WorkbookContextBase( rParent ), mxFill( rxFill ), mfGradPos( -1.0 ) {}
91 : :
92 : : protected:
93 : : virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
94 : :
95 : : private:
96 : : FillRef mxFill;
97 : : double mfGradPos; /// Gradient color position.
98 : : };
99 : :
100 : : // ============================================================================
101 : :
102 [ + - ][ - + ]: 930 : class XfContext : public WorkbookContextBase
103 : : {
104 : : public:
105 : : template< typename ParentType >
106 : 465 : inline explicit XfContext( ParentType& rParent, const XfRef& rxXf, bool bCellXf ) :
107 [ + - ]: 465 : WorkbookContextBase( rParent ), mxXf( rxXf ), mbCellXf( bCellXf ) {}
108 : :
109 : : protected:
110 : : virtual void onStartElement( const AttributeList& rAttribs );
111 : : virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
112 : :
113 : : private:
114 : : XfRef mxXf;
115 : : bool mbCellXf; /// True = cell XF, false = style XF.
116 : : };
117 : :
118 : : // ============================================================================
119 : :
120 [ # # ][ # # ]: 0 : class DxfContext : public WorkbookContextBase
121 : : {
122 : : public:
123 : : template< typename ParentType >
124 : 0 : inline explicit DxfContext( ParentType& rParent, const DxfRef& rxDxf ) :
125 [ # # ]: 0 : WorkbookContextBase( rParent ), mxDxf( rxDxf ) {}
126 : :
127 : : protected:
128 : : virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
129 : :
130 : : private:
131 : : DxfRef mxDxf;
132 : : };
133 : :
134 : : // ============================================================================
135 : :
136 [ - + ]: 48 : class StylesFragment : public WorkbookFragmentBase
137 : : {
138 : : public:
139 : : explicit StylesFragment(
140 : : const WorkbookHelper& rHelper,
141 : : const ::rtl::OUString& rFragmentPath );
142 : :
143 : : protected:
144 : : virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
145 : : virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
146 : :
147 : : virtual const ::oox::core::RecordInfo* getRecordInfos() const;
148 : : virtual void finalizeImport();
149 : : };
150 : :
151 : : // ============================================================================
152 : :
153 : : } // namespace xls
154 : : } // namespace oox
155 : :
156 : : #endif
157 : :
158 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|