xref: /trunk/main/ucbhelper/workben/myucp/myucp_provider.hxx (revision 914d351e5f5b84e4342a86d6ab8d4aca7308b9bd)
1*b3b486c3SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*b3b486c3SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*b3b486c3SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*b3b486c3SAndrew Rist  * distributed with this work for additional information
6*b3b486c3SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*b3b486c3SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*b3b486c3SAndrew Rist  * "License"); you may not use this file except in compliance
9*b3b486c3SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*b3b486c3SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*b3b486c3SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*b3b486c3SAndrew Rist  * software distributed under the License is distributed on an
15*b3b486c3SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b3b486c3SAndrew Rist  * KIND, either express or implied.  See the License for the
17*b3b486c3SAndrew Rist  * specific language governing permissions and limitations
18*b3b486c3SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*b3b486c3SAndrew Rist  *************************************************************/
21*b3b486c3SAndrew Rist 
22*b3b486c3SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // @@@ Adjust multi-include-protection-ifdef.
25cdf0e10cSrcweir #ifndef _MYUCP_PROVIDER_HXX
26cdf0e10cSrcweir #define _MYUCP_PROVIDER_HXX
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include "ucbhelper/providerhelper.hxx"
29cdf0e10cSrcweir 
30cdf0e10cSrcweir // @@@ Adjust namespace name.
31cdf0e10cSrcweir namespace myucp {
32cdf0e10cSrcweir 
33cdf0e10cSrcweir //=========================================================================
34cdf0e10cSrcweir 
35cdf0e10cSrcweir // @@@ Adjust defines.
36cdf0e10cSrcweir 
37cdf0e10cSrcweir // UNO service name for the provider. This name will be used by the UCB to
38cdf0e10cSrcweir // create instances of the provider. Prefix with reversed company domain name.
39cdf0e10cSrcweir #define MYUCP_CONTENT_PROVIDER_SERVICE_NAME \
40cdf0e10cSrcweir                 "com.sun.star.ucb.MyContentProvider"
41cdf0e10cSrcweir #define MYUCP_CONTENT_PROVIDER_SERVICE_NAME_LENGTH  34
42cdf0e10cSrcweir 
43cdf0e10cSrcweir // URL scheme. This is the scheme the provider will be able to create
44cdf0e10cSrcweir // contents for. The UCB will select the provider ( i.e. in order to create
45cdf0e10cSrcweir // contents ) according to this scheme.
46cdf0e10cSrcweir #define MYUCP_URL_SCHEME \
47cdf0e10cSrcweir                 "vnd.sun.star.myucp"
48cdf0e10cSrcweir #define MYUCP_URL_SCHEME_LENGTH 18
49cdf0e10cSrcweir 
50cdf0e10cSrcweir // UCB Content Type.
51cdf0e10cSrcweir #define MYUCP_CONTENT_TYPE \
52cdf0e10cSrcweir                 "application/" MYUCP_URL_SCHEME "-content"
53cdf0e10cSrcweir 
54cdf0e10cSrcweir //=========================================================================
55cdf0e10cSrcweir 
56cdf0e10cSrcweir class ContentProvider : public ::ucbhelper::ContentProviderImplHelper
57cdf0e10cSrcweir {
58cdf0e10cSrcweir public:
59cdf0e10cSrcweir     ContentProvider( const ::com::sun::star::uno::Reference<
60cdf0e10cSrcweir                         ::com::sun::star::lang::XMultiServiceFactory >& rSMgr );
61cdf0e10cSrcweir     virtual ~ContentProvider();
62cdf0e10cSrcweir 
63cdf0e10cSrcweir     // XInterface
64cdf0e10cSrcweir     XINTERFACE_DECL()
65cdf0e10cSrcweir 
66cdf0e10cSrcweir     // XTypeProvider
67cdf0e10cSrcweir     XTYPEPROVIDER_DECL()
68cdf0e10cSrcweir 
69cdf0e10cSrcweir     // XServiceInfo
70cdf0e10cSrcweir     XSERVICEINFO_DECL()
71cdf0e10cSrcweir 
72cdf0e10cSrcweir     // XContentProvider
73cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference<
74cdf0e10cSrcweir                 ::com::sun::star::ucb::XContent > SAL_CALL
75cdf0e10cSrcweir     queryContent( const ::com::sun::star::uno::Reference<
76cdf0e10cSrcweir                     ::com::sun::star::ucb::XContentIdentifier >& Identifier )
77cdf0e10cSrcweir         throw( ::com::sun::star::ucb::IllegalIdentifierException,
78cdf0e10cSrcweir                ::com::sun::star::uno::RuntimeException );
79cdf0e10cSrcweir 
80cdf0e10cSrcweir     //////////////////////////////////////////////////////////////////////
81cdf0e10cSrcweir     // Additional interfaces
82cdf0e10cSrcweir     //////////////////////////////////////////////////////////////////////
83cdf0e10cSrcweir 
84cdf0e10cSrcweir     //////////////////////////////////////////////////////////////////////
85cdf0e10cSrcweir     // Non-interface methods.
86cdf0e10cSrcweir     //////////////////////////////////////////////////////////////////////
87cdf0e10cSrcweir };
88cdf0e10cSrcweir 
89cdf0e10cSrcweir }
90cdf0e10cSrcweir 
91cdf0e10cSrcweir #endif
92