1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: bookmrk.hxx,v $
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 ************************************************************************/
33 //die Attribut richtig angezogen werden.
34 #ifndef _SFXMACITEM_HXX
35 #include <bf_svtools/macitem.hxx>
38 #ifndef _KEYCOD_HXX //autogen
39 #include <vcl/keycod.hxx>
41 #ifndef _TOOLS_REF_HXX
42 #include <tools/ref.hxx>
53 #ifndef SW_DECL_SWSERVEROBJECT_DEFINED
54 #define SW_DECL_SWSERVEROBJECT_DEFINED
55 SV_DECL_REF( SwServerObject
)
59 struct SwPosition
; // fwd Decl. wg. UI
61 class SwBookmark
: public SwModify
63 friend class SwDoc
; // fuers Loeschen
64 friend class Sw3IoImp
; // fuers Setzen der Position(en)
66 SwPosition
*pPos1
, *pPos2
; // wird im CTOR gesetzt, im DTOR geloescht
67 SwServerObjectRef refObj
; // falls DataServer -> Pointer gesetzt
75 BOOKMARK_TYPE eMarkType
;
79 SwBookmark(const SwPosition
& aPos
,
81 const String
& rName
, const String
& rShortName
);
82 // Beim Loeschen von Text werden Bookmarks mitgeloescht!
83 virtual ~SwBookmark();
85 const SwPosition
& GetPos() const { return *pPos1
; }
86 const SwPosition
* GetOtherPos() const { return pPos2
; }
89 void SetName(const String
& rNewName
) { aName
= rNewName
; }
90 const String
& GetName() const { return aName
; }
92 void SetShortName(const String
& rNewSName
) { aShortName
= rNewSName
; }
93 const String
& GetShortName() const { return aShortName
; }
95 void SetKeyCode(const KeyCode
& rNewCode
) { aCode
= rNewCode
; }
96 const KeyCode
& GetKeyCode() const { return aCode
; }
98 // Vergleiche auf Basis der Dokumentposition
99 BOOL
operator < (const SwBookmark
&) const;
100 BOOL
operator ==(const SwBookmark
&) const;
101 // falls man wirklich auf gleiche Position abfragen will.
103 BOOL
IsBookMark() const { return BOOKMARK
== eMarkType
; }
104 BOOL
IsMark() const { return MARK
== eMarkType
; }
105 BOOL
IsDDEMark() const { return DDE_BOOKMARK
== eMarkType
; }
106 BOOL
IsUNOMark() const { return UNO_BOOKMARK
== eMarkType
; }
107 void SetType( BOOKMARK_TYPE eNewType
) { eMarkType
= eNewType
; }
108 BOOKMARK_TYPE
GetType() const { return eMarkType
; }
110 void SetStartMacro(const SvxMacro
& rSt
) { aStartMacro
= rSt
; }
111 const SvxMacro
& GetStartMacro() { return aStartMacro
; }
112 void SetEndMacro(const SvxMacro
& rSt
) { aEndMacro
= rSt
; }
113 const SvxMacro
& GetEndMacro() { return aEndMacro
; }
115 // Daten Server-Methoden
116 const SwServerObject
* GetObject() const { return &refObj
; }
117 SwServerObject
* GetObject() { return &refObj
; }
121 // es wird (vorerst) nicht kopiert und nicht zugewiesen
122 SwBookmark(const SwBookmark
&);
123 SwBookmark
&operator=(const SwBookmark
&);
127 class SwUNOMark
: public SwBookmark
130 SwUNOMark(const SwPosition
& aPos
,
131 const KeyCode
& rCode
,
132 const String
& rName
, const String
& rShortName
);
136 } //namespace binfilter