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 0 : 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 : ::com::sun::star::beans::PropertyValue > getReducedForModel();
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 : sal_Bool AsTemplate; //document is a template.
79 : sal_Bool ISSET_AsTemplate;
80 : OUString Author;
81 : sal_Bool ISSET_Author;
82 : OUString CharacterSet; //identifier of used character set.
83 : sal_Bool ISSET_CharacterSet;
84 : OUString Comment;
85 : sal_Bool ISSET_Comment;
86 :
87 : ::com::sun::star::uno::Any
88 : ComponentData;
89 : sal_Bool ISSET_ComponentData;
90 : OUString FileName; //deprecated, same as url
91 : sal_Bool ISSET_FileName;
92 : ::com::sun::star::uno::Any
93 : FilterData;
94 : sal_Bool ISSET_FilterData;
95 : OUString FilterName; //internal filter name.
96 : sal_Bool ISSET_FilterName;
97 : OUString FilterFlags;//deprecated,
98 : sal_Bool ISSET_FilterFlags;
99 : OUString FilterOptions;
100 : sal_Bool ISSET_FilterOptions;
101 : //not documented ... @todo remove?
102 : OUString FrameName; //name of target frame.
103 : sal_Bool ISSET_FrameName;
104 : sal_Bool Hidden; //load document, invisible.
105 : sal_Bool ISSET_Hidden;
106 :
107 : OUString HierarchicalDocumentName;
108 : sal_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 : sal_Bool ISSET_OutputStream;
113 : ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
114 : InputStream; //content of document.
115 : sal_Bool ISSET_InputStream;
116 : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
117 : InteractionHandler; //::com::sun::star::task::XInteractionHandler
118 : sal_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 : sal_Bool ISSET_JumpMark;
122 : OUString MediaType; //mime type.
123 : sal_Bool ISSET_MediaType;
124 : OUString OpenFlags; //deprecated
125 : sal_Bool ISSET_OpenFlags;
126 : sal_Bool OpenNewView; //opens a new view for an already loaded document.
127 : sal_Bool ISSET_OpenNewView;
128 : sal_Bool Overwrite; //opens a new view for an already loaded document.
129 : sal_Bool ISSET_Overwrite;
130 : OUString Password;
131 : sal_Bool ISSET_Password;
132 :
133 : //not documented ... @todo remove?
134 : ::com::sun::star::awt::Rectangle
135 : PosSize; //position and size of document window.
136 : sal_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 : sal_Bool ISSET_PostData;
141 : OUString PostString; //deprecated, contains the data for HTTP post method as a sequence of bytes.
142 : sal_Bool ISSET_PostString;
143 : sal_Bool Preview; //show preview.
144 : sal_Bool ISSET_Preview;
145 : sal_Bool ReadOnly; //open document readonly.
146 : sal_Bool ISSET_ReadOnly;
147 : OUString Referer; //name of document referrer.
148 : sal_Bool ISSET_Referer;
149 :
150 : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
151 : StatusIndicator; //::com::sun::star::task::XStatusIndicator
152 : sal_Bool ISSET_StatusIndicator;
153 : //not documented ... @todo remove?
154 : sal_Bool Silent; //prevents dialogs to query for more information.
155 : sal_Bool ISSET_Silent;
156 : OUString TemplateName; //deprecated, name of the template instead of the URL.
157 : sal_Bool ISSET_TemplateName;
158 : OUString TemplateRegionName; //deprecated, name of the region of the template.
159 : sal_Bool ISSET_TemplateRegionName;
160 : sal_Bool Unpacked;
161 : sal_Bool ISSET_Unpacked;
162 : OUString URL;// FileName, URL of the document.
163 : sal_Bool ISSET_URL;
164 : sal_Int16 Version; //storage version.
165 : sal_Bool ISSET_Version;
166 :
167 : ::com::sun::star::uno::Any
168 : ViewData;
169 : sal_Bool ISSET_ViewData;
170 : sal_Int16 ViewId; //id of the initial view.
171 : sal_Bool ISSET_ViewId;
172 :
173 : // new framework objects
174 : ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
175 : Storage;
176 : sal_Bool ISSET_Storage;
177 : ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >
178 : Stream;
179 : sal_Bool ISSET_Stream;
180 :
181 : // undocumented SFX Properties
182 : ::com::sun::star::uno::Sequence< sal_Int32 >
183 : WinExtent;
184 : sal_Bool ISSET_WinExtent;
185 : sal_Bool SetEmbedded;
186 : sal_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: */
|