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