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