diff options
Diffstat (limited to 'goodies/inc')
-rw-r--r-- | goodies/inc/agapidll.hxx | 111 | ||||
-rw-r--r-- | goodies/inc/agsdkdll.hxx | 184 | ||||
-rw-r--r-- | goodies/inc/b3dtex.hxx | 385 | ||||
-rw-r--r-- | goodies/inc/b3dtrans.hxx | 371 | ||||
-rw-r--r-- | goodies/inc/b3dvolum.hxx | 119 | ||||
-rw-r--r-- | goodies/inc/chagent.hxx | 234 | ||||
-rw-r--r-- | goodies/inc/chanapi.hxx | 117 | ||||
-rw-r--r-- | goodies/inc/channel.hxx | 148 | ||||
-rw-r--r-- | goodies/inc/chlist.hxx | 266 | ||||
-rw-r--r-- | goodies/inc/chresid.hxx | 75 | ||||
-rw-r--r-- | goodies/inc/chtuner.hxx | 131 | ||||
-rw-r--r-- | goodies/inc/crypt.hxx | 93 | ||||
-rw-r--r-- | goodies/inc/goodies.hrc | 91 | ||||
-rw-r--r-- | goodies/inc/grfmgr.hxx | 453 | ||||
-rw-r--r-- | goodies/inc/mailenum.hxx | 129 | ||||
-rw-r--r-- | goodies/inc/vector3d.hxx | 146 |
16 files changed, 3053 insertions, 0 deletions
diff --git a/goodies/inc/agapidll.hxx b/goodies/inc/agapidll.hxx new file mode 100644 index 000000000000..5be1d87ac46e --- /dev/null +++ b/goodies/inc/agapidll.hxx @@ -0,0 +1,111 @@ +/************************************************************************* + * + * $RCSfile: agapidll.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:30:08 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _AGAPIDLL_HXX +#define _AGAPIDLL_HXX + +#include "tools/agapi.hxx" +#include "agsdkdll.hxx" + +class ChannelList; +class ChannelAgentItem; +class INetURLObject; +class Library; + +class AgentApiDll : public AgentApi +{ + Library* pAgentDll; + ChannelApiFncs aChannelApiFncs; + + FncInitAgent fncInitAgent; + FncShutDownAgent fncShutDownAgent; + FncNewDataPermission fncNewDataPermission; + FncNewData fncNewData; + FncNotifyChannelObjFile fncNotifyChannelObjFile; + FncNotifyChannelObjData fncNotifyChannelObjData; + FncRegisterChannels fncRegisterChannels; + FncRegisterUpdateTransmitter fncRegisterUpdateTransmitter; + +protected: + friend class ChannelList; + virtual BOOL StartAgent(); + +public: + AgentApiDll(ChannelAgentItem* pAgent); + ~AgentApiDll(); + + virtual void InitAgent(); + virtual void ShutDownAgent(); + + virtual BOOL NewDataPermission(const String& rChannelName); + virtual void NewData(const String& rChannelName, const INetURLObject& rURL); + + virtual void NotifyChannelObjFile(const INetURLObject& rURL, + const String& rFileName); + virtual void NotifyChannelObjData(const INetURLObject& rURL, + void* pBuffer, long nOffset, long nLen, long nTotalLen); + + virtual void RegisterChannels(); + virtual void RegisterUpdateTransmitter(); +}; + +#endif //_AGAPIDLL_HXX + diff --git a/goodies/inc/agsdkdll.hxx b/goodies/inc/agsdkdll.hxx new file mode 100644 index 000000000000..d2f0f2b86526 --- /dev/null +++ b/goodies/inc/agsdkdll.hxx @@ -0,0 +1,184 @@ +/************************************************************************* + * + * $RCSfile: agsdkdll.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:30:08 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _AGSDKDLL_HXX +#define _AGSDKDLL_HXX + +#ifndef _SV_CALL +#if defined(WIN) || defined(WNT) || ( defined(OS2) && !defined( ICC )) +#define _SV_CALL _cdecl +#elif defined( ICC ) && defined( OS2 ) +#define _SV_CALL __cdecl +#else +#define _SV_CALL +#endif +#endif + +#define AGSDKDLL_VERSION 2 + +typedef void* AgentInst; + +//////////////////////////////////////////////////////////////////////////////// +// Channel API Functions +// + +enum AgentStreamType { + AS_LOCAL_FILE = 1, + AS_MEMORY = 2 +}; + +typedef void (_SV_CALL *FncChShutDownAgent)(AgentInst pAg); + +typedef void (_SV_CALL *FncChSetLastSuccUpd)(AgentInst pAg); + +typedef void (_SV_CALL *FncChGetChannelObj)(AgentInst pAg, const char* pURL, + AgentStreamType eStreamType, const char* pFileName); + +typedef void (_SV_CALL *FncChAddChannelItem)(AgentInst pAg, const char* pName, + const char* pTransmitter, const char* pChannel, unsigned short nUpdPeriode, + const char* pAgentName ); + +typedef void (_SV_CALL *FncChDelChannelItem)(AgentInst pAg, const char* pChName); + +typedef void (_SV_CALL *FncChSetTransmitter)(AgentInst pAg, const char* pChName, + const char* pURL); + +typedef void (_SV_CALL *FncChSetChannel)(AgentInst pAg, const char* pChName, + const char* pRelURL); + +typedef void (_SV_CALL *FncChSetChannelName)(AgentInst pAg, const char* pChName, + const char* pNewChName); + +typedef void (_SV_CALL *FncChSetUpdPeriode)(AgentInst pAg, const char* pChName, + unsigned short nUpdPeriode); + +typedef void (_SV_CALL *FncChSetChannelAgentName)(AgentInst pAg, const char* pChName, + const char* pAgName); + +typedef void (_SV_CALL *FncChSetUpdateTransmitter)(AgentInst pAg, + const char* pTransmitter); + +typedef const char* (_SV_CALL *FncChGetAgentSourceURL)(AgentInst pAg); + +struct ChannelApiFncs +{ + unsigned short nVersion; + FncChShutDownAgent fncShutDownAgent; + FncChSetLastSuccUpd fncSetLastSuccUpd; + FncChGetChannelObj fncGetChannelObj; + FncChAddChannelItem fncAddChannelItem; + FncChDelChannelItem fncDelChannelItem; + FncChSetTransmitter fncSetTransmitter; + FncChSetChannel fncSetChannel; + FncChSetChannelName fncSetChannelName; + FncChSetUpdPeriode fncSetUpdPeriode; + FncChSetChannelAgentName fncSetChannelAgentName; + FncChSetUpdateTransmitter fncSetUpdateTransmitter; + FncChGetAgentSourceURL fncGetAgentSourceURL; +}; + +//////////////////////////////////////////////////////////////////////////////// +// Agent API Functions +// + +#if defined(WIN) || defined(WNT) || defined(OS2) || defined(UNX) || defined(MAC) +extern "C" { +#endif + +typedef void (_SV_CALL *FncInitAgent)(AgentInst, ChannelApiFncs*); +void _SV_CALL InitAgent(AgentInst, ChannelApiFncs*); + +typedef void (_SV_CALL *FncShutDownAgent)(); +void _SV_CALL ShutDownAgent(); + +// NewDataPermission +// ChannelName +typedef unsigned char (_SV_CALL *FncNewDataPermission)(const char*); +unsigned char _SV_CALL NewDataPermission(const char*); + +// NewData +// ChannelName, URL +typedef void (_SV_CALL *FncNewData)(const char*, const char*); +void _SV_CALL NewData(const char*, const char*); + +// NotifyChannelObjFile +// URL, abs. Filename +typedef void (_SV_CALL *FncNotifyChannelObjFile)(const char*, const char*); +void _SV_CALL NotifyChannelObjFile(const char*, const char*); + +// NotifyChannelObjData +// URL, Buffer, Offset, Len, TotalLen +typedef void (_SV_CALL *FncNotifyChannelObjData)(const char*, void*, long, long, long); +void _SV_CALL NotifyChannelObjData(const char*, void*, long, long, long); + +typedef void (_SV_CALL *FncRegisterChannels)(AgentInst, ChannelApiFncs*); +void _SV_CALL RegisterChannels(AgentInst, ChannelApiFncs*); + +typedef void (_SV_CALL *FncRegisterUpdateTransmitter)(AgentInst, ChannelApiFncs*); +void _SV_CALL RegisterUpdateTransmitter(AgentInst, ChannelApiFncs*); + +#if defined(WIN) || defined(WNT) || defined(OS2) || defined(UNX) || defined(MAC) +} +#endif + +#endif //_AGSDKDLL_HXX + + diff --git a/goodies/inc/b3dtex.hxx b/goodies/inc/b3dtex.hxx new file mode 100644 index 000000000000..3aeecdb85de1 --- /dev/null +++ b/goodies/inc/b3dtex.hxx @@ -0,0 +1,385 @@ +/************************************************************************* + * + * $RCSfile: b3dtex.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:30:08 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _B3D_B3DTEX_HXX +#define _B3D_B3DTEX_HXX + +#ifndef _SV_OPENGL_HXX +#include <vcl/opengl.hxx> +#endif + +#ifndef _SV_BITMAP_HXX +#include <vcl/bitmap.hxx> +#endif + +#ifndef _SV_COLOR_HXX +#include <vcl/color.hxx> +#endif + +#ifndef _SV_SALBTYPE_HXX +#include <vcl/salbtype.hxx> +#endif + +// Vorausdeklarationen +class BitmapReadAccess; +class BitmapColor; + +/************************************************************************* +|* +|* define fuer die Ueberlebensdauer einer Textur +|* +\************************************************************************/ + +#define B3D_TEXTURE_LIFETIME (200) + +/************************************************************************* +|* +|* Long-Zeiger fuer OpenGL Texturdatenuebergabe +|* +\************************************************************************/ + +#ifdef WIN +typedef UINT8 huge* GL_UINT8; +#else +typedef UINT8* GL_UINT8; +#endif + +/************************************************************************* +|* +|* Art der Pixeldaten der Textur +|* +\************************************************************************/ + +enum Base3DTextureKind +{ + Base3DTextureLuminance = 1, + Base3DTextureIntensity, + Base3DTextureColor +}; + +/************************************************************************* +|* +|* Modus der Textur +|* +\************************************************************************/ + +enum Base3DTextureMode +{ + Base3DTextureReplace = 1, + Base3DTextureModulate, + Base3DTextureBlend +}; + +/************************************************************************* +|* +|* Filtermodus der Textur +|* +\************************************************************************/ + +enum Base3DTextureFilter +{ + Base3DTextureNearest = 1, + Base3DTextureLinear +}; + +/************************************************************************* +|* +|* Wrapping-Modus +|* +\************************************************************************/ + +enum Base3DTextureWrap +{ + Base3DTextureClamp = 1, + Base3DTextureRepeat, + Base3DTextureSingle +}; + +/************************************************************************* +|* +|* Defines fuer Maskenbildung um Entscheidung innerhalb von ModifyColor +|* zu beschleunigen +|* +\************************************************************************/ + +#define B3D_TXT_KIND_LUM 0x00 +#define B3D_TXT_KIND_INT 0x01 +#define B3D_TXT_KIND_COL 0x02 + +#define B3D_TXT_MODE_REP 0x04 +#define B3D_TXT_MODE_MOD 0x08 +#define B3D_TXT_MODE_BND 0x0C + +#define B3D_TXT_FLTR_NEA 0x10 + +/************************************************************************* +|* +|* Klassen fuer TexturAttribute beim Anfordern von Texturen +|* +\************************************************************************/ + +#define TEXTURE_ATTRIBUTE_TYPE_BITMAP 0x0000 +#define TEXTURE_ATTRIBUTE_TYPE_GRADIENT 0x0001 +#define TEXTURE_ATTRIBUTE_TYPE_HATCH 0x0002 + +class TextureAttributes +{ +private: +public: + TextureAttributes(); + + virtual BOOL operator==(const TextureAttributes&) const =0; + virtual UINT16 GetTextureAttributeType() const =0; +}; + +class TextureAttributesBitmap : public TextureAttributes +{ +private: + Bitmap aBitmapAttribute; + +public: + TextureAttributesBitmap(Bitmap aBmp); + + virtual BOOL operator==(const TextureAttributes&) const; + virtual UINT16 GetTextureAttributeType() const; + + Bitmap GetBitmapAttribute() { return aBitmapAttribute; } +}; + +class TextureAttributesGradient : public TextureAttributes +{ +private: + void* pFill; + void* pStepCount; + +public: + TextureAttributesGradient(void* pF, void *pSC); + + virtual BOOL operator==(const TextureAttributes&) const; + virtual UINT16 GetTextureAttributeType() const; + + void* GetFillAttribute() { return pFill; } + void* GetStepCountAttribute() { return pStepCount; } +}; + +class TextureAttributesHatch : public TextureAttributes +{ +private: + void* pFill; + +public: + TextureAttributesHatch(void* pF); + + virtual BOOL operator==(const TextureAttributes&) const; + virtual UINT16 GetTextureAttributeType() const; + + void* GetHatchFillAttribute() { return pFill; } +}; + +/************************************************************************* +|* +|* Klasse fuer Texturen in Base3D +|* +\************************************************************************/ + +class B3dTexture +{ +protected: + // Die Bitmap der Textur + Bitmap aBitmap; + BitmapReadAccess* pReadAccess; + + // Attribute bei der Generierung + TextureAttributes* pAttributes; + + // Gibt die Haeufigkeit der Benutzung wieder + UINT16 nUsageCount; + + // Farbe fuer Base3DTextureBlend - Modus + BitmapColor aColBlend; + + // Farbe, wenn keine Textur an einer Stelle liegt + BitmapColor aColTexture; + + // Art der Textur + Base3DTextureKind eKind; + + // Modus der Textur + Base3DTextureMode eMode; + + // Filter + Base3DTextureFilter eFilter; + + // Wrapping-Modes fuer beide Freiheitsgrade + Base3DTextureWrap eWrapS; + Base3DTextureWrap eWrapT; + + // Entscheidungsvariable + UINT8 nSwitchVal; + + // Vorbestimmbare interne booleans + unsigned bTextureKindChanged : 1; + + // Konstruktor / Destruktor + B3dTexture(TextureAttributes& rAtt, + Bitmap& rBmp, + Base3DTextureKind=Base3DTextureColor, + Base3DTextureMode=Base3DTextureReplace, + Base3DTextureFilter=Base3DTextureNearest, + Base3DTextureWrap eS=Base3DTextureSingle, + Base3DTextureWrap eT=Base3DTextureSingle); + virtual ~B3dTexture(); + + // Interne Zugriffsfunktion auf die BitMapFarben + inline const BitmapColor GetBitmapColor(long nX, long nY); + + // Verwaltung UsageCount + void Touch() { nUsageCount=B3D_TEXTURE_LIFETIME; } + void DecrementUsageCount() { if(nUsageCount) nUsageCount--; } + UINT16 GetUsageCount() { return nUsageCount; }; + void SetSwitchVal(); + +public: + // Zugriff auf die Attribute der Textur + TextureAttributes& GetAttributes(); + + // Zugriff auf Bitmap + Bitmap& GetBitmap() { return aBitmap; } + const Size GetBitmapSize() { return aBitmap.GetSizePixel(); } + + // Texturfunktion + void ModifyColor(Color& rCol, double fS, double fT); + + // Art der Pixeldaten lesen/bestimmen + void SetTextureKind(Base3DTextureKind eNew); + Base3DTextureKind GetTextureKind() { return eKind; } + + // Texturmodus lesen/bestimmen + void SetTextureMode(Base3DTextureMode eNew); + Base3DTextureMode GetTextureMode() { return eMode; } + + // Filtermodus lesen/bestimmen + void SetTextureFilter(Base3DTextureFilter eNew); + Base3DTextureFilter GetTextureFilter() { return eFilter; } + + // Wrapping fuer beide Freiheitsgrade lesen/bestimmen + void SetTextureWrapS(Base3DTextureWrap eNew); + Base3DTextureWrap GetTextureWrapS() { return eWrapS; } + void SetTextureWrapT(Base3DTextureWrap eNew); + Base3DTextureWrap GetTextureWrapT() { return eWrapT; } + + // Blend-Color lesen/bestimmen + void SetBlendColor(Color rNew); + Color GetBlendColor(); + + // Textur-Ersatz-Color lesen/bestimmen + void SetTextureColor(Color rNew); + Color GetTextureColor(); + +protected: + // Zugriff auf Konstruktor/Destruktor nur fuer die verwaltenden Klassen + friend class Base3D; + friend class Base3DOpenGL; + friend class B3dTextureStore; +}; + +/************************************************************************* +|* +|* erweiterte Klasse fuer Texturen in Base3DOpenGL +|* +\************************************************************************/ + +class B3dTextureOpenGL : public B3dTexture +{ +private: + // Name dieser Textur in OpenGL + GLuint nTextureName; + + // Konstruktor / Destruktor + B3dTextureOpenGL(TextureAttributes& rAtt, + Bitmap& rBmp, + OpenGL& rOGL, + Base3DTextureKind=Base3DTextureColor, + Base3DTextureMode=Base3DTextureReplace, + Base3DTextureFilter=Base3DTextureNearest, + Base3DTextureWrap eS=Base3DTextureClamp, + Base3DTextureWrap eT=Base3DTextureClamp); + virtual ~B3dTextureOpenGL(); + + // In OpenGL die Textur zerstoeren + void DestroyOpenGLTexture(OpenGL&); + +public: + // Setze diese Textur in OpenGL als aktuelle Textur + void MakeCurrentTexture(OpenGL&); + + // Erzeuge diese Textur als OpenGL-Textur + void CreateOpenGLTexture(OpenGL&); + +protected: + // Zugriff auf Konstruktor/Destruktor nur fuer die verwaltenden Klassen + friend class Base3D; + friend class Base3DOpenGL; + friend class B3dTextureStore; +}; + + +#endif // _B3D_B3DTEX_HXX diff --git a/goodies/inc/b3dtrans.hxx b/goodies/inc/b3dtrans.hxx new file mode 100644 index 000000000000..75e393515e42 --- /dev/null +++ b/goodies/inc/b3dtrans.hxx @@ -0,0 +1,371 @@ +/************************************************************************* + * + * $RCSfile: b3dtrans.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:30:08 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _B3D_B3DTRANS_HXX +#define _B3D_B3DTRANS_HXX + +#ifndef _B3D_HMATRIX_HXX +#include "hmatrix.hxx" +#endif + +// Zu verwendender DephRange des Z-Buffers +#define ZBUFFER_DEPTH_RANGE (256.0 * 256.0 * 256.0) + +// Vorausdeklarationen +class Base3D; +class B3dVolume; + +/************************************************************************* +|* +|* Unterstuetzte Methoden, um das Seitenverhaeltnis einzuhalten +|* +\************************************************************************/ + +enum Base3DRatio +{ + Base3DRatioGrow = 1, + Base3DRatioShrink, + Base3DRatioMiddle +}; + +/************************************************************************* +|* +|* Typ der Projektion +|* +\************************************************************************/ + +enum Base3DProjectionType +{ + Base3DProjectionTypeParallel = 1, + Base3DProjectionTypePerspective +}; + +/************************************************************************* +|* +|* Transformationen fuer alle 3D Ausgaben +|* +\************************************************************************/ + +class B3dTransformationSet +{ +private: + // Object Matrix Object -> World + Matrix4D aObjectTrans; + Matrix4D aInvObjectTrans; + + // Orientation Matrix + Matrix4D aOrientation; + Matrix4D aInvOrientation; + + // Projection Matrix + Matrix4D aProjection; + Matrix4D aInvProjection; + + // Texture Matrices + Matrix4D aTexture; + + // Speziell zum Umwandeln von Punkten Objekt -> Device + Matrix4D aObjectToDevice; + + // Transponierte Inverse fuer Vectortransformationen + Matrix4D aInvTransObjectToEye; + + // Transformation World->View + Matrix4D aMatFromWorldToView; + Matrix4D aInvMatFromWorldToView; + + // Parameters for ViewportTransformation + Vector3D aScale; + Vector3D aTranslate; + + // ViewPlane DeviceRectangle (vom Benutzer gesetzt) + double fLeftBound; + double fRightBound; + double fBottomBound; + double fTopBound; + + // Near and far clipping planes + double fNearBound; + double fFarBound; + + // Seitenverhaeltnis der 3D Abbildung (Y / X) + // default ist 1:1 -> 1.0 + // Deaktivieren mit 0.0 als Wert + double fRatio; + + // Der gesetzte Ausgabebereich (in logischen Koordinaten) + // und der dazugehoerige sichtbare Bereich + Rectangle aViewportRectangle; + Rectangle aVisibleRectangle; + + // Die tatsaechlich von CalcViewport gesetzten Abmessungen + // des sichtbaren Bereichs (in logischen Koordinaten) + Rectangle aSetBound; + + // Methode zur Aufrechterhaltung des Seitenverhaeltnisses + // default ist Base3DRatioGrow + Base3DRatio eRatio; + + // Flags + unsigned bPerspective : 1; + unsigned bWorldToViewValid : 1; + unsigned bInvTransObjectToEyeValid : 1; + unsigned bObjectToDeviceValid : 1; + unsigned bProjectionValid : 1; + +public: + B3dTransformationSet(); + + // Zurueck auf Standard + void Reset(); + + // ObjectTrans + void SetObjectTrans(Matrix4D& rObj); + const Matrix4D& GetObjectTrans() { return aObjectTrans; } + const Matrix4D& GetInvObjectTrans() { return aInvObjectTrans; } + + // Orientation +#ifndef ICC + void SetOrientation(Vector3D& aVRP = Vector3D(0.0,0.0,1.0), + Vector3D& aVPN = Vector3D(0.0,0.0,1.0), + Vector3D& aVUP = Vector3D(0.0,1.0,0.0)); +#else + void SetOrientation(Vector3D aVRP = Vector3D(0.0,0.0,1.0), + Vector3D aVPN = Vector3D(0.0,0.0,1.0), + Vector3D aVUP = Vector3D(0.0,1.0,0.0)); +#endif + void SetOrientation(Matrix4D& mOrient); + const Matrix4D& GetOrientation() { return aOrientation; } + const Matrix4D& GetInvOrientation() { return aInvOrientation; } + + // Projection + void SetProjection(Matrix4D& mProject); + const Matrix4D& GetProjection(); + const Matrix4D& GetInvProjection(); + + // Texture + void SetTexture(Matrix4D& rTxt); + const Matrix4D& GetTexture() { return aTexture; } + + // Seitenverhaeltnis und Modus zu dessen Aufrechterhaltung + double GetRatio() { return fRatio; } + void SetRatio(double fNew=1.0); + Base3DRatio GetRatioMode() { return eRatio; } + void SetRatioMode(Base3DRatio eNew=Base3DRatioGrow); + + // Parameter der ViewportTransformation + void SetDeviceRectangle(double fL=-1.0, double fR=1.0, double fB=-1.0, double fT=1.0, + BOOL bBroadCastChange=TRUE); + void SetDeviceVolume(const B3dVolume& rVol, BOOL bBroadCastChange=TRUE); + void GetDeviceRectangle(double &fL, double &fR, double& fB, double& fT); + B3dVolume GetDeviceVolume(); + double GetDeviceRectangleWidth() const { return fRightBound - fLeftBound; } + double GetDeviceRectangleHeight() const { return fTopBound - fBottomBound; } + void SetFrontClippingPlane(double fF=0.0); + double GetFrontClippingPlane() { return fNearBound; } + void SetBackClippingPlane(double fB=1.0); + double GetBackClippingPlane() { return fFarBound; } + void SetPerspective(BOOL bNew); + BOOL GetPerspective() { return bPerspective; } + void SetViewportRectangle(Rectangle& rRect, Rectangle& rVisible); + void SetViewportRectangle(Rectangle& rRect) { SetViewportRectangle(rRect, rRect); } + const Rectangle& GetViewportRectangle() { return aViewportRectangle; } + void CalcViewport(); + + // Spezielle Matritzen anfordern + Matrix4D GetMatFromObjectToView(); + + // Transponierte Inverse fuer Vectortransformationen + const Matrix4D& GetInvTransObjectToEye(); + + // Speziell zum Umwandeln von Punkten Objekt -> Device + const Matrix4D& GetObjectToDevice(); + + // Speziell zum Umwandeln von Punkten World -> View + const Matrix4D& GetMatFromWorldToView(); + const Matrix4D& GetInvMatFromWorldToView(); + + // Bounds des Viewports lesen + const Rectangle& GetLogicalViewportBounds(); + const Vector3D& GetScale(); + const Vector3D& GetTranslate(); + + // Direkter Zugriff auf verschiedene Transformationen + const Vector3D WorldToEyeCoor(const Vector3D& rVec); + const Vector3D EyeToWorldCoor(const Vector3D& rVec); + const Vector3D EyeToViewCoor(const Vector3D& rVec); + const Vector3D ViewToEyeCoor(const Vector3D& rVec); + const Vector3D WorldToViewCoor(const Vector3D& rVec); + const Vector3D ViewToWorldCoor(const Vector3D& rVec); + const Vector3D DeviceToViewCoor(const Vector3D& rVec); + const Vector3D ViewToDeviceCoor(const Vector3D& rVec); + const Vector3D ObjectToWorldCoor(const Vector3D& rVec); + const Vector3D WorldToObjectCoor(const Vector3D& rVec); + const Vector3D ObjectToViewCoor(const Vector3D& rVec); + const Vector3D ViewToObjectCoor(const Vector3D& rVec); + const Vector3D ObjectToEyeCoor(const Vector3D& rVec); + const Vector3D EyeToObjectCoor(const Vector3D& rVec); + const Vector3D DeviceToEyeCoor(const Vector3D& rVec); + const Vector3D EyeToDeviceCoor(const Vector3D& rVec); + + const Vector3D InvTransObjectToEye(const Vector3D& rVec); + const Vector3D TransTextureCoor(const Vector3D& rVec); + +protected: + void PostSetObjectTrans(); + void PostSetOrientation(); + void PostSetProjection(); + void PostSetTexture(); + void PostSetViewport(); + + void CalcMatObjectToDevice(); + void CalcMatFromWorldToView(); + void CalcMatInvTransObjectToEye(); + + virtual void DeviceRectangleChange(); +}; + +/************************************************************************* +|* +|* Viewport fuer B3D +|* +|* Verwendet wird hier ein vereinfachtes System, bei dem der abzubildende +|* Punkt durch VRP repraesentiert wird +|* +\************************************************************************/ + +class B3dViewport : public B3dTransformationSet +{ +private: + Vector3D aVRP; // View Reference Point + Vector3D aVPN; // View Plane Normal + Vector3D aVUV; // View Up Vector + +public: + B3dViewport(); + + void SetVRP(const Vector3D& rNewVRP); + void SetVPN(const Vector3D& rNewVPN); + void SetVUV(const Vector3D& rNewVUV); + void SetViewportValues( + const Vector3D& rNewVRP, + const Vector3D& rNewVPN, + const Vector3D& rNewVUV); + + const Vector3D& GetVRP() const { return aVRP; } + const Vector3D& GetVPN() const { return aVPN; } + const Vector3D& GetVUV() const { return aVUV; } + +protected: + void CalcOrientation(); +}; + +/************************************************************************* +|* +|* Kamera fuer B3D +|* +\************************************************************************/ + +class B3dCamera : public B3dViewport +{ +private: + Vector3D aPosition; + Vector3D aCorrectedPosition; + Vector3D aLookAt; + double fFocalLength; + double fBankAngle; + + unsigned bUseFocalLength : 1; + +public: + B3dCamera(const Vector3D& rPos = Vector3D(0.0, 0.0, 1.0), + const Vector3D& rLkAt = Vector3D(0.0, 0.0, 0.0), + double fFocLen = 35.0, double fBnkAng = 0.0, + BOOL bUseFocLen = FALSE); + + // Positionen + void SetPosition(const Vector3D& rNewPos); + const Vector3D& GetPosition() const { return aPosition; } + void SetLookAt(const Vector3D& rNewLookAt); + const Vector3D& GetLookAt() const { return aLookAt; } + void SetPositionAndLookAt(const Vector3D& rNewPos, const Vector3D& rNewLookAt); + + // Brennweite in mm + void SetFocalLength(double fLen); + double GetFocalLength() const { return fFocalLength; } + + // Neigung links/rechts + void SetBankAngle(double fAngle); + double GetBankAngle() const { return fBankAngle; } + + // FocalLength Flag + void SetUseFocalLength(BOOL bNew); + BOOL GetUseFocalLength() const { return (BOOL)bUseFocalLength; } + +protected: + void CalcNewViewportValues(); + BOOL CalcFocalLength(); + + virtual void DeviceRectangleChange(); +}; + + +#endif // _B3D_B3DTRANS_HXX diff --git a/goodies/inc/b3dvolum.hxx b/goodies/inc/b3dvolum.hxx new file mode 100644 index 000000000000..61bf6b7eedf2 --- /dev/null +++ b/goodies/inc/b3dvolum.hxx @@ -0,0 +1,119 @@ +/************************************************************************* + * + * $RCSfile: b3dvolum.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:30:08 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _B3D_VOLUM_HXX +#define _B3D_VOLUM_HXX + +#ifndef _SVX_VECTOR3D_HXX +#include "vector3d.hxx" +#endif + +#ifndef _INC_FLOAT +#include <float.h> +#endif + +#ifndef _STREAM_HXX +#include <tools/stream.hxx> +#endif + +/************************************************************************* +|* +|* dreidimensionales Volumen, symmetrisch zu den Koordinatenachsen +|* +\************************************************************************/ + +class B3dVolume +{ + friend class Vol3DPointIterator; + + protected: + Vector3D aMinVec; + Vector3D aMaxVec; + + public: + B3dVolume(const Vector3D& rPos, const Vector3D& r3DSize, + BOOL bPosIsCenter = TRUE); + B3dVolume(); + + void Reset(); + BOOL IsValid() const; + + B3dVolume& Union(const B3dVolume& rVol2); + B3dVolume& Union(const Vector3D& rVec); + + const Vector3D& MinVec() const { return aMinVec; } + Vector3D& MinVec() { return aMinVec; } + + const Vector3D& MaxVec() const { return aMaxVec; } + Vector3D& MaxVec() { return aMaxVec; } + + double GetWidth() const { return aMaxVec.X() - aMinVec.X(); } + double GetHeight() const { return aMaxVec.Y() - aMinVec.Y(); } + double GetDepth() const { return aMaxVec.Z() - aMinVec.Z(); } + Vector3D GetSize() const; + BOOL IsInside(const Vector3D& rVec); + + friend SvStream& operator>>(SvStream& rIStream, B3dVolume&); + friend SvStream& operator<<(SvStream& rOStream, const B3dVolume&); +}; + + +#endif // _B3D_VOLUM_HXX diff --git a/goodies/inc/chagent.hxx b/goodies/inc/chagent.hxx new file mode 100644 index 000000000000..c0c1a70fbcac --- /dev/null +++ b/goodies/inc/chagent.hxx @@ -0,0 +1,234 @@ +/************************************************************************* + * + * $RCSfile: chagent.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:30:08 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _CHAGENT_HXX +#define _CHAGENT_HXX + +#ifndef _LIST_HXX //autogen +#include <tools/list.hxx> +#endif +#ifndef _URLOBJ_HXX +#include <tools/urlobj.hxx> +#endif + +#include <tools/agitem.hxx> + +class ChannelAgentItem; +class ChannelItem; + +DECLARE_LIST(ChannelAgentItemList,ChannelAgentItem*) + +enum AgentType +{ + AG_TYP_DONTKNOW = 0, + AG_TYP_DLL = 1, + AG_TYP_BASIC = 2, + AG_TYP_JAVA = 3 +}; + +#define STR_AG_TYP_DLL "DLL" +#define STR_AG_TYP_BASIC "BASIC" +#define STR_AG_TYP_JAVA "JAVA" + +class ChannelAgentItem : public AgentItem +{ + AgentType eAgentType; + String aChAgentName; + INetURLObject aLocation; + ULONG nLastSuccUpdDate; + long nLastSuccUpdTime; + INetURLObject aSource; + BOOL bEnabled; + DateTime aLastCheckDate; + + // runtime + BOOL bIsActive; + BOOL bIsInUpdate; + BOOL bRestartAfterUpdate; + + ULONG nChObjDate; + long nChObjTime; + ChannelItem* pActChannel; + AgentApi* pAgentApi; + ChannelApi* pChannelApi; + INetURLObject aSourceURL; + + Link aBTXShutdownCallback; + +protected: + friend class ChannelApi; + void DeleteApis(); + +public: + ChannelAgentItem(); + ~ChannelAgentItem(); + + // Set / Get AgentType + void SetChannelAgentType(AgentType eNew) + { eAgentType = eNew; } + AgentType GetChannelAgentType() const + { return eAgentType; } + + // Set / Get ChAgentName + void SetChAgentName(const String& rNew) + { aChAgentName = rNew; } + virtual const String& GetChAgentName() const + { return aChAgentName; } + + // Set / Get Location + void SetLocation(const INetURLObject& rNew) + { aLocation = rNew; } + virtual const INetURLObject& GetLocation() const + { return aLocation; } + + // Set / Get LastSuccUpdDate + void SetLastSuccUpdDate(ULONG nNew) + { nLastSuccUpdDate = nNew; } + ULONG GetLastSuccUpdDate() const + { return nLastSuccUpdDate; } + + // Set / Get LastSuccUpdTime + void SetLastSuccUpdTime(ULONG nNew) + { nLastSuccUpdTime = nNew; } + ULONG GetLastSuccUpdTime() const + { return nLastSuccUpdTime; } + + // Set / Get LastCheckDate + void SetLastCheckDate( const DateTime& rNew ) + { aLastCheckDate = rNew; } + const DateTime& GetLastCheckDate() + { return aLastCheckDate; } + + // Set / Get Source + void SetSource(const INetURLObject& rNew) + { aSource = rNew; } + const INetURLObject& GetSource() const + { return aSource; } + + // Set / Get Enabled + virtual void SetEnabled(BOOL bNew = TRUE) + { bEnabled = bNew; } + virtual BOOL IsEnabled() const + { return bEnabled; } + + // Set / Get IsActive + virtual void SetIsActive(BOOL bNew) + { bIsActive = bNew; } + virtual BOOL IsActive() const + { return bIsActive; } + + // runtime //////////////////////////////////////////////////////////////// + + const INetURLObject& GetAgentSourceURL() const + { return aSourceURL; } + void SetAgentSourceURL(const INetURLObject& rNew) + { aSourceURL = rNew; } + + // Set / Get ActiveChannel + void SetActiveChannel(ChannelItem* pChItem) + { pActChannel = pChItem; } + ChannelItem* GetActiveChannel() const + { return pActChannel; } + + // Set / Get IsInUpdate + void SetIsInUpdate( BOOL bNew ) + { bIsInUpdate = bNew; } + BOOL IsInUpdate() const + { return bIsInUpdate; } + + // Set / Get RestartAfterUpdate + void SetRestartAfterUpdate( BOOL bNew ) + { bRestartAfterUpdate = bNew; } + BOOL RestartAfterUpdate() const + { return bRestartAfterUpdate; } + + // AgentAPI + void SetApi(AgentApi* pNew ) + { pAgentApi = pNew; } + virtual AgentApi* GetApi() const + { return pAgentApi; } + + // ChannelAPI + void SetChApi(ChannelApi* pNew ) + { pChannelApi = pNew; } + virtual ChApi* GetChApi() const + { return (ChApi*)pChannelApi; } + + // Set / Get ChObjDate + void SetChObjDate(ULONG nNew) + { nChObjDate = nNew; } + ULONG GetChObjDate() const + { return nChObjDate; } + + // Set / Get ChObjTime + void SetChObjTime(long nNew) + { nChObjTime = nNew; } + long GetChObjTime() const + { return nChObjTime; } + + void SetBTXShutDownCallBack(const Link& rLnk ) + { aBTXShutdownCallback = rLnk; } + const Link& GetBTXShutDownCallBack() + { return aBTXShutdownCallback; } + +}; + +#endif // _CHAGENT_HXX diff --git a/goodies/inc/chanapi.hxx b/goodies/inc/chanapi.hxx new file mode 100644 index 000000000000..6831b15505bd --- /dev/null +++ b/goodies/inc/chanapi.hxx @@ -0,0 +1,117 @@ +/************************************************************************* + * + * $RCSfile: chanapi.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:30:08 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _CHANAPI_HXX +#define _CHANAPI_HXX + + +#ifndef _LIST_HXX //autogen +#include <tools/list.hxx> +#endif +#include <tools/chapi.hxx> + +#ifndef _INETSES_HXX //autogen +#include <inet/inetsess.hxx> +#endif + +class ChannelAgentItem; +class ChannelList; +class INetURLObject; +class GetChannelObj; + +DECLARE_LIST(GetChObjList, GetChannelObj*); + +class ChannelApi : public ChApi +{ + INetSessionRef xINetSession; + + ChannelAgentItem* pChAgent; + ChannelList* pChannelList; + + GetChObjList* pGetChObjList; + + DECL_LINK(CloseAgentEvt, void*); + DECL_LINK(CloseChannelObjEvt, void*); + DECL_LINK(GetChannelObjNotify, GetChannelObj*); +public: + ChannelApi( ChannelAgentItem* pAgent, INetSession* pISess, + ChannelList* pChLst ); + ~ChannelApi(); + + void ShutDownAgent(); + void SetLastSuccUpd(); + + void GetChannelObject( const INetURLObject& rURL, RequestType eStreamType, + const String& rFileName ); + void AddChannelItem( const String& aChName, const INetURLObject& aTransmitter, + const String& aChannel, USHORT nUpdPeriode, + const String& rChAgentName ); + void DelChannelItem( const String& aChName ); + void SetChTransmitter( const String& aChName, const String& rNewVal ); + void SetChannel( const String& aChName, const String& rNewVal ); + void SetChannelName( const String& aChName, const String& rNewVal ); + void SetChUpdPeriode( const String& aChName, USHORT nUpdPeriode ); + void SetChannelAgentName( const String& aChName, const String& rNewVal ); + + void SetUpdateTransmitter(ChannelAgentItem* pAgent, const INetURLObject& rTransmitter); +}; + +#endif //_CHANAPI_HXX diff --git a/goodies/inc/channel.hxx b/goodies/inc/channel.hxx new file mode 100644 index 000000000000..90ab84a3fd48 --- /dev/null +++ b/goodies/inc/channel.hxx @@ -0,0 +1,148 @@ +/************************************************************************* + * + * $RCSfile: channel.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:30:08 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _CHANNEL_HXX +#define _CHANNEL_HXX + +#ifndef _LIST_HXX //autogen +#include <tools/list.hxx> +#endif +#ifndef _URLOBJ_HXX +#include <tools/urlobj.hxx> +#endif + +class ChannelItem; +DECLARE_LIST(ChannelItemList,ChannelItem*) + +class ChannelItem +{ + INetURLObject aTransmitter; + String aChannel; + String aChannelName; + String aChannelAgentName; + ULONG nUpdatePeriode; + ULONG nLastTimerTick; + ULONG nLastSuccUpdDate; + long nLastSuccUpdTime; + + BOOL bAgentUpdChannel; + +public: + ChannelItem(); + ~ChannelItem(); + + // Set / Get Transmitter + void SetTransmitter(const INetURLObject& rNew) + { aTransmitter = rNew; } + const INetURLObject& GetTransmitter() const + { return aTransmitter; } + + // Set / Get Channel + void SetChannel(const String& rNew) + { aChannel = rNew; } + const String& GetChannel() const + { return aChannel; } + + // Set / Get ChannelName + void SetChannelName(const String& rNew) + { aChannelName = rNew; } + const String& GetChannelName() const + { return aChannelName; } + + // Set / Get ChannelAgentName + void SetChannelAgentName(const String& rNew) + { aChannelAgentName = rNew; } + const String& GetChannelAgentName() const + { return aChannelAgentName; } + + // Set / Get UpdatePeriode + void SetUpdatePeriode(ULONG nNew) + { nUpdatePeriode = nNew; } + ULONG GetUpdatePeriode() const + { return nUpdatePeriode; } + + // Set / Get LastTimerTick + void SetLastTimerTick(ULONG nNew) + { nLastTimerTick = nNew; } + ULONG GetLastTimerTick() const + { return nLastTimerTick; } + + // Set / Get LastSuccUpdDate + void SetLastSuccUpdDate(ULONG nNew) + { nLastSuccUpdDate = nNew; } + ULONG GetLastSuccUpdDate() const + { return nLastSuccUpdDate; } + + // Set / Get LastSuccUpdTime + void SetLastSuccUpdTime(long nNew) + { nLastSuccUpdTime = nNew; } + long GetLastSuccUpdTime() const + { return nLastSuccUpdTime; } + + // Set / Get AgentUpdChannel + void SetAgentUpdChannel(BOOL bNew) + { bAgentUpdChannel = bNew; } + BOOL GetAgentUpdChannel() const + { return bAgentUpdChannel; } +}; + +#endif // _CHANNEL_HXX + diff --git a/goodies/inc/chlist.hxx b/goodies/inc/chlist.hxx new file mode 100644 index 000000000000..1178e4f05cb0 --- /dev/null +++ b/goodies/inc/chlist.hxx @@ -0,0 +1,266 @@ +/************************************************************************* + * + * $RCSfile: chlist.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:30:08 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _CHLIST_HXX +#define _CHLIST_HXX + +#ifndef _URLOBJ_HXX //autogen +#include <tools/urlobj.hxx> +#endif +#ifndef _DATETIME_HXX //autogen +#include <tools/datetime.hxx> +#endif +#ifndef _STRING_HXX //autogen +#include <tools/string.hxx> +#endif +#ifndef _TIMER_HXX //autogen +#include <vcl/timer.hxx> +#endif +#ifndef _LIST_HXX //autogen +#include <tools/list.hxx> +#endif +#ifndef _INETSES_HXX //autogen +#include <inet/inetsess.hxx> +#endif + +class Downloader; +class ChannelAgentItem; +class ChannelItem; +class ChannelItemList; +class ChannelAgentItemList; +class ChannelTuner; +class ChannelApi; +class GetChannelObj; +class GetChObjList; +class NotifyItem; +class Date; +class Time; +class ResMgr; + +struct UiAgentItem +{ + String aName; + ULONG aUpdPeriode; + DateTime aLastDataDate; + DateTime aLastUpdDate; + BOOL bUnregister; + BOOL bIsEnabled; +}; + +DECLARE_LIST(UiAgentList, UiAgentItem*) +DECLARE_LIST(NotifyList, NotifyItem*) + +#ifndef STRING_LIST +#define STRING_LIST +#if SUPD >= 380 +#define _TOOLS_STRINGLIST +#ifndef _SSTRING_HXX +#include <tools/sstring.hxx> +#endif +#else +DECLARE_LIST(StringList, String*) +#endif +#endif + +/////////////////////////////////////////////////////////////////////////////// +// +// +#define JOBID_DOWNLOAD_AGENT 1 +#define JOBID_UPDATE_AGENT 2 +#define JOBID_CHECK_TRANSMITTER 3 + +struct BTXResponse +{ + USHORT nJobId; + BOOL bFinish; + ULONG nTransferStatus; + String aLocalFileName; +}; + +/////////////////////////////////////////////////////////////////////////////// +// +// +class ChannelList +{ + ResMgr* pResMgr; + ChannelAgentItemList* pAgentList; + ChannelItemList* pChannelList; + NotifyList* pNotifyList; + GetChObjList* pGetChObjList; + UiAgentList* pUiAgentList; + + ChannelTuner* pChannelTuner; + + String aAgentPath; + AutoTimer aTimer; + INetSessionRef xINetSession; + + Link aNotifyPermissionHdl; + Link aCheckFinishHdl; + // wird von der ChannelList gehandelt; sollte ausgebaut werden; auch im SFX + Link aAgentUpdateHdl; + Downloader* pBTXDecoder; + + void MakeGodChannel(ChannelAgentItem* pAgent); + void DeleteUiAgentList(); + + BOOL StartAgent(ChannelAgentItem* pAgent); + + void DoNotifyAgents(); + void NotifyAgent(ChannelAgentItem* pAgent, ULONG nNotifyItemIdx); + + void UpdateAgent(ChannelAgentItem* pAgent, ULONG nNotifyItemIdx); + void SendItemToTuner(ChannelItem* pItem); + + BOOL ParseDateTime(const String& rSrc, Date& rDate, Time& rTime); + + void UnZipAgent(ChannelAgentItem* pAgent); + static void EnumFilesCallBack(char *pFile, void *pObject); + + DECL_LINK(CheckChannels, void*); + DECL_LINK(CloseChannelObjEvt, void*); + DECL_LINK(GetChannelObjNotify, GetChannelObj*); +protected: + friend class ChannelApi; + friend class ChannelTuner; + + ChannelItem* GetChannelItemByName(const String& rName); + ChannelAgentItem* GetAgentItemByName(const String& rName); + + void ReadChannelList(); + void ReadAgentList(); + void WriteChannelItem(ChannelItem* pItem); + void WriteAgentItem(ChannelAgentItem* pChAgent); + void SetLastSuccUpdChannel(ChannelAgentItem* pChAgent); + void SetLastSuccUpdAgent(ChannelAgentItem* pChAgent); + void SetEnabledAgent(ChannelAgentItem* pChAgent); + + void DeleteAgentItem(ChannelAgentItem* pItem); + void DeleteChannelItem(ChannelItem* pItem); + void RegisterNewChannelItem(ChannelItem* pItem); + + void CancelBTX(); + Downloader* GetBTXDecoder() const { return pBTXDecoder; } + ResMgr* GetResMgr() const { return pResMgr; } + + DECL_LINK(CheckBTXFinishHdl, void*); + + void NotifyTransmitterMsg(const String& rStr); + +public: + ChannelList(const String& rAgentPath); + ~ChannelList(); + + void SubscribeNewAgent(const INetURLObject& rURL); + + void SetINetSession(INetSession* pNewSess); + void SetBTXDecoder(Downloader* pDecoder); + + void SetNotifyPermissionHdl(const Link& rHdl) { aNotifyPermissionHdl = rHdl; } + void SetAgentUpdateHdl(const Link& rHdl) { aAgentUpdateHdl = rHdl; } + + void SetTimerInterval(ULONG nNew); + void StartCheckChannels(); + void StopCheckChannels(); + + void CheckAgentNow(const String& rAgName, BOOL bCheckGOD = FALSE); + void SetCheckFinishHdl(const Link& rHdl) { aCheckFinishHdl = rHdl; } + const Link& GetCheckFinishHdl() const { return aCheckFinishHdl;}; + + UiAgentList* GetUiAgentList(); + void JoinUiAgentList(); +}; + +/////////////////////////////////////////////////////////////////////////////// +// +// +class NotifyItem +{ + ChannelItem* pChItem; + + USHORT nGMTOffset; + ULONG nDateLastUpd; + long nTimeLastUpd; + INetURLObject aChObjURL; + String aChName; +public: + NotifyItem( ChannelItem* pItem, short nGMTOff, ULONG nLastDate, + ULONG nLastTime, const INetURLObject& rChObjURL, + const String& rChName); + ~NotifyItem(); + + ChannelItem* GetChannelItem() const { return pChItem; } + + const String& GetChannelName() const { return aChName; } + const INetURLObject GetChannelObjURL() const { return aChObjURL; } + + void SetDateLastUpd(ULONG nNew) { nDateLastUpd = nNew; } + ULONG GetDateLastUpd() const { return nDateLastUpd; } + + void SetTimeLastUpd(long nNew) { nTimeLastUpd = nNew; } + long GetTimeLastUpd() const { return nTimeLastUpd; } + + const String& GetChAgentName() const; + +}; + +#endif // _CHLIST_HXX + diff --git a/goodies/inc/chresid.hxx b/goodies/inc/chresid.hxx new file mode 100644 index 000000000000..91e23ab6fbc1 --- /dev/null +++ b/goodies/inc/chresid.hxx @@ -0,0 +1,75 @@ +/************************************************************************* + * + * $RCSfile: chresid.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:30:08 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHRESID_HXX +#define _CHRESID_HXX + +/////////////////////////////////////////////////////////////////////////////// +// legt den ResourceManager fuer die ChannelList in den APPDaten ab. +// +class ChannelResDll +{ +public: + ChannelResDll(); + ~ChannelResDll(); +}; + +#endif //_CHRESID_HXX + diff --git a/goodies/inc/chtuner.hxx b/goodies/inc/chtuner.hxx new file mode 100644 index 000000000000..feedeafdb7de --- /dev/null +++ b/goodies/inc/chtuner.hxx @@ -0,0 +1,131 @@ +/************************************************************************* + * + * $RCSfile: chtuner.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:30:08 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _CHTUNER_HXX +#define _CHTUNER_HXX + +#ifndef _SV_TIMER_HXX //autogen +#include <vcl/timer.hxx> +#endif +#ifndef _LIST_HXX //autogen +#include <tools/list.hxx> +#endif +#ifndef _INETSESS_HXX +#include <inet/inetsess.hxx> +#endif + + +#ifndef _SFXLSTNER_HXX //autogen +#include <svtools/lstner.hxx> +#endif + +class ChannelItem; +class ChannelList; +class INetRequest; +class Downloader; +class StringList; + +struct RetryInformation +{ + String aURL; + Time aErrorTime; +}; + +DECLARE_LIST(ReqList,INetRequest*) +DECLARE_LIST(RetryList,RetryInformation*) + +class ChannelTuner : public SfxListener +{ + ChannelList* pChannelList; + INetSessionRef xINetSession; + ReqList* pReqList; + + Link aBTXCallBack; + Downloader* pBTXDecoder; + String aBTXFileName; + + AutoTimer aRetryTimer; + RetryList* pRetryList; + + void SendHttpReq(const INetURLObject& rURL); + void SendFtpReq(const INetURLObject& rURL); + void SendBTXReq(const INetURLObject& rURL); + void GetFileTrans(const INetURLObject& rURL); + + void RemoveRequest(INetRequest* pReq); + void NotifyChannelList(String& rStr); + + virtual void SFX_NOTIFY(SfxBroadcaster& rBC, const TypeId& rBCType, + const SfxHint& rHint, const TypeId& rHintType); + + DECL_LINK(RetryCallBack, void*); + DECL_LINK(BTXCallBack, void*); +public: + ChannelTuner(INetSession* pSess, ChannelList* pChList); + ~ChannelTuner(); + + BOOL RequestChannel(ChannelItem* pItem, const Link& rBTXCallBack); + + void SetINetSession(INetSession* pNewSess); + void SetBTXDecoder(Downloader* pDecoder); +}; + +#endif // _CHTUNER_HXX diff --git a/goodies/inc/crypt.hxx b/goodies/inc/crypt.hxx new file mode 100644 index 000000000000..195398f415ea --- /dev/null +++ b/goodies/inc/crypt.hxx @@ -0,0 +1,93 @@ +/************************************************************************* + * + * $RCSfile: crypt.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:30:08 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +// include --------------------------------------------------------------- +#include <tools/gen.hxx> + +// define ---------------------------------------------------------------- + +#define nInOfs 0x00010000UL +#define nOutOfs 0x00020000UL + +// cryptit --------------------------------------------------------------- + +extern "C" +{ +//ULONG testdll(const String& ,const String& , const String&, BOOL DoCrypt ); +//ULONG __EXPORT testdll(const char* pCrInName, const char* pCrOutName, +// const char* pCrKey, BOOL DoCrypt=1); +#if defined (MAC) || defined (UNX) +extern ULONG cryptit(const char* pCrInName, const char* pCrOutName, +#else +#ifdef WNT +extern ULONG __stdcall cryptit(const char* pCrInName, const char* pCrOutName, +#else +#if defined( MTW ) || defined( ICC ) +extern ULONG cryptit(const char* pCrInName, const char* pCrOutName, +#else +extern ULONG __pascal cryptit(const char* pCrInName, const char* pCrOutName, +#endif +#endif +#endif + const char* pCrKey, USHORT DoCrypt); +} + + diff --git a/goodies/inc/goodies.hrc b/goodies/inc/goodies.hrc new file mode 100644 index 000000000000..1ed0c04d9fcb --- /dev/null +++ b/goodies/inc/goodies.hrc @@ -0,0 +1,91 @@ +/************************************************************************* + * + * $RCSfile: goodies.hrc,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:30:08 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _GOODIES_HRC +#define _GOODIES_HRC + +#ifndef _SOLAR_HRC +#include <svtools/solar.hrc> +#endif + +// Dialoge --------------------------------------------------------------- + +#define DLG_EXPORT_EPCT (RID_GOODIES_START+ 0) +#define DLG_EXPORT_GIF (RID_GOODIES_START+ 1) +#define DLG_EXPORT_EMET (RID_GOODIES_START+ 2) +#define DLG_EXPORT_JPG (RID_GOODIES_START+ 3) +#define DLG_IMPORT_PCD (RID_GOODIES_START+ 4) +#define DLG_EXPORT_EPNG (RID_GOODIES_START+ 5) +#define DLG_EXPORT_EPS (RID_GOODIES_START+ 8) +#define DLG_EXPORT_EPBM (RID_GOODIES_START+ 9) +#define DLG_EXPORT_EPGM (RID_GOODIES_START+ 10) +#define DLG_EXPORT_EPPM (RID_GOODIES_START+ 11) +#define DLG_SSL_NEWCERT (RID_GOODIES_START+ 12) +#define DLG_SSL_INFCERT (RID_GOODIES_START+ 13) +#define PAGE_SSL_NEWCERT_OPEN (RID_GOODIES_START+ 14) +#define PAGE_SSL_NEWCERT_SHOWCERT (RID_GOODIES_START+ 15) +#define PAGE_SSL_NEWCERT_ACCEPTCERT (RID_GOODIES_START+ 16) +#define PAGE_SSL_NEWCERT_WARNCERT (RID_GOODIES_START+ 17) +#define PAGE_SSL_NEWCERT_READYCERT (RID_GOODIES_START+ 18) +#define WIN_SSL_INFCERT (RID_GOODIES_START+ 19) +#define WIN_SSL_INFCERT_EDIT (RID_GOODIES_START+ 20) + +#endif + diff --git a/goodies/inc/grfmgr.hxx b/goodies/inc/grfmgr.hxx new file mode 100644 index 000000000000..1d0fb3f78d02 --- /dev/null +++ b/goodies/inc/grfmgr.hxx @@ -0,0 +1,453 @@ +/************************************************************************* + * + * $RCSfile: grfmgr.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:30:09 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _GRFMGR_HXX +#define _GRFMGR_HXX + +#ifndef _SV_GRAPH_HXX +#include <vcl/graph.hxx> +#endif + +// ----------- +// - Defines - +// ----------- + +#define GRFMGR_DRAW_NOTCACHED 0x00000000UL +#define GRFMGR_DRAW_CACHED 0x00000001UL +#define GRFMGR_DRAW_BILINEAR 0x00000002UL +#define GRFMGR_DRAW_STANDARD (GRFMGR_DRAW_CACHED|GRFMGR_DRAW_BILINEAR) + +// -------------------- +// - AutoSwap Defines - +// -------------------- + +#define GRFMGR_AUTOSWAPSTREAM_LINK ((SvStream*)0x00000000UL) +#define GRFMGR_AUTOSWAPSTREAM_LOADED ((SvStream*)0xfffffffdUL) +#define GRFMGR_AUTOSWAPSTREAM_TEMP ((SvStream*)0xfffffffeUL) +#define GRFMGR_AUTOSWAPSTREAM_NONE ((SvStream*)0xffffffffUL) + +// ---------------------- +// - Adjustment Defines - +// ---------------------- + +#define ADJUSTMENT_NONE 0x00000000UL +#define ADJUSTMENT_DRAWMODE 0x00000001UL +#define ADJUSTMENT_COLORS 0x00000002UL +#define ADJUSTMENT_MIRROR 0x00000004UL +#define ADJUSTMENT_ROTATE 0x00000008UL +#define ADJUSTMENT_TRANSPARENCY 0x00000010UL +#define ADJUSTMENT_ALL 0xFFFFFFFFUL + +// --------- +// - Enums - +// --------- + +enum GraphicDrawMode +{ + GRAPHICDRAWMODE_STANDARD = 0, + GRAPHICDRAWMODE_GREYS = 1, + GRAPHICDRAWMODE_MONO = 2, + GRAPHICDRAWMODE_WATERMARK = 3 +}; + +// ------------ +// - Forwards - +// ------------ + +class GraphicManager; +class SvStream; +class BitmapWriteAccess; +class GraphicCache; +struct GrfSimpleCacheObj; + +// --------------- +// - GraphicAttr - +// --------------- + +class GraphicAttr +{ +private: + + Size maLogSize; + double mfGamma; + ULONG mnMirrFlags; + long mnLeftCrop; + long mnTopCrop; + long mnRightCrop; + long mnBottomCrop; + USHORT mnRotate10; + short mnContPercent; + short mnLumPercent; + short mnRPercent; + short mnGPercent; + short mnBPercent; + BOOL mbInvert; + BYTE mcTransparency; + GraphicDrawMode meDrawMode; + Rectangle maCropRect; + + void* mpDummy; + +public: + + GraphicAttr(); + ~GraphicAttr(); + + BOOL operator==( const GraphicAttr& rAttr ) const; + BOOL operator!=( const GraphicAttr& rAttr ) const { return !( *this == rAttr ); } + + void SetDrawMode( GraphicDrawMode eDrawMode ) { meDrawMode = eDrawMode; } + GraphicDrawMode GetDrawMode() const { return meDrawMode; } + + void SetMirrorFlags( ULONG nMirrFlags ) { mnMirrFlags = nMirrFlags; } + ULONG GetMirrorFlags() const { return mnMirrFlags; } + + void SetCrop( long nLeft_100TH_MM, long nTop_100TH_MM, long nRight_100TH_MM, long nBottom_100TH_MM ) + { + mnLeftCrop = nLeft_100TH_MM; mnTopCrop = nTop_100TH_MM; + mnRightCrop = nRight_100TH_MM; mnBottomCrop = nBottom_100TH_MM; + } + long GetLeftCrop() const { return mnLeftCrop; } + long GetTopCrop() const { return mnTopCrop; } + long GetRightCrop() const { return mnRightCrop; } + long GetBottomCrop() const { return mnBottomCrop; } + + void SetRotation( USHORT nRotate10, const Size& rUnrotatedSize ) { mnRotate10 = nRotate10; maLogSize = rUnrotatedSize; } + USHORT GetRotation() const { return mnRotate10; } + + void SetLuminance( short nLuminancePercent ) { mnLumPercent = nLuminancePercent; } + short GetLuminance() const { return mnLumPercent; } + + void SetContrast( short nContrastPercent ) { mnContPercent = nContrastPercent; } + short GetContrast() const { return mnContPercent; } + + void SetChannelR( short nChannelRPercent ) { mnRPercent = nChannelRPercent; } + short GetChannelR() const { return mnRPercent; } + + void SetChannelG( short nChannelGPercent ) { mnGPercent = nChannelGPercent; } + short GetChannelG() const { return mnGPercent; } + + void SetChannelB( short nChannelBPercent ) { mnBPercent = nChannelBPercent; } + short GetChannelB() const { return mnBPercent; } + + void SetGamma( double fGamma ) { mfGamma = fGamma; } + double GetGamma() const { return mfGamma; } + + void SetInvert( BOOL bInvert ) { mbInvert = bInvert; } + BOOL IsInvert() const { return mbInvert; } + + void SetTransparency( BYTE cTransparency ) { mcTransparency = cTransparency; } + BYTE GetTransparency() const { return mcTransparency; } + + const Size& GetUntransformedSize() const { return maLogSize; } + + BOOL IsSpecialDrawMode() const { return( meDrawMode != GRAPHICDRAWMODE_STANDARD ); } + BOOL IsMirrored() const { return( mnMirrFlags != 0UL ); } + BOOL IsCropped() const + { + return( mnLeftCrop != 0 || mnTopCrop != 0 || + mnRightCrop != 0 || mnBottomCrop != 0 ); + } + BOOL IsRotated() const { return( ( mnRotate10 % 3600 ) != 0 ); } + BOOL IsTransparent() const { return( mcTransparency > 0 ); } + BOOL IsAdjusted() const + { + return( mnLumPercent != 0 || mnContPercent != 0 || mnRPercent != 0 || + mnGPercent != 0 || mnBPercent != 0 || mfGamma != 1.0 || mbInvert ); + } + + friend SvStream& operator<<( SvStream& rOStm, const GraphicAttr& rAttr ); + friend SvStream& operator>>( SvStream& rIStm, GraphicAttr& rAttr ); +}; + +// ----------------- +// - GraphicObject - +// ----------------- + +class GraphicObject : public SvDataCopyStream +{ + friend class GraphicManager; + +private: + + static GraphicManager* mpGlobalMgr; + + Graphic maGraphic; + GraphicAttr maAttr; + Size maPrefSize; + MapMode maPrefMapMode; + ULONG mnSizeBytes; + GraphicType meType; + GraphicManager* mpMgr; + String* mpLink; + Link* mpSwapStreamHdl; + void* mpDummy1; + Timer* mpSwapOutTimer; + GrfSimpleCacheObj* mpSimpleCache; + void* mpDummy2; + BOOL mbAutoSwapped : 1; + BOOL mbTransparent : 1; + BOOL mbAnimated : 1; + BOOL mbEPS : 1; + BOOL mbIsInSwapIn : 1; + BOOL mbIsInSwapOut : 1; + BOOL mbDummyFlag7 : 1; + BOOL mbDummyFlag8 : 1; + +#if __PRIVATE + + void ImplConstruct(); + void ImplAssignGraphicData(); + void ImplSetGraphicManager( const GraphicManager* pMgr, const ByteString* pID = NULL ); + void ImplAutoSwapIn( BOOL bIgnoreSwapState ); + BOOL ImplIsAutoSwapped() const { return mbAutoSwapped; } + + DECL_LINK( ImplAutoSwapOutHdl, void* ); + +#endif // __PRIVATE + +protected: + + virtual void GraphicManagerDestroyed(); + virtual SvStream* GetSwapStream() const; + + // !!! to be removed + virtual ULONG GetReleaseFromCache() const; + + virtual void Load( SvStream& ); + virtual void Save( SvStream& ); + virtual void Assign( const SvDataCopyStream& ); + +public: + + TYPEINFO(); + + GraphicObject( const GraphicManager* pMgr = NULL ); + GraphicObject( const Graphic& rGraphic, const GraphicManager* pMgr = NULL ); + GraphicObject( const Graphic& rGraphic, const String& rLink, const GraphicManager* pMgr = NULL ); + GraphicObject( const GraphicObject& rCacheObj, const GraphicManager* pMgr = NULL ); + GraphicObject( const ByteString& rUniqueID, const GraphicManager* pMgr = NULL ); + ~GraphicObject(); + + GraphicObject& operator=( const GraphicObject& rCacheObj ); + BOOL operator==( const GraphicObject& rCacheObj ) const; + BOOL operator!=( const GraphicObject& rCacheObj ) const { return !( *this == rCacheObj ); } + + BOOL HasSwapStreamHdl() const { return( mpSwapStreamHdl != NULL && mpSwapStreamHdl->IsSet() ); } + void SetSwapStreamHdl(); + void SetSwapStreamHdl( const Link& rHdl, const ULONG nSwapOutTimeout = 0UL ); + Link GetSwapStreamHdl() const; + ULONG GetSwapOutTimeout() const { return( mpSwapOutTimer ? mpSwapOutTimer->GetTimeout() : 0 ); } + + void FireSwapInRequest(); + void FireSwapOutRequest(); + + void SetGraphicManager( const GraphicManager& rMgr ); + GraphicManager& GetGraphicManager() const { return *mpMgr; } + + BOOL IsCached( OutputDevice* pOut, const Point& rPt, const Size& rSz, + const GraphicAttr* pAttr = NULL, ULONG nFlags = GRFMGR_DRAW_STANDARD) const; + void ReleaseFromCache(); + + const Graphic& GetGraphic() const; + void SetGraphic( const Graphic& rGraphic ); + void SetGraphic( const Graphic& rGraphic, const String& rLink ); + + Graphic GetTransformedGraphic( const GraphicAttr* pAttr = NULL ) const; + + void SetAttr( const GraphicAttr& rAttr ); + const GraphicAttr& GetAttr() const { return maAttr; } + + BOOL HasLink() const { return( mpLink != NULL && mpLink->Len() > 0 ); } + void SetLink(); + void SetLink( const String& rLink ); + String GetLink() const; + + ByteString GetUniqueID() const; + + GraphicType GetType() const { return meType; } + const Size& GetPrefSize() const { return maPrefSize; } + const MapMode& GetPrefMapMode() const { return maPrefMapMode; } + ULONG GetSizeBytes() const { return mnSizeBytes; } + ULONG GetChecksum() const; + BOOL IsTransparent() const { return mbTransparent; } + BOOL IsAnimated() const { return mbAnimated; } + BOOL IsEPS() const { return mbEPS; } + + void ResetAnimationLoopCount(); + List* GetAnimationInfoList() const; + Link GetAnimationNotifyHdl() const { return maGraphic.GetAnimationNotifyHdl(); } + void SetAnimationNotifyHdl( const Link& rLink ); + + BOOL SwapOut(); + BOOL SwapOut( SvStream* pOStm ); + BOOL SwapIn(); + BOOL SwapIn( SvStream* pIStm ); + + BOOL IsInSwapIn() const { return mbIsInSwapIn; } + BOOL IsInSwapOut() const { return mbIsInSwapOut; } + BOOL IsInSwap() const { return( mbIsInSwapOut || mbIsInSwapOut ); } + BOOL IsSwappedOut() const { return maGraphic.IsSwapOut(); } + + BOOL Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz, + const GraphicAttr* pAttr = NULL, ULONG nFlags = GRFMGR_DRAW_STANDARD ); + + BOOL StartAnimation( OutputDevice* pOut, const Point& rPt, const Size& rSz, long nExtraData = 0L, + const GraphicAttr* pAttr = NULL, ULONG nFlags = GRFMGR_DRAW_STANDARD, + OutputDevice* pFirstFrameOutDev = NULL ); + + void StopAnimation( OutputDevice* pOut = NULL, long nExtraData = 0L ); + + friend SvStream& operator<<( SvStream& rOStm, const GraphicObject& rGraphicObj ); + friend SvStream& operator>>( SvStream& rIStm, GraphicObject& rGraphicObj ); +}; + +// ------------------ +// - GraphicManager - +// ------------------ + +class GraphicManager +{ + friend class GraphicObject; + friend class GraphicDisplayCacheEntry; + +private: + + List maObjList; + GraphicCache* mpCache; + + GraphicManager( const GraphicManager& rGraphicManager ) {} + GraphicManager& operator=( const GraphicManager& rGraphicManager ) { return *this; } + +#if __PRIVATE + + BOOL ImplDraw( OutputDevice* pOut, const Point& rPt, + const Size& rSz, GraphicObject& rObj, + const GraphicAttr& rAttr, BOOL& rCached ); + + BOOL ImplCreateOutput( OutputDevice* pOut, const Point& rPt, const Size& rSz, + const BitmapEx& rBmpEx, const GraphicAttr& rAttr, + BitmapEx* pBmpEx = NULL ); + BOOL ImplCreateOutput( OutputDevice* pOut, const Point& rPt, const Size& rSz, + const GDIMetaFile& rMtf, const GraphicAttr& rAttr, + GDIMetaFile* pMtf = NULL ); + + BOOL ImplCreateScaled( const BitmapEx& rBmpEx, + long* pMapIX, long* pMapFX, long* pMapIY, long* pMapFY, + long nStartX, long nEndX, long nStartY, long nEndY, + BitmapEx& rOutBmpEx ); + + BOOL ImplCreateRotatedScaled( const BitmapEx& rBmpEx, + USHORT nRot10, const Size& rOutSzPix, const Size& rUntSzPix, + long* pMapIX, long* pMapFX, long* pMapIY, long* pMapFY, + long nStartX, long nEndX, long nStartY, long nEndY, + BitmapEx& rOutBmpEx ); + + static void ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, ULONG nAdjustmentFlags ); + static void ImplAdjust( GDIMetaFile& rMtf, const GraphicAttr& rAttr, ULONG nAdjustmentFlags ); + static void ImplAdjust( Animation& rAnimation, const GraphicAttr& rAttr, ULONG nAdjustmentFlags ); + + static void ImplDraw( OutputDevice* pOut, const Point& rPt, const Size& rSz, + const BitmapEx& rBmpEx, const GraphicAttr& rAttr ); + static void ImplDraw( OutputDevice* pOut, const Point& rPt, const Size& rSz, + const GDIMetaFile& rMtf, const GraphicAttr& rAttr ); + + // Only used by GraphicObject's Ctor's and Dtor's + void ImplRegisterObj( const GraphicObject& rObj, Graphic& rSubstitute, const ByteString* pID ); + void ImplUnregisterObj( const GraphicObject& rObj ); + inline BOOL ImplHasObjects() const { return( maObjList.Count() > 0UL ); } + + // Only used in swap case by GraphicObject + void ImplGraphicObjectWasSwappedOut( const GraphicObject& rObj ); + BOOL ImplFillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute ); + void ImplGraphicObjectWasSwappedIn( const GraphicObject& rObj ); + + ByteString ImplGetUniqueID( const GraphicObject& rObj ) const; + +#endif // __PRIVATE + +public: + + GraphicManager( ULONG nCacheSize = 10000000UL, ULONG nMaxObjCacheSize = 2400000UL ); + ~GraphicManager(); + + void SetMaxCacheSize( ULONG nNewCacheSize ); + ULONG GetMaxCacheSize() const; + + void SetMaxObjCacheSize( ULONG nNewMaxObjSize, BOOL bDestroyGreaterCached = FALSE ); + ULONG GetMaxObjCacheSize() const; + + ULONG GetUsedCacheSize() const; + ULONG GetFreeCacheSize() const; + + void ClearCache(); + + void ReleaseFromCache( const GraphicObject& rObj ); + + BOOL IsInCache( OutputDevice* pOut, const Point& rPt, const Size& rSz, + const GraphicObject& rObj, const GraphicAttr& rAttr ) const; + + BOOL DrawObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, + GraphicObject& rObj, const GraphicAttr& rAttr, + const ULONG nFlags, BOOL& rCached ); +}; + +#endif // _GRFMGR_HXX diff --git a/goodies/inc/mailenum.hxx b/goodies/inc/mailenum.hxx new file mode 100644 index 000000000000..ab1542256ca6 --- /dev/null +++ b/goodies/inc/mailenum.hxx @@ -0,0 +1,129 @@ +/************************************************************************* + * + * $RCSfile: mailenum.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:30:09 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _MAILENUM_HXX +#define _MAILENUM_HXX + +// enum ------------------------------------------------------------------ + +enum MailState +{ + MAIL_STATE_SUCCESS = 0, + MAIL_STATE_FAILURE, + MAIL_STATE_ATTACHED_NOT_FOUND, + MAIL_STATE_NO_MEMORY, + MAIL_STATE_LOGIN_FAILURE, + MAIL_STATE_RECEIVER_NOT_FOUND, + MAIL_STATE_TOO_MANY_FILES, + MAIL_STATE_TOO_MANY_RECEIVERS, + MAIL_STATE_NO_RECEIVERS, + MAIL_STATE_USER_CANCEL, + MAIL_STATE_DRIVER_NOT_AVAILABLE +}; + +enum MailDriver +{ + MAIL_DRIVER_DETECT = 0, + MAIL_DRIVER_BEGIN, + MAIL_DRIVER_VIM = MAIL_DRIVER_BEGIN, + MAIL_DRIVER_MAPI, + MAIL_DRIVER_CMC, + MAIL_DRIVER_SMP, + MAIL_DRIVER_UNIX, + MAIL_DRIVER_SMTP, + MAIL_DRIVER_END +}; + +enum MailPriority +{ + MAIL_PRIORITY_LOW = 0, + MAIL_PRIORITY_NORMAL, + MAIL_PRIORITY_URGENT +}; + +enum MailReceiverRole +{ + MAIL_RECEIVER_TO = 0, + MAIL_RECEIVER_CC, + MAIL_RECEIVER_BCC, + MAIL_RECEIVER_NEWSGROUP +}; + +enum MailAction +{ + MAIL_ACTION_DYING, // Server stirbt + MAIL_ACTION_SEND, // Mail wurde versendet + MAIL_ACTION_READ, // Mail wurde als gelesen gekennzeichnet + MAIL_ACTION_REMOVED, // Mail wurde gel"oscht + MAIL_ACTION_UPDATED, // alle Mails wurden neu eingelesen + MAIL_ACTION_NEXT, // Sprung zur n"achsten Mail + MAIL_ACTION_PREV // Sprung zur vorherigen Mail +}; + +// Textformat zum Versenden von Nachrichten ------------------------------ + +#define TXTFORMAT_ASCII ((BYTE)0x01) +#define TXTFORMAT_HTML ((BYTE)0x02) +#define TXTFORMAT_RTF ((BYTE)0x04) +#define TXTFORMAT_OFFICE ((BYTE)0x08) + + +#endif + diff --git a/goodies/inc/vector3d.hxx b/goodies/inc/vector3d.hxx new file mode 100644 index 000000000000..685a1c31051e --- /dev/null +++ b/goodies/inc/vector3d.hxx @@ -0,0 +1,146 @@ +/************************************************************************* + * + * $RCSfile: vector3d.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:30:09 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _SVX_VECTOR3D_HXX +#define _SVX_VECTOR3D_HXX + +#ifndef _SOLAR_H +#include <tools/solar.h> +#endif + +#ifndef _INC_MATH +#include <math.h> +#endif + +class Point; +class SvStream; + +/************************************************************************* +|* +|* 3D-Vektor +|* +\************************************************************************/ + +class Vector3D +{ + protected: + double V[3]; + + public: + Vector3D(double fX = 0, double fY = 0, double fZ = 0) + { V[0] = fX; V[1] = fY; V[2] = fZ; } + Vector3D(const Point& rPnt, double fZ = 0); + const double& X() const { return V[0]; } + const double& Y() const { return V[1]; } + const double& Z() const { return V[2]; } + double& X() { return V[0]; } + double& Y() { return V[1]; } + double& Z() { return V[2]; } + const double& operator[] (int nPos) const { return V[nPos]; } + double& operator[] (int nPos) { return V[nPos]; } + + double GetLength(void) const; + double GetXYLength(void) const; + double GetXZLength(void) const; + double GetYZLength(void) const; + + void Normalize(); + void Min(const Vector3D& rVec); + void Max(const Vector3D& rVec); + void Abs(); + + void CalcInBetween(const Vector3D& rOld1, const Vector3D& rOld2, double t); + void CalcMiddle(const Vector3D& rOld1, const Vector3D& rOld2); + void CalcMiddle(const Vector3D& rOld1, const Vector3D& rOld2, Vector3D& rOld3); + + Vector3D GetPerpendicular2D() const; + + Vector3D& operator+= (const Vector3D&); + Vector3D& operator-= (const Vector3D&); + Vector3D operator+ (const Vector3D&) const; + Vector3D operator- (const Vector3D&) const; + Vector3D operator- (void) const; + + // Kreuzprodukt mittels operator| (wie: Senkrecht) + Vector3D& operator|= (const Vector3D&); + Vector3D operator| (const Vector3D&) const; + + // Skalarprodukt als Methode, um Verwechslungen zu vermeiden + double Scalar(const Vector3D&) const; + + Vector3D& operator/= (const Vector3D&); + Vector3D operator/ (const Vector3D&) const; + Vector3D& operator*= (const Vector3D&); + Vector3D operator* (const Vector3D&) const; + + Vector3D& operator*= (double); + Vector3D operator* (double) const; + Vector3D& operator/= (double); + Vector3D operator/ (double) const; + + BOOL operator== (const Vector3D&) const; + BOOL operator!= (const Vector3D&) const; + + friend SvStream& operator>>(SvStream& rIStream, Vector3D&); + friend SvStream& operator<<(SvStream& rOStream, const Vector3D&); +}; + +#endif // _SVX_VECTOR3D_HXX |