xref: /AOO41X/main/sw/source/core/inc/noteurl.hxx (revision 1d2dbeb0b7301723c6d13094e87a8714ef81a328)
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 _NOTEURL_HXX
25 #define _NOTEURL_HXX
26 
27 
28 #include <svl/svarray.hxx>
29 #include <tools/string.hxx>
30 #include "swrect.hxx"
31 
32 class ImageMap;
33 class MapMode;
34 
35 class SwURLNote
36 {
37     String aURL;
38     String aTarget;
39     SwRect aRect;
40 public:
SwURLNote(const String & rURL,const String & rTarget,const SwRect & rRect)41     SwURLNote( const String& rURL, const String& rTarget, const SwRect& rRect )
42     : aURL( rURL ), aTarget( rTarget ), aRect( rRect )
43     {}
GetURL() const44     const String& GetURL()      const { return aURL; }
GetTarget() const45     const String& GetTarget()   const { return aTarget; }
GetRect() const46     const SwRect& GetRect()     const { return aRect; }
operator ==(const SwURLNote & rSwURLNote) const47     sal_Bool operator==( const SwURLNote& rSwURLNote ) const
48     { return aRect == rSwURLNote.aRect; }
49 };
50 
51 typedef SwURLNote* SwURLNotePtr;
52 SV_DECL_PTRARR_DEL(SwURLNoteList, SwURLNotePtr, 0, 5)
53 
54 class SwNoteURL
55 {
56     SwURLNoteList aList;
57 public:
SwNoteURL()58     SwNoteURL() {}
Count() const59     sal_uInt16 Count() const { return aList.Count(); }
60     void InsertURLNote( const String& rURL, const String& rTarget,
61                  const SwRect& rRect );
GetURLNote(sal_uInt16 nPos) const62     const SwURLNote& GetURLNote( sal_uInt16 nPos ) const
63         { return *aList.GetObject( nPos ); }
64     void FillImageMap( ImageMap* pMap, const Point& rPos, const MapMode& rMap );
65 };
66 
67 // globale Variable, in NoteURL.Cxx angelegt
68 extern SwNoteURL *pNoteURL;
69 
70 
71 #endif
72 
73