/src/libreoffice/chart2/source/inc/MediaDescriptorHelper.hxx
Line | Count | Source |
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 | | #pragma once |
20 | | |
21 | | #include <com/sun/star/uno/Sequence.hxx> |
22 | | #include <com/sun/star/uno/Reference.hxx> |
23 | | #include <com/sun/star/beans/PropertyValue.hpp> |
24 | | |
25 | | namespace com::sun::star::beans { struct PropertyValue; } |
26 | | namespace com::sun::star::embed { class XStorage; } |
27 | | namespace com::sun::star::io { class XInputStream; } |
28 | | namespace com::sun::star::io { class XOutputStream; } |
29 | | namespace com::sun::star::io { class XStream; } |
30 | | |
31 | | /* |
32 | | * This class helps to read and write the properties mentioned in the service description |
33 | | * com.sun.star.document.MediaDescriptor from and to a sequence of PropertyValues. |
34 | | * Properties that are not mentioned in the service description |
35 | | * are stored in the member AdditionalProperties. |
36 | | * |
37 | | * As an additional feature this helper class can generate a reduced sequence of PropertyValues |
38 | | * that does not contain properties which are known to be only view relevant. This |
39 | | * reduced sequence than might be attached to a model directly. |
40 | | */ |
41 | | |
42 | | namespace apphelper |
43 | | { |
44 | | |
45 | | class MediaDescriptorHelper final |
46 | | { |
47 | | public: |
48 | | MediaDescriptorHelper( const css::uno::Sequence< css::beans::PropertyValue > & rMediaDescriptor ); |
49 | | |
50 | 0 | const css::uno::Sequence< css::beans::PropertyValue >& getReducedForModel() const { return m_aModelProperties;} |
51 | | |
52 | | //all properties given in the constructor are stored in the following three sequences |
53 | | |
54 | | //properties which should be given to a model are additionally stored in this sequence (not documented properties and deprecated properties are not included!) |
55 | | css::uno::Sequence< css::beans::PropertyValue > |
56 | | m_aModelProperties; //these are properties which are not described in service com.sun.star.document.MediaDescriptor |
57 | | |
58 | | OUString FilterName; //internal filter name. |
59 | | bool ISSET_FilterName; |
60 | | |
61 | | OUString HierarchicalDocumentName; |
62 | | |
63 | | css::uno::Reference< css::io::XOutputStream > |
64 | | OutputStream; //a stream to receive the document data for saving |
65 | | bool ISSET_OutputStream; |
66 | | css::uno::Reference< css::io::XInputStream > |
67 | | InputStream; //content of document. |
68 | | bool ISSET_InputStream; |
69 | | |
70 | | bool ReadOnly; //open document readonly. |
71 | | |
72 | | OUString URL;// FileName, URL of the document. |
73 | | bool ISSET_URL; |
74 | | |
75 | | // new framework objects |
76 | | css::uno::Reference< css::embed::XStorage > |
77 | | Storage; |
78 | | bool ISSET_Storage; |
79 | | css::uno::Reference< css::io::XStream > |
80 | | Stream; |
81 | | bool ISSET_Stream; |
82 | | |
83 | | private: |
84 | | void impl_init(); |
85 | | }; |
86 | | |
87 | | } |
88 | | |
89 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |