sync master with lastest vba changes
[ooovba.git] / goodies / inc / chagent.hxx
blobed101cdec4a8999d1c6649b67fb869a4a1a0e561
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: chagent.hxx,v $
10 * $Revision: 1.3 $
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 ************************************************************************/
31 #ifndef _CHAGENT_HXX
32 #define _CHAGENT_HXX
34 #include <tools/list.hxx>
35 #include <tools/urlobj.hxx>
37 #include <tools/agitem.hxx>
39 class ChannelAgentItem;
40 class ChannelItem;
42 DECLARE_LIST(ChannelAgentItemList,ChannelAgentItem*)
44 enum AgentType
46 AG_TYP_DONTKNOW = 0,
47 AG_TYP_DLL = 1,
48 AG_TYP_BASIC = 2,
49 AG_TYP_JAVA = 3
52 #define STR_AG_TYP_DLL "DLL"
53 #define STR_AG_TYP_BASIC "BASIC"
54 #define STR_AG_TYP_JAVA "JAVA"
56 class ChannelAgentItem : public AgentItem
58 AgentType eAgentType;
59 String aChAgentName;
60 INetURLObject aLocation;
61 ULONG nLastSuccUpdDate;
62 long nLastSuccUpdTime;
63 INetURLObject aSource;
64 BOOL bEnabled;
65 DateTime aLastCheckDate;
67 // runtime
68 BOOL bIsActive;
69 BOOL bIsInUpdate;
70 BOOL bRestartAfterUpdate;
72 ULONG nChObjDate;
73 long nChObjTime;
74 ChannelItem* pActChannel;
75 AgentApi* pAgentApi;
76 ChannelApi* pChannelApi;
77 INetURLObject aSourceURL;
79 Link aBTXShutdownCallback;
81 protected:
82 friend class ChannelApi;
83 void DeleteApis();
85 public:
86 ChannelAgentItem();
87 ~ChannelAgentItem();
89 // Set / Get AgentType
90 void SetChannelAgentType(AgentType eNew)
91 { eAgentType = eNew; }
92 AgentType GetChannelAgentType() const
93 { return eAgentType; }
95 // Set / Get ChAgentName
96 void SetChAgentName(const String& rNew)
97 { aChAgentName = rNew; }
98 virtual const String& GetChAgentName() const
99 { return aChAgentName; }
101 // Set / Get Location
102 void SetLocation(const INetURLObject& rNew)
103 { aLocation = rNew; }
104 virtual const INetURLObject& GetLocation() const
105 { return aLocation; }
107 // Set / Get LastSuccUpdDate
108 void SetLastSuccUpdDate(ULONG nNew)
109 { nLastSuccUpdDate = nNew; }
110 ULONG GetLastSuccUpdDate() const
111 { return nLastSuccUpdDate; }
113 // Set / Get LastSuccUpdTime
114 void SetLastSuccUpdTime(ULONG nNew)
115 { nLastSuccUpdTime = nNew; }
116 ULONG GetLastSuccUpdTime() const
117 { return nLastSuccUpdTime; }
119 // Set / Get LastCheckDate
120 void SetLastCheckDate( const DateTime& rNew )
121 { aLastCheckDate = rNew; }
122 const DateTime& GetLastCheckDate()
123 { return aLastCheckDate; }
125 // Set / Get Source
126 void SetSource(const INetURLObject& rNew)
127 { aSource = rNew; }
128 const INetURLObject& GetSource() const
129 { return aSource; }
131 // Set / Get Enabled
132 virtual void SetEnabled(BOOL bNew = TRUE)
133 { bEnabled = bNew; }
134 virtual BOOL IsEnabled() const
135 { return bEnabled; }
137 // Set / Get IsActive
138 virtual void SetIsActive(BOOL bNew)
139 { bIsActive = bNew; }
140 virtual BOOL IsActive() const
141 { return bIsActive; }
143 // runtime ////////////////////////////////////////////////////////////////
145 const INetURLObject& GetAgentSourceURL() const
146 { return aSourceURL; }
147 void SetAgentSourceURL(const INetURLObject& rNew)
148 { aSourceURL = rNew; }
150 // Set / Get ActiveChannel
151 void SetActiveChannel(ChannelItem* pChItem)
152 { pActChannel = pChItem; }
153 ChannelItem* GetActiveChannel() const
154 { return pActChannel; }
156 // Set / Get IsInUpdate
157 void SetIsInUpdate( BOOL bNew )
158 { bIsInUpdate = bNew; }
159 BOOL IsInUpdate() const
160 { return bIsInUpdate; }
162 // Set / Get RestartAfterUpdate
163 void SetRestartAfterUpdate( BOOL bNew )
164 { bRestartAfterUpdate = bNew; }
165 BOOL RestartAfterUpdate() const
166 { return bRestartAfterUpdate; }
168 // AgentAPI
169 void SetApi(AgentApi* pNew )
170 { pAgentApi = pNew; }
171 virtual AgentApi* GetApi() const
172 { return pAgentApi; }
174 // ChannelAPI
175 void SetChApi(ChannelApi* pNew )
176 { pChannelApi = pNew; }
177 virtual ChApi* GetChApi() const
178 { return (ChApi*)pChannelApi; }
180 // Set / Get ChObjDate
181 void SetChObjDate(ULONG nNew)
182 { nChObjDate = nNew; }
183 ULONG GetChObjDate() const
184 { return nChObjDate; }
186 // Set / Get ChObjTime
187 void SetChObjTime(long nNew)
188 { nChObjTime = nNew; }
189 long GetChObjTime() const
190 { return nChObjTime; }
192 void SetBTXShutDownCallBack(const Link& rLnk )
193 { aBTXShutdownCallback = rLnk; }
194 const Link& GetBTXShutDownCallBack()
195 { return aBTXShutdownCallback; }
199 #endif // _CHAGENT_HXX