sync master with lastest vba changes
[ooovba.git] / binfilter / inc / bf_so3 / lnkbase.hxx
blobcdc1731005b56be0ca6b21e57a7909b152f18429
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: lnkbase.hxx,v $
10 * $Revision: 1.5 $
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 _LNKBASE_HXX
31 #define _LNKBASE_HXX
33 #ifndef _SOT_EXCHANGE_HXX //autogen
34 #include <sot/exchange.hxx>
35 #endif
36 #ifndef _TOOLS_REF_HXX
37 #include <tools/ref.hxx>
38 #endif
39 #ifndef _LINKSOURCE_HXX
40 #include <bf_so3/linksrc.hxx>
41 #endif
43 #ifndef INCLUDED_SO3DLLAPI_H
44 #include "bf_so3/so3dllapi.h"
45 #endif
47 namespace com { namespace sun { namespace star { namespace uno
49 class Any;
50 //class Type;
51 }}}}
53 namespace binfilter
56 struct ImplBaseLinkData;
57 class SvLinkManager;
58 class SvLinkSource;
60 #ifndef OBJECT_DDE_EXTERN
61 #define OBJECT_INTERN 0x00
62 //#define OBJECT_SO_EXTERN 0x01
63 #define OBJECT_DDE_EXTERN 0x02
64 #endif
66 #define OBJECT_CLIENT_SO 0x80 // ein Link
67 #define OBJECT_CLIENT_DDE 0x81
68 //#define OBJECT_CLIENT_OLE 0x82 // ein Ole-Link
69 //#define OBJECT_CLIENT_OLE_CACHE 0x83 // ein Ole-Link mit SvEmbeddedObject
70 #define OBJECT_CLIENT_FILE 0x90
71 #define OBJECT_CLIENT_GRF 0x91
73 enum so3link {
74 // Ole2 compatibel und persistent
75 LINKUPDATE_ALWAYS = 1,
76 LINKUPDATE_ONCALL = 3,
78 LINKUPDATE_END // dummy!
81 class SO3_DLLPUBLIC SvBaseLink : public SvRefBase
83 friend class SvLinkManager;
84 friend class SvLinkSource;
85 private:
86 SvLinkSourceRef xObj;
87 String aLinkName;
88 SvLinkManager* pLinkMgr;
89 USHORT nObjType;
90 BOOL bVisible : 1;
91 BOOL bSynchron : 1;
92 BOOL bUseCache : 1; // fuer GrafikLinks!
94 protected:
95 void SetObjType( USHORT );
97 // setzen des LinkSourceName ohne aktion
98 SO3_DLLPRIVATE void SetName( const String & rLn );
100 ImplBaseLinkData* pImplData;
102 SvBaseLink( USHORT nLinkType, ULONG nContentType = FORMAT_STRING );
103 virtual ~SvBaseLink();
105 void _GetRealObject( BOOL bConnect = TRUE );
107 SO3_DLLPRIVATE SvLinkSource* GetRealObject()
109 if( !xObj.Is() )
110 _GetRealObject();
111 return xObj;
114 public:
115 TYPEINFO();
116 // ask JP
117 virtual void Closed();
119 USHORT GetObjType() const { return nObjType; }
121 SvLinkSource* GetObj() const { return xObj; }
123 void SetLinkSourceName( const String & rName );
124 String GetLinkSourceName() const;
126 virtual void DataChanged( const String & rMimeType,
127 const ::com::sun::star::uno::Any & rValue );
129 void SetUpdateMode( USHORT );
130 USHORT GetUpdateMode() const;
131 ULONG GetContentType() const;
132 BOOL SetContentType( ULONG nType );
134 SvLinkManager* GetLinkManager() { return pLinkMgr; }
135 const SvLinkManager* GetLinkManager() const { return pLinkMgr; }
137 BOOL Update();
138 void Disconnect();
140 virtual BOOL Edit( Window* );
142 // soll der Link im Dialog angezeigt werden ? (Links im Link im ...)
143 BOOL IsVisible() const { return bVisible; }
144 void SetVisible( BOOL bFlag ) { bVisible = bFlag; }
145 // soll der Link synchron oder asynchron geladen werden?
146 BOOL IsSynchron() const { return bSynchron; }
147 void SetSynchron( BOOL bFlag ) { bSynchron = bFlag; }
149 BOOL IsUseCache() const { return bUseCache; }
150 void SetUseCache( BOOL bFlag ) { bUseCache = bFlag; }
153 SV_DECL_IMPL_REF(SvBaseLink);
157 #endif