xref: /aoo41x/main/sw/inc/unoparaframeenum.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef SW_UNOPARAFRAMEENUM_HXX
29 #define SW_UNOPARAFRAMEENUM_HXX
30 
31 #include <deque>
32 
33 #include <boost/shared_ptr.hpp>
34 
35 #include <com/sun/star/lang/XServiceInfo.hpp>
36 #include <com/sun/star/container/XEnumeration.hpp>
37 #include <com/sun/star/text/XTextContent.hpp>
38 
39 #include <cppuhelper/implbase2.hxx>
40 
41 #include <unobaseclass.hxx>
42 
43 
44 class SwDepend;
45 class SwNodeIndex;
46 class SwPaM;
47 class SwFrmFmt;
48 
49 
50 struct FrameDependSortListEntry
51 {
52     xub_StrLen nIndex;
53     sal_uInt32 nOrder;
54     ::boost::shared_ptr<SwDepend> pFrameDepend;
55 
56     FrameDependSortListEntry (xub_StrLen const i_nIndex,
57                 sal_uInt32 const i_nOrder, SwDepend * const i_pDepend)
58         : nIndex(i_nIndex), nOrder(i_nOrder), pFrameDepend(i_pDepend) { }
59 };
60 
61 typedef ::std::deque< FrameDependSortListEntry >
62     FrameDependSortList_t;
63 
64 typedef ::std::deque< ::boost::shared_ptr<SwDepend> >
65     FrameDependList_t;
66 
67 
68 // OD 2004-05-07 #i28701# - adjust 4th parameter
69 void CollectFrameAtNode( SwClient& rClnt, const SwNodeIndex& rIdx,
70                          FrameDependSortList_t & rFrames,
71                          const bool _bAtCharAnchoredObjs );
72 
73 
74 /* -----------------23.03.99 12:57-------------------
75  *
76  * --------------------------------------------------*/
77 
78 enum ParaFrameMode
79 {
80     PARAFRAME_PORTION_PARAGRAPH,
81     PARAFRAME_PORTION_CHAR,
82     PARAFRAME_PORTION_TEXTRANGE,
83 };
84 
85 typedef ::cppu::WeakImplHelper2
86 <   ::com::sun::star::lang::XServiceInfo
87 ,   ::com::sun::star::container::XEnumeration
88 > SwXParaFrameEnumeration_Base;
89 
90 class SwXParaFrameEnumeration
91     : public SwXParaFrameEnumeration_Base
92 {
93 
94 private:
95 
96     class Impl;
97     ::sw::UnoImplPtr<Impl> m_pImpl;
98 
99     virtual ~SwXParaFrameEnumeration();
100 
101 public:
102 
103     SwXParaFrameEnumeration(const SwPaM& rPaM,
104         const enum ParaFrameMode eParaFrameMode, SwFrmFmt *const pFmt = 0);
105 
106     // XServiceInfo
107     virtual ::rtl::OUString SAL_CALL getImplementationName()
108         throw (::com::sun::star::uno::RuntimeException);
109     virtual sal_Bool SAL_CALL supportsService(
110             const ::rtl::OUString& rServiceName)
111         throw (::com::sun::star::uno::RuntimeException);
112     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
113         getSupportedServiceNames()
114         throw (::com::sun::star::uno::RuntimeException);
115 
116     // XEnumeration
117     virtual sal_Bool SAL_CALL hasMoreElements()
118         throw (::com::sun::star::uno::RuntimeException);
119     virtual ::com::sun::star::uno::Any SAL_CALL nextElement()
120         throw (::com::sun::star::container::NoSuchElementException,
121                ::com::sun::star::lang::WrappedTargetException,
122                ::com::sun::star::uno::RuntimeException);
123 
124 };
125 
126 #endif // SW_UNOPARAFRAMEENUM_HXX
127 
128