xref: /aoo42x/main/ucb/source/ucp/ftp/ftpcontent.hxx (revision 6df1ea1f)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _FTP_FTPCONTENT_HXX
25 #define _FTP_FTPCONTENT_HXX
26 
27 #include <ucbhelper/contenthelper.hxx>
28 #include <com/sun/star/ucb/InsertCommandArgument.hpp>
29 #include <com/sun/star/ucb/XContentCreator.hpp>
30 #include "ftpurl.hxx"
31 
32 
33 namespace com { namespace sun { namespace star { namespace beans {
34     struct Property;
35     struct PropertyValue;
36 } } } }
37 
38 namespace com { namespace sun { namespace star { namespace sdbc {
39     class XRow;
40 } } } }
41 
42 
43 namespace ftp
44 {
45 
46 //=========================================================================
47 
48 // UNO service name for the content.
49 #define FTP_CONTENT_SERVICE_NAME "com.sun.star.ucb.FTPContent"
50 
51 //=========================================================================
52 
53     class FTPContentProvider;
54 
55 //=========================================================================
56 
57     class FTPContent
58         : public ::ucbhelper::ContentImplHelper,
59           public com::sun::star::ucb::XContentCreator
60     {
61     public:
62 
63         FTPContent( const ::com::sun::star::uno::Reference<
64                     ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
65                     FTPContentProvider* pProvider,
66                     const ::com::sun::star::uno::Reference<
67                     ::com::sun::star::ucb::XContentIdentifier >& Identifier,
68                     const FTPURL& FtpUrl);
69 
70         FTPContent( const ::com::sun::star::uno::Reference<
71                     ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
72                     FTPContentProvider* pProvider,
73                     const ::com::sun::star::uno::Reference<
74                     ::com::sun::star::ucb::XContentIdentifier >& Identifier,
75                     const com::sun::star::ucb::ContentInfo& aInfo);
76 
77 
78         virtual ~FTPContent();
79 
80         // XInterface
81         XINTERFACE_DECL()
82 
83         // XTypeProvider
84         XTYPEPROVIDER_DECL()
85 
86         // XServiceInfo
87         XSERVICEINFO_DECL()
88 
89         // XContent
90         virtual rtl::OUString SAL_CALL
91         getContentType()
92             throw( com::sun::star::uno::RuntimeException );
93 
94         // XCommandProcessor
95         virtual com::sun::star::uno::Any SAL_CALL
96         execute( const com::sun::star::ucb::Command& aCommand,
97                  sal_Int32 CommandId,
98                  const com::sun::star::uno::Reference<
99                  com::sun::star::ucb::XCommandEnvironment >& Environment )
100             throw( com::sun::star::uno::Exception,
101                    com::sun::star::ucb::CommandAbortedException,
102                    com::sun::star::uno::RuntimeException );
103 
104         virtual void SAL_CALL
105         abort(sal_Int32 CommandId)
106             throw( com::sun::star::uno::RuntimeException);
107 
108         // XContentCreator
109         virtual com::sun::star::uno::Sequence<
110         com::sun::star::ucb::ContentInfo > SAL_CALL
111         queryCreatableContentsInfo(  )
112             throw (com::sun::star::uno::RuntimeException);
113 
114         virtual com::sun::star::uno::Reference<
115         com::sun::star::ucb::XContent > SAL_CALL
116         createNewContent( const com::sun::star::ucb::ContentInfo& Info )
117             throw (com::sun::star::uno::RuntimeException);
118 
119         // XChild
120 
121         virtual ::com::sun::star::uno::Reference<
122         ::com::sun::star::uno::XInterface > SAL_CALL
123         getParent(  )
124             throw (::com::sun::star::uno::RuntimeException);
125 
126         virtual void SAL_CALL
127         setParent( const ::com::sun::star::uno::Reference<
128                    ::com::sun::star::uno::XInterface >& Parent )
129             throw (::com::sun::star::lang::NoSupportException,
130                    ::com::sun::star::uno::RuntimeException);
131 
132 
133         static com::sun::star::uno::Sequence<
134         com::sun::star::ucb::ContentInfo >
135         queryCreatableContentsInfo_Static(  )
136             throw (com::sun::star::uno::RuntimeException);
137 
138     private:
139 
140         FTPContentProvider *m_pFCP;
141         FTPURL              m_aFTPURL;
142         bool                m_bInserted;
143         bool                m_bTitleSet;
144         com::sun::star::ucb::ContentInfo m_aInfo;
145 
146         virtual com::sun::star::uno::Sequence< com::sun::star::beans::Property >
147         getProperties( const com::sun::star::uno::Reference<
148                        com::sun::star::ucb::XCommandEnvironment > & xEnv );
149 
150 
151         virtual com::sun::star::uno::Sequence<
152         com::sun::star::ucb::CommandInfo>
153         getCommands(const com::sun::star::uno::Reference<
154                     com::sun::star::ucb::XCommandEnvironment > & xEnv);
155 
156 
157         virtual ::rtl::OUString getParentURL();
158 
159         com::sun::star::uno::Reference<com::sun::star::sdbc::XRow>
160         getPropertyValues(
161             const com::sun::star::uno::Sequence<
162             com::sun::star::beans::Property>& seqProp,
163             const com::sun::star::uno::Reference<
164             com::sun::star::ucb::XCommandEnvironment >& Environment
165         );
166 
167         com::sun::star::uno::Sequence<com::sun::star::uno::Any>
168         setPropertyValues(
169             const ::com::sun::star::uno::Sequence<
170             ::com::sun::star::beans::PropertyValue>& seqPropVal);
171 
172         void insert(const com::sun::star::ucb::InsertCommandArgument&,
173                     const com::sun::star::uno::Reference<
174                     com::sun::star::ucb::XCommandEnvironment>&);
175     };
176 
177 }
178 
179 #endif
180