Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_sw / bookmrk.hxx
blob375936ccd79838c527126fa61a3bfa49abc2c211
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: bookmrk.hxx,v $
10 * $Revision: 1.9 $
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 ************************************************************************/
30 #ifndef _BOOKMRK_HXX
31 #define _BOOKMRK_HXX
33 //die Attribut richtig angezogen werden.
34 #ifndef _SFXMACITEM_HXX
35 #include <bf_svtools/macitem.hxx>
36 #endif
38 #ifndef _KEYCOD_HXX //autogen
39 #include <vcl/keycod.hxx>
40 #endif
41 #ifndef _TOOLS_REF_HXX
42 #include <tools/ref.hxx>
43 #endif
45 #ifndef _BKMRKE_HXX
46 #include <bkmrke.hxx>
47 #endif
48 #ifndef _CALBCK_HXX
49 #include <calbck.hxx>
50 #endif
51 namespace binfilter {
53 #ifndef SW_DECL_SWSERVEROBJECT_DEFINED
54 #define SW_DECL_SWSERVEROBJECT_DEFINED
55 SV_DECL_REF( SwServerObject )
56 #endif
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
69 protected:
70 SvxMacro aStartMacro;
71 SvxMacro aEndMacro;
72 String aName;
73 String aShortName;
74 KeyCode aCode;
75 BOOKMARK_TYPE eMarkType;
77 public:
79 SwBookmark(const SwPosition& aPos,
80 const KeyCode& rCode,
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; }
88 // nicht undofaehig
89 void SetName(const String& rNewName) { aName = rNewName; }
90 const String& GetName() const { return aName; }
91 // nicht undofaehig
92 void SetShortName(const String& rNewSName) { aShortName = rNewSName; }
93 const String& GetShortName() const { return aShortName; }
94 // nicht undofaehig
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; }
119 private:
120 // fuer METWARE:
121 // es wird (vorerst) nicht kopiert und nicht zugewiesen
122 SwBookmark(const SwBookmark &);
123 SwBookmark &operator=(const SwBookmark &);
127 class SwUNOMark: public SwBookmark
129 public:
130 SwUNOMark(const SwPosition& aPos,
131 const KeyCode& rCode,
132 const String& rName, const String& rShortName);
136 } //namespace binfilter
137 #endif