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 : #ifndef INCLUDED_CHART2_SOURCE_INC_MEDIADESCRIPTORHELPER_HXX
20 : #define INCLUDED_CHART2_SOURCE_INC_MEDIADESCRIPTORHELPER_HXX
21 :
22 : #include <com/sun/star/uno/Sequence.hxx>
23 : #include <com/sun/star/beans/PropertyValue.hpp>
24 : #include <com/sun/star/util/URL.hpp>
25 : #include <com/sun/star/awt/Rectangle.hpp>
26 : #include <com/sun/star/io/XStream.hpp>
27 : #include <com/sun/star/io/XInputStream.hpp>
28 : #include <com/sun/star/io/XOutputStream.hpp>
29 : #include <com/sun/star/embed/XStorage.hpp>
30 : #include "charttoolsdllapi.hxx"
31 :
32 : /*
33 : * This class helps to read and write the properties mentioned in the service description
34 : * com.sun.star.document.MediaDescriptor from and to a sequence of PropertyValues.
35 : * Properties that are not mentioned in the service description
36 : * are stored in the member AdditionalProperties.
37 : *
38 : * As an additional feature this helper class can generate a reduced sequence of PropertyValues
39 : * that does not contain properties which are known to be only view relevant. This
40 : * reduced sequence than might be attached to a model directly.
41 : */
42 :
43 : namespace apphelper
44 : {
45 :
46 722 : class OOO_DLLPUBLIC_CHARTTOOLS MediaDescriptorHelper
47 : {
48 : private:
49 : //MediaDescriptorHelper(){};
50 : public:
51 : MediaDescriptorHelper( const ::com::sun::star::uno::Sequence<
52 : ::com::sun::star::beans::PropertyValue > & rMediaDescriptor );
53 :
54 : ::com::sun::star::uno::Sequence<
55 0 : ::com::sun::star::beans::PropertyValue > getReducedForModel() { return m_aModelProperties;}
56 :
57 : public:
58 : //all properties given in the constructor are stored in the following three sequences
59 :
60 : ::com::sun::star::uno::Sequence<
61 : ::com::sun::star::beans::PropertyValue >
62 : m_aRegularProperties; //these are the properties which are described in service com.sun.star.document.MediaDescriptor and not marked as deprecated
63 :
64 : ::com::sun::star::uno::Sequence<
65 : ::com::sun::star::beans::PropertyValue >
66 : m_aDeprecatedProperties; //these are properties which are described in service com.sun.star.document.MediaDescriptor but are marked as deprecated
67 :
68 : ::com::sun::star::uno::Sequence<
69 : ::com::sun::star::beans::PropertyValue >
70 : m_aAdditionalProperties; //these are properties which are not described in service com.sun.star.document.MediaDescriptor
71 :
72 : //properties which should be given to a model are additionally stored in this sequence (not documented properties and deprecated properties are not included!)
73 : ::com::sun::star::uno::Sequence<
74 : ::com::sun::star::beans::PropertyValue >
75 : m_aModelProperties; //these are properties which are not described in service com.sun.star.document.MediaDescriptor
76 :
77 : //@todo define this for debug only, except URL
78 : bool AsTemplate; //document is a template.
79 : bool ISSET_AsTemplate;
80 : OUString Author;
81 : bool ISSET_Author;
82 : OUString CharacterSet; //identifier of used character set.
83 : bool ISSET_CharacterSet;
84 : OUString Comment;
85 : bool ISSET_Comment;
86 :
87 : ::com::sun::star::uno::Any
88 : ComponentData;
89 : bool ISSET_ComponentData;
90 : OUString FileName; //deprecated, same as url
91 : bool ISSET_FileName;
92 : ::com::sun::star::uno::Any
93 : FilterData;
94 : bool ISSET_FilterData;
95 : OUString FilterName; //internal filter name.
96 : bool ISSET_FilterName;
97 : OUString FilterFlags;//deprecated,
98 : bool ISSET_FilterFlags;
99 : OUString FilterOptions;
100 : bool ISSET_FilterOptions;
101 : //not documented ... @todo remove?
102 : OUString FrameName; //name of target frame.
103 : bool ISSET_FrameName;
104 : bool Hidden; //load document, invisible.
105 : bool ISSET_Hidden;
106 :
107 : OUString HierarchicalDocumentName;
108 : bool ISSET_HierarchicalDocumentName;
109 :
110 : ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
111 : OutputStream; //a stream to receive the document data for saving
112 : bool ISSET_OutputStream;
113 : ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
114 : InputStream; //content of document.
115 : bool ISSET_InputStream;
116 : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
117 : InteractionHandler; //::com::sun::star::task::XInteractionHandler
118 : bool ISSET_InteractionHandler;
119 :
120 : OUString JumpMark; //specifies the name of a mark within the document where the first view is to position itself.
121 : bool ISSET_JumpMark;
122 : OUString MediaType; //mime type.
123 : bool ISSET_MediaType;
124 : OUString OpenFlags; //deprecated
125 : bool ISSET_OpenFlags;
126 : bool OpenNewView; //opens a new view for an already loaded document.
127 : bool ISSET_OpenNewView;
128 : bool Overwrite; //opens a new view for an already loaded document.
129 : bool ISSET_Overwrite;
130 : OUString Password;
131 : bool ISSET_Password;
132 :
133 : //not documented ... @todo remove?
134 : ::com::sun::star::awt::Rectangle
135 : PosSize; //position and size of document window.
136 : bool ISSET_PosSize;
137 :
138 : ::com::sun::star::uno::Sequence< sal_Int8 >
139 : PostData; //contains the data for HTTP post method as a sequence of bytes.
140 : bool ISSET_PostData;
141 : OUString PostString; //deprecated, contains the data for HTTP post method as a sequence of bytes.
142 : bool ISSET_PostString;
143 : bool Preview; //show preview.
144 : bool ISSET_Preview;
145 : bool ReadOnly; //open document readonly.
146 : bool ISSET_ReadOnly;
147 : OUString Referer; //name of document referrer.
148 : bool ISSET_Referer;
149 :
150 : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
151 : StatusIndicator; //::com::sun::star::task::XStatusIndicator
152 : bool ISSET_StatusIndicator;
153 : //not documented ... @todo remove?
154 : bool Silent; //prevents dialogs to query for more information.
155 : bool ISSET_Silent;
156 : OUString TemplateName; //deprecated, name of the template instead of the URL.
157 : bool ISSET_TemplateName;
158 : OUString TemplateRegionName; //deprecated, name of the region of the template.
159 : bool ISSET_TemplateRegionName;
160 : bool Unpacked;
161 : bool ISSET_Unpacked;
162 : OUString URL;// FileName, URL of the document.
163 : bool ISSET_URL;
164 : sal_Int16 Version; //storage version.
165 : bool ISSET_Version;
166 :
167 : ::com::sun::star::uno::Any
168 : ViewData;
169 : bool ISSET_ViewData;
170 : sal_Int16 ViewId; //id of the initial view.
171 : bool ISSET_ViewId;
172 :
173 : // new framework objects
174 : ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
175 : Storage;
176 : bool ISSET_Storage;
177 : ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >
178 : Stream;
179 : bool ISSET_Stream;
180 :
181 : // undocumented SFX Properties
182 : ::com::sun::star::uno::Sequence< sal_Int32 >
183 : WinExtent;
184 : bool ISSET_WinExtent;
185 : bool SetEmbedded;
186 : bool ISSET_SetEmbedded;
187 :
188 : protected:
189 : SAL_DLLPRIVATE void impl_init();
190 : };
191 :
192 : }
193 :
194 : #endif
195 :
196 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|