update dev300-m57
[ooovba.git] / sw / inc / unotextmarkup.hxx
blobef416b3bd228e4ed3c9be01d46469d7b6eca9998
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: unotextmarkup.hxx,v $
10 * $Revision: 1.4 $
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 _UNOTEXTMARKUP_HXX
32 #define _UNOTEXTMARKUP_HXX
34 #include <cppuhelper/implbase1.hxx>
35 #include <cppuhelper/implbase2.hxx>
36 #include <com/sun/star/text/XTextMarkup.hpp>
37 #include <com/sun/star/text/XMultiTextMarkup.hpp>
38 #include <calbck.hxx>
39 #include <modeltoviewhelper.hxx>
41 #include <map>
43 namespace com { namespace sun { namespace star { namespace container {
44 class XStringKeyMap;
45 } } } }
47 class SwTxtNode;
48 class SwWrongList;
49 class SfxPoolItem;
51 /** Implementation of the css::text::XTextMarkup interface
53 class SwXTextMarkup:
54 public ::cppu::WeakImplHelper2
56 ::com::sun::star::text::XTextMarkup,
57 ::com::sun::star::text::XMultiTextMarkup
59 public SwClient
61 public:
62 SwXTextMarkup( SwTxtNode& rTxtNode, const ModelToViewHelper::ConversionMap* pConversionMap );
63 virtual ~SwXTextMarkup();
65 // ::com::sun::star::text::XTextMarkup:
66 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XStringKeyMap > SAL_CALL getMarkupInfoContainer() throw (::com::sun::star::uno::RuntimeException);
67 virtual void SAL_CALL commitTextMarkup(::sal_Int32 nType, const ::rtl::OUString & aIdentifier, ::sal_Int32 nStart, ::sal_Int32 nLength, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XStringKeyMap > & xMarkupInfoContainer) throw (::com::sun::star::uno::RuntimeException);
69 // ::com::sun::star::text::XMultiTextMarkup:
70 virtual void SAL_CALL commitMultiTextMarkup( const ::com::sun::star::uno::Sequence< ::com::sun::star::text::TextMarkupDescriptor >& aMarkups ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
72 //SwClient
73 virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
75 private:
76 SwXTextMarkup( const SwXTextMarkup & ); // not defined
77 SwXTextMarkup & operator =( const SwXTextMarkup & ); // not defined
79 protected:
80 SwTxtNode* mpTxtNode;
81 const ModelToViewHelper::ConversionMap* mpConversionMap;
86 /** Implementation of the ::com::sun::star::container::XStringKeyMap interface
88 class SwXStringKeyMap:
89 public ::cppu::WeakImplHelper1<
90 ::com::sun::star::container::XStringKeyMap>
92 public:
93 SwXStringKeyMap();
95 // ::com::sun::star::container::XStringKeyMap:
96 virtual ::com::sun::star::uno::Any SAL_CALL getValue(const ::rtl::OUString & aKey) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::container::NoSuchElementException);
97 virtual ::sal_Bool SAL_CALL hasValue(const ::rtl::OUString & aKey) throw (::com::sun::star::uno::RuntimeException);
98 virtual void SAL_CALL insertValue(const ::rtl::OUString & aKey, const ::com::sun::star::uno::Any & aValue) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException);
99 virtual ::sal_Int32 SAL_CALL getCount() throw (::com::sun::star::uno::RuntimeException);
100 virtual ::rtl::OUString SAL_CALL getKeyByIndex(::sal_Int32 nIndex) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException);
101 virtual ::com::sun::star::uno::Any SAL_CALL getValueByIndex(::sal_Int32 nIndex) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException);
103 private:
104 SwXStringKeyMap(SwXStringKeyMap &); // not defined
105 void operator =(SwXStringKeyMap &); // not defined
107 virtual ~SwXStringKeyMap() {}
109 std::map< rtl::OUString, ::com::sun::star::uno::Any > maMap;
112 #endif