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 INCLUDED_SC_SOURCE_FILTER_INC_DRAWINGMANAGER_HXX
21 : #define INCLUDED_SC_SOURCE_FILTER_INC_DRAWINGMANAGER_HXX
22 :
23 : #include "drawingbase.hxx"
24 :
25 : namespace com { namespace sun { namespace star {
26 : namespace drawing { class XDrawPage; }
27 : namespace drawing { class XShape; }
28 : namespace drawing { class XShapes; }
29 : } } }
30 :
31 : namespace oox { namespace drawingml { class ShapePropertyMap; } }
32 :
33 : namespace oox {
34 : namespace xls {
35 :
36 : const sal_uInt16 BIFF_OBJ_INVALID_ID = 0;
37 :
38 : // BIFF drawing objects
39 : class BiffDrawingBase;
40 :
41 : // BIFF drawing page
42 :
43 : /** Base class for a container for all objects on a drawing page (in a
44 : spreadsheet or in an embedded chart object).
45 :
46 : For BIFF import, it is needed to load all drawing objects before converting
47 : them to UNO shapes. There might be some dummy drawing objects (e.g. the
48 : dropdown buttons of autofilters) which have to be skipped. The information,
49 : that a drawing object is a dummy object, may be located after the drawing
50 : objects themselves.
51 :
52 : The BIFF8 format stores drawing objects in the DFF stream (stored
53 : fragmented in MSODRAWING records), and in the OBJ records. The DFF stream
54 : fragments are collected in a single stream, and the complete stream will be
55 : processed afterwards.
56 : */
57 0 : class BiffDrawingBase : public WorksheetHelper
58 : {
59 : public:
60 : explicit BiffDrawingBase( const WorksheetHelper& rHelper,
61 : const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& rxDrawPage );
62 :
63 : /** Sets the object with the passed identifier to be skipped on import. */
64 : void setSkipObj( sal_uInt16 nObjId );
65 :
66 : /** Final processing after import of the all drawing objects. */
67 : void finalizeImport();
68 :
69 : /** Derived classes may want to know that a shape has been inserted. Will
70 : be called from the convertAndInsert() implementation. */
71 : virtual void notifyShapeInserted(
72 : const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape,
73 : const ::com::sun::star::awt::Rectangle& rShapeRect ) = 0;
74 :
75 : private:
76 : ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >
77 : mxDrawPage; /// UNO draw page used to insert the shapes.
78 : };
79 :
80 : /** Drawing manager of a single sheet. */
81 0 : class BiffSheetDrawing : public BiffDrawingBase
82 : {
83 : public:
84 : explicit BiffSheetDrawing( const WorksheetHelper& rHelper );
85 :
86 : /** Called when a new UNO shape has been inserted into the draw page. */
87 : virtual void notifyShapeInserted(
88 : const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape,
89 : const ::com::sun::star::awt::Rectangle& rShapeRect ) SAL_OVERRIDE;
90 : };
91 :
92 : } // namespace xls
93 : } // namespace oox
94 :
95 : #endif
96 :
97 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|