update dev300-m58
[ooovba.git] / ucb / source / ucp / odma / odma_content.hxx
blob464bc3ae28bf7750d50f505c1cd706292ac1f051
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: odma_content.hxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef ODMA_CONTENT_HXX
32 #define ODMA_CONTENT_HXX
34 #include <list>
35 #include <ucbhelper/contenthelper.hxx>
37 namespace com { namespace sun { namespace star {
38 namespace beans {
39 struct Property;
40 struct PropertyValue;
42 namespace sdbc {
43 class XRow;
45 namespace io {
46 class XInputStream;
48 }}}
49 namespace ucbhelper
51 class Content;
55 // @@@ Adjust namespace name.
56 namespace odma
59 //=========================================================================
61 // @@@ Adjust service name.
63 // UNO service name for the content.
64 #define ODMA_CONTENT_SERVICE_NAME \
65 "com.sun.star.ucb.ODMAContent"
67 //=========================================================================
68 class ContentProvider;
69 class ContentProperties;
70 class Content : public ::ucbhelper::ContentImplHelper
72 ::rtl::Reference<ContentProperties> m_aProps;
73 ContentProvider* m_pProvider;
74 ::ucbhelper::Content* m_pContent;
76 private:
77 virtual com::sun::star::uno::Sequence< com::sun::star::beans::Property >
78 getProperties( const com::sun::star::uno::Reference<
79 com::sun::star::ucb::XCommandEnvironment > & xEnv );
80 virtual com::sun::star::uno::Sequence< com::sun::star::ucb::CommandInfo >
81 getCommands( const com::sun::star::uno::Reference<
82 com::sun::star::ucb::XCommandEnvironment > & xEnv );
83 virtual ::rtl::OUString getParentURL();
85 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow >
86 getPropertyValues( const ::com::sun::star::uno::Sequence<
87 ::com::sun::star::beans::Property >& rProperties,
88 const ::com::sun::star::uno::Reference<
89 ::com::sun::star::ucb::XCommandEnvironment >& xEnv );
90 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >
91 setPropertyValues( const ::com::sun::star::uno::Sequence<
92 ::com::sun::star::beans::PropertyValue >& rValues,
93 const ::com::sun::star::uno::Reference<
94 ::com::sun::star::ucb::XCommandEnvironment >& xEnv );
96 /** openDoc returns the file URL for the DOC ID
97 @return the url of the temporary file
99 ::rtl::OUString openDoc();
101 /** changePropertyValue sets the property referenced by _sMemberValue to the new value
102 @param _rValue the new value to set
103 @param _rnCurrentPos the current position inside the Any sequence _rRet
104 @param _sMemberValue the place where to set the property
105 @param _rnChanged will be incremented when property changed
106 @param _rRet collect the exceptions
107 @param _rChanges contains the changes done
109 void changePropertyValue(const ::com::sun::star::beans::PropertyValue& _rValue,
110 sal_Int32 _rnCurrentPos,
111 ::rtl::OUString& _rsMemberValue,
112 sal_Int32& _rnChanged,
113 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rRet,
114 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent >& _rChanges) throw (::com::sun::star::beans::IllegalTypeException);
116 // typedef rtl::Reference< Content > ContentRef;
117 // typedef std::list< ContentRef > ContentRefList;
118 // void queryChildren( ContentRefList& rChildren );
120 // Command "insert"
121 void insert( const ::com::sun::star::uno::Reference<
122 ::com::sun::star::io::XInputStream > & xInputStream,
123 sal_Bool bReplaceExisting,
124 const com::sun::star::uno::Reference<
125 com::sun::star::ucb::XCommandEnvironment >& Environment )
126 throw( ::com::sun::star::uno::Exception );
128 // // Command "delete"
129 // void destroy( sal_Bool bDeletePhysical )
130 // throw( ::com::sun::star::uno::Exception );
132 public:
133 Content( const ::com::sun::star::uno::Reference<
134 ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
135 ContentProvider* pProvider,
136 const ::com::sun::star::uno::Reference<
137 ::com::sun::star::ucb::XContentIdentifier >& Identifier,
138 const ::rtl::Reference<ContentProperties>& _rProps);
139 virtual ~Content();
141 // XInterface
142 XINTERFACE_DECL()
144 // XTypeProvider
145 XTYPEPROVIDER_DECL()
147 // XServiceInfo
148 virtual ::rtl::OUString SAL_CALL
149 getImplementationName()
150 throw( ::com::sun::star::uno::RuntimeException );
151 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
152 getSupportedServiceNames()
153 throw( ::com::sun::star::uno::RuntimeException );
155 // XContent
156 virtual rtl::OUString SAL_CALL
157 getContentType()
158 throw( com::sun::star::uno::RuntimeException );
160 // XCommandProcessor
161 virtual com::sun::star::uno::Any SAL_CALL
162 execute( const com::sun::star::ucb::Command& aCommand,
163 sal_Int32 CommandId,
164 const com::sun::star::uno::Reference<
165 com::sun::star::ucb::XCommandEnvironment >& Environment )
166 throw( com::sun::star::uno::Exception,
167 com::sun::star::ucb::CommandAbortedException,
168 com::sun::star::uno::RuntimeException );
169 virtual void SAL_CALL
170 abort( sal_Int32 CommandId )
171 throw( com::sun::star::uno::RuntimeException );
173 //////////////////////////////////////////////////////////////////////
174 // Additional interfaces
175 //////////////////////////////////////////////////////////////////////
177 // @@@ Add additional interfaces ( like com::sun:.star::ucb::XContentCreator ).
179 //////////////////////////////////////////////////////////////////////
180 // Non-interface methods.
181 //////////////////////////////////////////////////////////////////////
183 // Called from resultset data supplier.
184 static ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow >
185 getPropertyValues( const ::com::sun::star::uno::Reference<
186 ::com::sun::star::lang::XMultiServiceFactory >& rSMgr,
187 const ::com::sun::star::uno::Sequence<
188 ::com::sun::star::beans::Property >& rProperties,
189 const ::rtl::Reference<ContentProperties>& rData,
190 const ::rtl::Reference<
191 ::ucbhelper::ContentProviderImplHelper >& rProvider,
192 const ::rtl::OUString& rContentId );
194 ContentProvider* getContentProvider() const { return m_pProvider; }
199 #endif