xref: /aoo4110/main/sw/inc/unoparaframeenum.hxx (revision b1cdbd2c)
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 #ifndef SW_UNOPARAFRAMEENUM_HXX
25 #define SW_UNOPARAFRAMEENUM_HXX
26 
27 #include <deque>
28 
29 #include <boost/shared_ptr.hpp>
30 
31 #include <com/sun/star/lang/XServiceInfo.hpp>
32 #include <com/sun/star/container/XEnumeration.hpp>
33 #include <com/sun/star/text/XTextContent.hpp>
34 
35 #include <cppuhelper/implbase2.hxx>
36 
37 #include <unobaseclass.hxx>
38 
39 
40 class SwDepend;
41 class SwNodeIndex;
42 class SwPaM;
43 class SwFrmFmt;
44 
45 
46 struct FrameDependSortListEntry
47 {
48     xub_StrLen nIndex;
49     sal_uInt32 nOrder;
50     ::boost::shared_ptr<SwDepend> pFrameDepend;
51 
FrameDependSortListEntryFrameDependSortListEntry52     FrameDependSortListEntry (xub_StrLen const i_nIndex,
53                 sal_uInt32 const i_nOrder, SwDepend * const i_pDepend)
54         : nIndex(i_nIndex), nOrder(i_nOrder), pFrameDepend(i_pDepend) { }
55 };
56 
57 typedef ::std::deque< FrameDependSortListEntry >
58     FrameDependSortList_t;
59 
60 typedef ::std::deque< ::boost::shared_ptr<SwDepend> >
61     FrameDependList_t;
62 
63 
64 // OD 2004-05-07 #i28701# - adjust 4th parameter
65 void CollectFrameAtNode( SwClient& rClnt, const SwNodeIndex& rIdx,
66                          FrameDependSortList_t & rFrames,
67                          const bool _bAtCharAnchoredObjs );
68 
69 
70 /* -----------------23.03.99 12:57-------------------
71  *
72  * --------------------------------------------------*/
73 
74 enum ParaFrameMode
75 {
76     PARAFRAME_PORTION_PARAGRAPH,
77     PARAFRAME_PORTION_CHAR,
78     PARAFRAME_PORTION_TEXTRANGE,
79 };
80 
81 typedef ::cppu::WeakImplHelper2
82 <   ::com::sun::star::lang::XServiceInfo
83 ,   ::com::sun::star::container::XEnumeration
84 > SwXParaFrameEnumeration_Base;
85 
86 class SwXParaFrameEnumeration
87     : public SwXParaFrameEnumeration_Base
88 {
89 
90 private:
91 
92     class Impl;
93     ::sw::UnoImplPtr<Impl> m_pImpl;
94 
95     virtual ~SwXParaFrameEnumeration();
96 
97 public:
98 
99     SwXParaFrameEnumeration(const SwPaM& rPaM,
100         const enum ParaFrameMode eParaFrameMode, SwFrmFmt *const pFmt = 0);
101 
102     // XServiceInfo
103     virtual ::rtl::OUString SAL_CALL getImplementationName()
104         throw (::com::sun::star::uno::RuntimeException);
105     virtual sal_Bool SAL_CALL supportsService(
106             const ::rtl::OUString& rServiceName)
107         throw (::com::sun::star::uno::RuntimeException);
108     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
109         getSupportedServiceNames()
110         throw (::com::sun::star::uno::RuntimeException);
111 
112     // XEnumeration
113     virtual sal_Bool SAL_CALL hasMoreElements()
114         throw (::com::sun::star::uno::RuntimeException);
115     virtual ::com::sun::star::uno::Any SAL_CALL nextElement()
116         throw (::com::sun::star::container::NoSuchElementException,
117                ::com::sun::star::lang::WrappedTargetException,
118                ::com::sun::star::uno::RuntimeException);
119 
120 };
121 
122 #endif // SW_UNOPARAFRAMEENUM_HXX
123 
124