1*5b190011SAndrew Rist /************************************************************** 2*5b190011SAndrew Rist * 3*5b190011SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*5b190011SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*5b190011SAndrew Rist * distributed with this work for additional information 6*5b190011SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*5b190011SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*5b190011SAndrew Rist * "License"); you may not use this file except in compliance 9*5b190011SAndrew Rist * with the License. You may obtain a copy of the License at 10*5b190011SAndrew Rist * 11*5b190011SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*5b190011SAndrew Rist * 13*5b190011SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*5b190011SAndrew Rist * software distributed under the License is distributed on an 15*5b190011SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*5b190011SAndrew Rist * KIND, either express or implied. See the License for the 17*5b190011SAndrew Rist * specific language governing permissions and limitations 18*5b190011SAndrew Rist * under the License. 19*5b190011SAndrew Rist * 20*5b190011SAndrew Rist *************************************************************/ 21*5b190011SAndrew Rist 22cdf0e10cSrcweir #include "sal/config.h" 23cdf0e10cSrcweir #include "com/sun/star/uno/XComponentContext.hpp" 24cdf0e10cSrcweir #include "cppuhelper/implbase1.hxx" 25cdf0e10cSrcweir #include "com/sun/star/office/XAnnotationAccess.hpp" 26cdf0e10cSrcweir 27cdf0e10cSrcweir namespace css = ::com::sun::star; 28cdf0e10cSrcweir 29cdf0e10cSrcweir class AnnotationAccess: 30cdf0e10cSrcweir public ::cppu::WeakImplHelper1< 31cdf0e10cSrcweir css::office::XAnnotationAccess> 32cdf0e10cSrcweir { 33cdf0e10cSrcweir public: 34cdf0e10cSrcweir explicit AnnotationAccess(css::uno::Reference< css::uno::XComponentContext > const & context); 35cdf0e10cSrcweir 36cdf0e10cSrcweir // ::com::sun::star::office::XAnnotationAccess: 37cdf0e10cSrcweir virtual css::uno::Reference< css::office::XAnnotation > SAL_CALL createAndInsertAnnotation() throw (css::uno::RuntimeException); 38cdf0e10cSrcweir virtual void SAL_CALL removeAnnotation(const css::uno::Reference< css::office::XAnnotation > & annotation) throw (css::uno::RuntimeException, css::lang::IllegalArgumentException); 39cdf0e10cSrcweir virtual css::uno::Reference< css::office::XAnnotationEnumeration > SAL_CALL createAnnotationEnumeration() throw (css::uno::RuntimeException); 40cdf0e10cSrcweir 41cdf0e10cSrcweir private: 42cdf0e10cSrcweir AnnotationAccess(const AnnotationAccess &); // not defined 43cdf0e10cSrcweir AnnotationAccess& operator=(const AnnotationAccess &); // not defined 44cdf0e10cSrcweir 45cdf0e10cSrcweir // destructor is private and will be called indirectly by the release call virtual ~AnnotationAccess() {} 46cdf0e10cSrcweir 47cdf0e10cSrcweir css::uno::Reference< css::uno::XComponentContext > m_xContext; 48cdf0e10cSrcweir }; 49cdf0e10cSrcweir AnnotationAccess(css::uno::Reference<css::uno::XComponentContext> const & context)50cdf0e10cSrcweirAnnotationAccess::AnnotationAccess(css::uno::Reference< css::uno::XComponentContext > const & context) : 51cdf0e10cSrcweir m_xContext(context) 52cdf0e10cSrcweir {} 53cdf0e10cSrcweir 54cdf0e10cSrcweir // ::com::sun::star::office::XAnnotationAccess: createAndInsertAnnotation()55cdf0e10cSrcweircss::uno::Reference< css::office::XAnnotation > SAL_CALL AnnotationAccess::createAndInsertAnnotation() throw (css::uno::RuntimeException) 56cdf0e10cSrcweir { 57cdf0e10cSrcweir // TODO: Exchange the default return implementation for "createAndInsertAnnotation" !!! 58cdf0e10cSrcweir // Exchange the default return implementation. 59cdf0e10cSrcweir // NOTE: Default initialized polymorphic structs can cause problems because of 60cdf0e10cSrcweir // missing default initialization of primitive types of some C++ compilers or 61cdf0e10cSrcweir // different Any initialization in Java and C++ polymorphic structs. 62cdf0e10cSrcweir return css::uno::Reference< css::office::XAnnotation >(); 63cdf0e10cSrcweir } 64cdf0e10cSrcweir removeAnnotation(const css::uno::Reference<css::office::XAnnotation> & annotation)65cdf0e10cSrcweirvoid SAL_CALL AnnotationAccess::removeAnnotation(const css::uno::Reference< css::office::XAnnotation > & annotation) throw (css::uno::RuntimeException, css::lang::IllegalArgumentException) 66cdf0e10cSrcweir { 67cdf0e10cSrcweir // TODO: Insert your implementation for "removeAnnotation" here. 68cdf0e10cSrcweir } 69cdf0e10cSrcweir createAnnotationEnumeration()70cdf0e10cSrcweircss::uno::Reference< css::office::XAnnotationEnumeration > SAL_CALL AnnotationAccess::createAnnotationEnumeration() throw (css::uno::RuntimeException) 71cdf0e10cSrcweir { 72cdf0e10cSrcweir // TODO: Exchange the default return implementation for "createAnnotationEnumeration" !!! 73cdf0e10cSrcweir // Exchange the default return implementation. 74cdf0e10cSrcweir // NOTE: Default initialized polymorphic structs can cause problems because of 75cdf0e10cSrcweir // missing default initialization of primitive types of some C++ compilers or 76cdf0e10cSrcweir // different Any initialization in Java and C++ polymorphic structs. 77cdf0e10cSrcweir return css::uno::Reference< css::office::XAnnotationEnumeration >(); 78cdf0e10cSrcweir } 79cdf0e10cSrcweir 80cdf0e10cSrcweir 81