Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_so3 / linkmgr.hxx
blob310ef94f8cb41f38bc284307b58f01d75dca2da4
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: linkmgr.hxx,v $
10 * $Revision: 1.4 $
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 _LINKMGR_HXX
31 #define _LINKMGR_HXX
33 #ifndef _LINKSRC_HXX
34 #include <bf_so3/linksrc.hxx>
35 #endif
36 #ifndef _TOOLS_STRING_HXX
37 #include <tools/string.hxx>
38 #endif
39 #ifndef _SVARRAY_HXX
40 #include <bf_svtools/svarray.hxx>
41 #endif
43 #ifndef INCLUDED_SO3DLLAPI_H
44 #include "bf_so3/so3dllapi.h"
45 #endif
47 namespace binfilter
50 class SvPersist;
51 class SvBaseLink;
52 class SvBaseLinkRef;
54 typedef SvBaseLinkRef* SvBaseLinkRefPtr;
55 SV_DECL_PTRARR( SvBaseLinks, SvBaseLinkRefPtr, 1, 1 )
57 typedef SvLinkSource* SvLinkSourcePtr;
58 SV_DECL_PTRARR( SvLinkSources, SvLinkSourcePtr, 1, 1 )
60 class SO3_DLLPUBLIC SvLinkManager
62 private:
63 SvBaseLinks aLinkTbl;
64 SvLinkSources aServerTbl;
65 SvPersist *pPersist; // LinkMgr muss vor SvPersist freigegeben werden
66 protected:
67 BOOL InsertLink( SvBaseLink* pLink, USHORT nObjType, USHORT nUpdateType,
68 const String* pName = 0 );
69 public:
70 SvLinkManager();
71 virtual ~SvLinkManager();
73 SvPersist* GetPersist() const { return pPersist; }
74 void SetPersist( SvPersist * p ) { pPersist = p; }
76 void Remove( SvBaseLink *pLink );
77 void Remove( USHORT nPos, USHORT nCnt = 1 );
78 BOOL Insert( SvBaseLink* pLink );
80 // den Link mit einem SvLinkSource verbinden und in die Liste eintragen
81 BOOL InsertDDELink( SvBaseLink*,
82 const String& rServer,
83 const String& rTopic,
84 const String& rItem );
86 // falls am Link schon alles eingestellt ist !
87 BOOL InsertDDELink( SvBaseLink* );
89 // erfrage die Strings fuer den Dialog
90 virtual BOOL GetDisplayNames( const SvBaseLink *,
91 String* pType,
92 String* pFile = 0,
93 String* pLink = 0,
94 String* pFilter = 0 ) const;
96 virtual SvLinkSourceRef CreateObj( SvBaseLink * );
98 void UpdateAllLinks( BOOL bCallErrHdl,
99 BOOL bUpdateGrfLinks );
101 // Liste aller Links erfragen (z.B. fuer Verknuepfungs-Dialog)
102 const SvBaseLinks& GetLinks() const { return aLinkTbl; }
104 // ----------------- Serverseitige Verwaltung --------------------
106 // Liste der zu serviereden Links erfragen
107 const SvLinkSources& GetServers() const { return aServerTbl; }
108 // einen zu servierenden Link eintragen/loeschen
109 BOOL InsertServer( SvLinkSource* rObj );
110 void RemoveServer( SvLinkSource* rObj );
111 void RemoveServer( USHORT nPos, USHORT nCnt = 1 )
112 { aServerTbl.Remove( nPos, nCnt ); }
114 private:
115 // diese Methoden gibts nicht!
116 SO3_DLLPRIVATE SvLinkManager( const SvLinkManager& );
117 SO3_DLLPRIVATE SvLinkManager& operator=( const SvLinkManager& );
120 // Trenner im LinkName fuer die DDE-/File-/Grafik- Links
121 // (nur wer es braucht, um einen SvLinkName zusammenzubasteln)
122 const sal_Char cTokenSeperator = '\xff';
124 // erzeuge einen String fuer den SvLinkName. Fuer
125 // - DDE die ersten 3 Strings, (Server, Topic, Item)
126 // - File-/Grf-LinkNms die letzen 3 Strings (FileName, Bereich, Filter)
127 void SO3_DLLPUBLIC MakeLnkName( String& rName,
128 const String* pType, // kann auch 0 sein !!
129 const String& rFile,
130 const String& rLink,
131 const String* pFilter = 0 );
135 #endif