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 // @@@ Adjust multi-include-protection-ifdef. 25 #ifndef _MYUCP_PROVIDER_HXX 26 #define _MYUCP_PROVIDER_HXX 27 28 #include "ucbhelper/providerhelper.hxx" 29 30 // @@@ Adjust namespace name. 31 namespace myucp { 32 33 //========================================================================= 34 35 // @@@ Adjust defines. 36 37 // UNO service name for the provider. This name will be used by the UCB to 38 // create instances of the provider. Prefix with reversed company domain name. 39 #define MYUCP_CONTENT_PROVIDER_SERVICE_NAME \ 40 "com.sun.star.ucb.MyContentProvider" 41 #define MYUCP_CONTENT_PROVIDER_SERVICE_NAME_LENGTH 34 42 43 // URL scheme. This is the scheme the provider will be able to create 44 // contents for. The UCB will select the provider ( i.e. in order to create 45 // contents ) according to this scheme. 46 #define MYUCP_URL_SCHEME \ 47 "vnd.sun.star.myucp" 48 #define MYUCP_URL_SCHEME_LENGTH 18 49 50 // UCB Content Type. 51 #define MYUCP_CONTENT_TYPE \ 52 "application/" MYUCP_URL_SCHEME "-content" 53 54 //========================================================================= 55 56 class ContentProvider : public ::ucbhelper::ContentProviderImplHelper 57 { 58 public: 59 ContentProvider( const ::com::sun::star::uno::Reference< 60 ::com::sun::star::lang::XMultiServiceFactory >& rSMgr ); 61 virtual ~ContentProvider(); 62 63 // XInterface 64 XINTERFACE_DECL() 65 66 // XTypeProvider 67 XTYPEPROVIDER_DECL() 68 69 // XServiceInfo 70 XSERVICEINFO_DECL() 71 72 // XContentProvider 73 virtual ::com::sun::star::uno::Reference< 74 ::com::sun::star::ucb::XContent > SAL_CALL 75 queryContent( const ::com::sun::star::uno::Reference< 76 ::com::sun::star::ucb::XContentIdentifier >& Identifier ) 77 throw( ::com::sun::star::ucb::IllegalIdentifierException, 78 ::com::sun::star::uno::RuntimeException ); 79 80 ////////////////////////////////////////////////////////////////////// 81 // Additional interfaces 82 ////////////////////////////////////////////////////////////////////// 83 84 ////////////////////////////////////////////////////////////////////// 85 // Non-interface methods. 86 ////////////////////////////////////////////////////////////////////// 87 }; 88 89 } 90 91 #endif 92