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