diff options
Diffstat (limited to 'goodies/inc')
-rw-r--r-- | goodies/inc/agapidll.hxx | 80 | ||||
-rw-r--r-- | goodies/inc/agsdkdll.hxx | 153 | ||||
-rw-r--r-- | goodies/inc/b3dtrans.hxx | 354 | ||||
-rw-r--r-- | goodies/inc/chagent.hxx | 199 | ||||
-rw-r--r-- | goodies/inc/chanapi.hxx | 84 | ||||
-rw-r--r-- | goodies/inc/channel.hxx | 113 | ||||
-rw-r--r-- | goodies/inc/chlist.hxx | 219 | ||||
-rw-r--r-- | goodies/inc/chresid.hxx | 44 | ||||
-rw-r--r-- | goodies/inc/chtuner.hxx | 94 | ||||
-rw-r--r-- | goodies/inc/crypt.hxx | 62 | ||||
-rw-r--r-- | goodies/inc/goodies.hrc | 60 | ||||
-rw-r--r-- | goodies/inc/grfmgr.hxx | 574 | ||||
-rw-r--r-- | goodies/inc/mailenum.hxx | 98 | ||||
-rw-r--r-- | goodies/inc/makefile.mk | 51 | ||||
-rw-r--r-- | goodies/inc/pch/precompiled_goodies.cxx | 32 | ||||
-rw-r--r-- | goodies/inc/pch/precompiled_goodies.hxx | 174 |
16 files changed, 2391 insertions, 0 deletions
diff --git a/goodies/inc/agapidll.hxx b/goodies/inc/agapidll.hxx new file mode 100644 index 000000000000..a8cd14dcc71d --- /dev/null +++ b/goodies/inc/agapidll.hxx @@ -0,0 +1,80 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: agapidll.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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..2cd9ef7d1e7f --- /dev/null +++ b/goodies/inc/agsdkdll.hxx @@ -0,0 +1,153 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: agsdkdll.hxx,v $ + * $Revision: 1.4 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#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) +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) +} +#endif + +#endif //_AGSDKDLL_HXX + + diff --git a/goodies/inc/b3dtrans.hxx b/goodies/inc/b3dtrans.hxx new file mode 100644 index 000000000000..0d78c918c22c --- /dev/null +++ b/goodies/inc/b3dtrans.hxx @@ -0,0 +1,354 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: b3dtrans.hxx,v $ + * $Revision: 1.6 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _B3D_B3DTRANS_HXX +#define _B3D_B3DTRANS_HXX + +// Zu verwendender DephRange des Z-Buffers +#define ZBUFFER_DEPTH_RANGE ((double)(256L * 256L * 256L)) + +#include <basegfx/matrix/b3dhommatrix.hxx> +#include <basegfx/range/b3drange.hxx> +#include <tools/gen.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <basegfx/point/b2dpoint.hxx> + +// Vorausdeklarationen + +/************************************************************************* +|* +|* 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 + basegfx::B3DHomMatrix maObjectTrans; + basegfx::B3DHomMatrix maInvObjectTrans; + + // Orientation Matrix + basegfx::B3DHomMatrix maOrientation; + basegfx::B3DHomMatrix maInvOrientation; + + // Projection Matrix + basegfx::B3DHomMatrix maProjection; + basegfx::B3DHomMatrix maInvProjection; + + // Texture Matrices + basegfx::B2DHomMatrix maTexture; + + // Speziell zum Umwandeln von Punkten Objekt -> Device + basegfx::B3DHomMatrix maObjectToDevice; + + // Transponierte Inverse fuer Vectortransformationen + basegfx::B3DHomMatrix maInvTransObjectToEye; + + // Transformation World->View + basegfx::B3DHomMatrix maMatFromWorldToView; + basegfx::B3DHomMatrix maInvMatFromWorldToView; + + // Parameters for ViewportTransformation + basegfx::B3DVector maScale; + basegfx::B3DVector maTranslate; + + // ViewPlane DeviceRectangle (vom Benutzer gesetzt) + double mfLeftBound; + double mfRightBound; + double mfBottomBound; + double mfTopBound; + + // Near and far clipping planes + double mfNearBound; + double mfFarBound; + + // Seitenverhaeltnis der 3D Abbildung (Y / X) + // default ist 1:1 -> 1.0 + // Deaktivieren mit 0.0 als Wert + double mfRatio; + + // Der gesetzte Ausgabebereich (in logischen Koordinaten) + // und der dazugehoerige sichtbare Bereich + Rectangle maViewportRectangle; + Rectangle maVisibleRectangle; + + // Die tatsaechlich von CalcViewport gesetzten Abmessungen + // des sichtbaren Bereichs (in logischen Koordinaten) + Rectangle maSetBound; + + // Methode zur Aufrechterhaltung des Seitenverhaeltnisses + // default ist Base3DRatioGrow + Base3DRatio meRatio; + + // Flags + unsigned mbPerspective : 1; + unsigned mbWorldToViewValid : 1; + unsigned mbInvTransObjectToEyeValid : 1; + unsigned mbObjectToDeviceValid : 1; + unsigned mbProjectionValid : 1; + +public: + B3dTransformationSet(); + virtual ~B3dTransformationSet(); + + // Zurueck auf Standard + void Reset(); + + // ObjectTrans + void SetObjectTrans(const basegfx::B3DHomMatrix& rObj); + const basegfx::B3DHomMatrix& GetObjectTrans() { return maObjectTrans; } + const basegfx::B3DHomMatrix& GetInvObjectTrans() { return maInvObjectTrans; } + + // Orientation + void SetOrientation( + basegfx::B3DPoint aVRP = basegfx::B3DPoint(0.0,0.0,1.0), + basegfx::B3DVector aVPN = basegfx::B3DVector(0.0,0.0,1.0), + basegfx::B3DVector aVUP = basegfx::B3DVector(0.0,1.0,0.0)); + void SetOrientation(basegfx::B3DHomMatrix& mOrient); + const basegfx::B3DHomMatrix& GetOrientation() { return maOrientation; } + const basegfx::B3DHomMatrix& GetInvOrientation() { return maInvOrientation; } + + // Projection + void SetProjection(const basegfx::B3DHomMatrix& mProject); + const basegfx::B3DHomMatrix& GetProjection(); + const basegfx::B3DHomMatrix& GetInvProjection(); + + // Texture + void SetTexture(const basegfx::B2DHomMatrix& rTxt); + const basegfx::B2DHomMatrix& GetTexture() { return maTexture; } + + // Seitenverhaeltnis und Modus zu dessen Aufrechterhaltung + double GetRatio() { return mfRatio; } + void SetRatio(double fNew=1.0); + Base3DRatio GetRatioMode() { return meRatio; } + 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, sal_Bool bBroadCastChange=sal_True); + void SetDeviceVolume(const basegfx::B3DRange& rVol, sal_Bool bBroadCastChange=sal_True); + void GetDeviceRectangle(double &fL, double &fR, double& fB, double& fT); + basegfx::B3DRange GetDeviceVolume(); + double GetDeviceRectangleWidth() const { return mfRightBound - mfLeftBound; } + double GetDeviceRectangleHeight() const { return mfTopBound - mfBottomBound; } + void SetFrontClippingPlane(double fF=0.0); + double GetFrontClippingPlane() { return mfNearBound; } + void SetBackClippingPlane(double fB=1.0); + double GetBackClippingPlane() { return mfFarBound; } + void SetPerspective(sal_Bool bNew); + sal_Bool GetPerspective() { return mbPerspective; } + void SetViewportRectangle(Rectangle& rRect, Rectangle& rVisible); + void SetViewportRectangle(Rectangle& rRect) { SetViewportRectangle(rRect, rRect); } + const Rectangle& GetViewportRectangle() { return maViewportRectangle; } + void CalcViewport(); + + // Spezielle Matritzen anfordern + basegfx::B3DHomMatrix GetMatFromObjectToView(); + + // Transponierte Inverse fuer Vectortransformationen + const basegfx::B3DHomMatrix& GetInvTransObjectToEye(); + + // Speziell zum Umwandeln von Punkten Objekt -> Device + const basegfx::B3DHomMatrix& GetObjectToDevice(); + + // Speziell zum Umwandeln von Punkten World -> View + const basegfx::B3DHomMatrix& GetMatFromWorldToView(); + const basegfx::B3DHomMatrix& GetInvMatFromWorldToView(); + + // Bounds des Viewports lesen + const Rectangle& GetLogicalViewportBounds(); + const basegfx::B3DVector& GetScale(); + const basegfx::B3DVector& GetTranslate(); + + // Direkter Zugriff auf verschiedene Transformationen + const basegfx::B3DPoint WorldToEyeCoor(const basegfx::B3DPoint& rVec); + const basegfx::B3DPoint EyeToWorldCoor(const basegfx::B3DPoint& rVec); + const basegfx::B3DPoint EyeToViewCoor(const basegfx::B3DPoint& rVec); + const basegfx::B3DPoint ViewToEyeCoor(const basegfx::B3DPoint& rVec); + const basegfx::B3DPoint WorldToViewCoor(const basegfx::B3DPoint& rVec); + const basegfx::B3DPoint ViewToWorldCoor(const basegfx::B3DPoint& rVec); + const basegfx::B3DPoint DeviceToViewCoor(const basegfx::B3DPoint& rVec); + const basegfx::B3DPoint ViewToDeviceCoor(const basegfx::B3DPoint& rVec); + const basegfx::B3DPoint ObjectToWorldCoor(const basegfx::B3DPoint& rVec); + const basegfx::B3DPoint WorldToObjectCoor(const basegfx::B3DPoint& rVec); + const basegfx::B3DPoint ObjectToViewCoor(const basegfx::B3DPoint& rVec); + const basegfx::B3DPoint ViewToObjectCoor(const basegfx::B3DPoint& rVec); + const basegfx::B3DPoint ObjectToEyeCoor(const basegfx::B3DPoint& rVec); + const basegfx::B3DPoint EyeToObjectCoor(const basegfx::B3DPoint& rVec); + const basegfx::B3DPoint DeviceToEyeCoor(const basegfx::B3DPoint& rVec); + const basegfx::B3DPoint EyeToDeviceCoor(const basegfx::B3DPoint& rVec); + + const basegfx::B3DPoint InvTransObjectToEye(const basegfx::B3DPoint& rVec); + const basegfx::B2DPoint TransTextureCoor(const basegfx::B2DPoint& rVec); + + static void Frustum( + basegfx::B3DHomMatrix& rTarget, + double fLeft = -1.0, double fRight = 1.0, + double fBottom = -1.0, double fTop = 1.0, + double fNear = 0.001, double fFar = 1.0); + static void Ortho( + basegfx::B3DHomMatrix& rTarget, + double fLeft = -1.0, double fRight = 1.0, + double fBottom = -1.0, double fTop = 1.0, + double fNear = 0.0, double fFar = 1.0); + static void Orientation( + basegfx::B3DHomMatrix& rTarget, + basegfx::B3DPoint aVRP = basegfx::B3DPoint(0.0,0.0,1.0), + basegfx::B3DVector aVPN = basegfx::B3DVector(0.0,0.0,1.0), + basegfx::B3DVector aVUP = basegfx::B3DVector(0.0,1.0,0.0)); + +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: + basegfx::B3DPoint aVRP; // View Reference Point + basegfx::B3DVector aVPN; // View Plane Normal + basegfx::B3DVector aVUV; // View Up Vector + +public: + B3dViewport(); + virtual ~B3dViewport(); + + void SetVRP(const basegfx::B3DPoint& rNewVRP); + void SetVPN(const basegfx::B3DVector& rNewVPN); + void SetVUV(const basegfx::B3DVector& rNewVUV); + void SetViewportValues( + const basegfx::B3DPoint& rNewVRP, + const basegfx::B3DVector& rNewVPN, + const basegfx::B3DVector& rNewVUV); + + const basegfx::B3DPoint& GetVRP() const { return aVRP; } + const basegfx::B3DVector& GetVPN() const { return aVPN; } + const basegfx::B3DVector& GetVUV() const { return aVUV; } + +protected: + void CalcOrientation(); +}; + +/************************************************************************* +|* +|* Kamera fuer B3D +|* +\************************************************************************/ + +class B3dCamera : public B3dViewport +{ +private: + basegfx::B3DPoint aPosition; + basegfx::B3DPoint aCorrectedPosition; + basegfx::B3DVector aLookAt; + double fFocalLength; + double fBankAngle; + + unsigned bUseFocalLength : 1; + +public: + B3dCamera( + const basegfx::B3DPoint& rPos = basegfx::B3DPoint(0.0, 0.0, 1.0), + const basegfx::B3DVector& rLkAt = basegfx::B3DVector(0.0, 0.0, 0.0), + double fFocLen = 35.0, double fBnkAng = 0.0, + sal_Bool bUseFocLen = sal_False); + virtual ~B3dCamera(); + + // Positionen + void SetPosition(const basegfx::B3DPoint& rNewPos); + const basegfx::B3DPoint& GetPosition() const { return aPosition; } + void SetLookAt(const basegfx::B3DVector& rNewLookAt); + const basegfx::B3DVector& GetLookAt() const { return aLookAt; } + void SetPositionAndLookAt(const basegfx::B3DPoint& rNewPos, const basegfx::B3DVector& 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(sal_Bool bNew); + sal_Bool GetUseFocalLength() const { return (sal_Bool)bUseFocalLength; } + +protected: + void CalcNewViewportValues(); + sal_Bool CalcFocalLength(); + + virtual void DeviceRectangleChange(); +}; + + +#endif // _B3D_B3DTRANS_HXX diff --git a/goodies/inc/chagent.hxx b/goodies/inc/chagent.hxx new file mode 100644 index 000000000000..fcd78184db37 --- /dev/null +++ b/goodies/inc/chagent.hxx @@ -0,0 +1,199 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: chagent.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _CHAGENT_HXX +#define _CHAGENT_HXX + +#include <tools/list.hxx> +#include <tools/urlobj.hxx> + +#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..abbb272ef22f --- /dev/null +++ b/goodies/inc/chanapi.hxx @@ -0,0 +1,84 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: chanapi.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _CHANAPI_HXX +#define _CHANAPI_HXX + + +#include <tools/list.hxx> +#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..bd609bb8d544 --- /dev/null +++ b/goodies/inc/channel.hxx @@ -0,0 +1,113 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: channel.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _CHANNEL_HXX +#define _CHANNEL_HXX + +#include <tools/list.hxx> +#include <tools/urlobj.hxx> + +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..cabf4f381576 --- /dev/null +++ b/goodies/inc/chlist.hxx @@ -0,0 +1,219 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: chlist.hxx,v $ + * $Revision: 1.4 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _CHLIST_HXX +#define _CHLIST_HXX + +#include <tools/urlobj.hxx> +#include <tools/datetime.hxx> +#include <tools/string.hxx> +#include <vcl/timer.hxx> +#include <tools/list.hxx> +#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 +#define _TOOLS_STRINGLIST +#include <tools/sstring.hxx> +#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..aff5898f8003 --- /dev/null +++ b/goodies/inc/chresid.hxx @@ -0,0 +1,44 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: chresid.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#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..7a54c1e05a41 --- /dev/null +++ b/goodies/inc/chtuner.hxx @@ -0,0 +1,94 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: chtuner.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _CHTUNER_HXX +#define _CHTUNER_HXX + +#include <vcl/timer.hxx> +#include <tools/list.hxx> +#ifndef _INETSESS_HXX +#include <inet/inetsess.hxx> +#endif + + +#include <svl/lstner.hxx> + +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..24e4215a3fda --- /dev/null +++ b/goodies/inc/crypt.hxx @@ -0,0 +1,62 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: crypt.hxx,v $ + * $Revision: 1.4 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// 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 (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..139987c4f6ee --- /dev/null +++ b/goodies/inc/goodies.hrc @@ -0,0 +1,60 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: goodies.hrc,v $ + * $Revision: 1.5 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _GOODIES_HRC +#define _GOODIES_HRC + +#ifndef _SOLAR_HRC +#include <svl/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..1ef351ae6d32 --- /dev/null +++ b/goodies/inc/grfmgr.hxx @@ -0,0 +1,574 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: grfmgr.hxx,v $ + * $Revision: 1.23 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _GRFMGR_HXX +#define _GRFMGR_HXX + +#include <vcl/graph.hxx> + +// ----------- +// - Defines - +// ----------- + +#define GRFMGR_DRAW_NOTCACHED 0x00000000UL +#define GRFMGR_DRAW_CACHED 0x00000001UL +#define GRFMGR_DRAW_BILINEAR 0x00000002UL +#define GRFMGR_DRAW_USE_DRAWMODE_SETTINGS 0x00000004UL +#define GRFMGR_DRAW_SUBSTITUTE 0x00000008UL +#define GRFMGR_DRAW_NO_SUBSTITUTE 0x00000010UL +#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; +class VirtualDevice; +struct GrfSimpleCacheObj; +struct ImplTileInfo; + +// --------------- +// - GraphicAttr - +// --------------- + +class GraphicAttr +{ +private: + + long mnDummy1; + long mnDummy2; + double mfGamma; + sal_uInt32 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; + + 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 ) { mnRotate10 = nRotate10; } + 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; } + + 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; + String* mpUserData; + Timer* mpSwapOutTimer; + GrfSimpleCacheObj* mpSimpleCache; + ULONG mnAnimationLoopCount; + void* mpDummy1; + void* mpDummy2; + BOOL mbAutoSwapped : 1; + BOOL mbTransparent : 1; + BOOL mbAnimated : 1; + BOOL mbEPS : 1; + BOOL mbIsInSwapIn : 1; + BOOL mbIsInSwapOut : 1; + BOOL mbAlpha : 1; + BOOL mbDummyFlag8 : 1; + +//#if 0 // _SOLAR__PRIVATE + + void ImplConstruct(); + void ImplAssignGraphicData(); + void ImplSetGraphicManager( const GraphicManager* pMgr, + const ByteString* pID = NULL, + const GraphicObject* pCopyObj = NULL ); + void ImplAutoSwapIn(); + BOOL ImplIsAutoSwapped() const { return mbAutoSwapped; } + BOOL ImplGetCropParams( OutputDevice* pOut, Point& rPt, Size& rSz, const GraphicAttr* pAttr, + PolyPolygon& rClipPolyPoly, BOOL& bRectClipRegion ) const; + + /** Render a given number of tiles in an optimized way + + This method recursively subdivides the tile rendering problem + in smaller parts, i.e. rendering output size x with few tiles + of size y, which in turn are generated from the original + bitmap in a recursive fashion. The subdivision size can be + controlled by the exponent argument, which specifies the + minimal number of smaller tiles used in one recursion + step. The resulting tile size is given as the integer number + of repetitions of the original bitmap along x and y. As the + exponent need not necessarily divide these numbers without + remainder, the repetition counts are effectively converted to + base-exponent numbers, where each place denotes the number of + times the corresponding tile size is rendered. + + @param rVDev + Virtual device to render everything into + + @param nExponent + Number of repetitions per subdivision step, _must_ be greater than 1 + + @param nNumTilesX + Number of original tiles to generate in x direction + + @param nNumTilesY + Number of original tiles to generate in y direction + + @param rTileSizePixel + Size in pixel of the original tile bitmap to render it in + + @param pAttr + Graphic attributes to be used for rendering + + @param nFlags + Graphic flags to be used for rendering + + @param rCurrPos + Current output point for this recursion level (should start with (0,0)) + + @return true, if everything was successfully rendered. + */ + bool ImplRenderTempTile( VirtualDevice& rVDev, int nExponent, + int nNumTilesX, int nNumTilesY, + const Size& rTileSizePixel, + const GraphicAttr* pAttr, ULONG nFlags ); + + /// internally called by ImplRenderTempTile() + bool ImplRenderTileRecursive( VirtualDevice& rVDev, int nExponent, int nMSBFactor, + int nNumOrigTilesX, int nNumOrigTilesY, + int nRemainderTilesX, int nRemainderTilesY, + const Size& rTileSizePixel, const GraphicAttr* pAttr, + ULONG nFlags, ImplTileInfo& rTileInfo ); + + bool ImplDrawTiled( OutputDevice* pOut, const Rectangle& rArea, const Size& rSizePixel, + const Size& rOffset, const GraphicAttr* pAttr, ULONG nFlags, int nTileCacheSize1D ); + + bool ImplDrawTiled( OutputDevice& rOut, const Point& rPos, + int nNumTilesX, int nNumTilesY, + const Size& rTileSize, + const GraphicAttr* pAttr, ULONG nFlags ); + + void ImplTransformBitmap( BitmapEx& rBmpEx, + const GraphicAttr& rAttr, + const Size& rCropLeftTop, + const Size& rCropRightBottom, + const Rectangle& rCropRect, + const Size& rDstSize, + BOOL bEnlarge ) const; + + DECL_LINK( ImplAutoSwapOutHdl, void* ); + +//#endif // _SOLAR__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, const GraphicObject* pCopyObj = 0); + void SetGraphic( const Graphic& rGraphic, const String& rLink ); + + /** Get graphic transformed according to given attributes + + This method returns a Graphic transformed, cropped and scaled + to the given parameters, ready to be rendered to printer or + display. The returned graphic has the same visual appearance + as if it had been drawn via GraphicObject::Draw() to a + specific output device. + + @param rDestSize + Desired output size in logical coordinates. The mapmode to + interpret these logical coordinates in is given by the second + parameter, rDestMap. + + @param rDestMap + Mapmode the output should be interpreted in. This is used to + interpret rDestSize, to set the appropriate PrefMapMode on the + returned Graphic, and to deal correctly with metafile graphics. + + @param rAttr + Graphic attributes used to transform the graphic. This + includes cropping, rotation, mirroring, and various color + adjustment parameters. + + @return the readily transformed Graphic + */ + Graphic GetTransformedGraphic( const Size& rDestSize, const MapMode& rDestMap, const GraphicAttr& rAttr ) const; + Graphic GetTransformedGraphic( const GraphicAttr* pAttr = NULL ) const; // TODO: Change to Impl + + 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; + + BOOL HasUserData() const { return( mpUserData != NULL && mpUserData->Len() > 0 ); } + void SetUserData(); + void SetUserData( const String& rUserData ); + String GetUserData() 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 IsAlpha() const { return mbAlpha; } + 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( mbAutoSwapped || maGraphic.IsSwapOut() ); } + void SetSwapState(); + + BOOL Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz, + const GraphicAttr* pAttr = NULL, ULONG nFlags = GRFMGR_DRAW_STANDARD ); + + /** Draw the graphic repeatedly into the given output rectangle + + @param pOut + OutputDevice where the rendering should take place + + @param rArea + The output area that is filled with tiled instances of this graphic + + @param rSize + The actual size of a single tile + + @param rOffset + Offset from the left, top position of rArea, where to start + the tiling. The upper left corner of the graphic tilings will + virtually start at this position. Concretely, only that many + tiles are drawn to completely fill the given output area. + + @param pAttr + Optional GraphicAttr + + @param nFlags + Optional rendering flags + + @param nTileCacheSize1D + Optional dimension of the generated cache tiles. The pOut sees + a number of tile draws, which have approximately + nTileCacheSize1D times nTileCacheSize1D bitmap sizes if the + tile bitmap is smaller. Otherwise, the tile is drawn as + is. This is useful if e.g. you want only a few, very large + bitmap drawings appear on the outdev. + + @return TRUE, if drawing completed successfully + */ + BOOL DrawTiled( OutputDevice* pOut, const Rectangle& rArea, const Size& rSize, + const Size& rOffset, const GraphicAttr* pAttr = NULL, + ULONG nFlags = GRFMGR_DRAW_STANDARD, int nTileCacheSize1D=128 ); + + 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& ) {} + GraphicManager& operator=( const GraphicManager& ) { return *this; } + +//#if 0 // _SOLAR__PRIVATE + + BOOL ImplDraw( OutputDevice* pOut, const Point& rPt, + const Size& rSz, GraphicObject& rObj, + const GraphicAttr& rAttr, + const ULONG nFlags, BOOL& rCached ); + + BOOL ImplCreateOutput( OutputDevice* pOut, const Point& rPt, const Size& rSz, + const BitmapEx& rBmpEx, const GraphicAttr& rAttr, + const ULONG nFlags, BitmapEx* pBmpEx = NULL ); + BOOL ImplCreateOutput( OutputDevice* pOut, + const Point& rPt, const Size& rSz, + const GDIMetaFile& rMtf, const GraphicAttr& rAttr, + const ULONG nFlags, GDIMetaFile& rOutMtf, BitmapEx& rOutBmpEx ); + + 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 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 = NULL, + const GraphicObject* pCopyObj = NULL ); + 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 // _SOLAR__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 SetCacheTimeout( ULONG nTimeoutSeconds ); + ULONG GetCacheTimeout() 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..ac6b78ac86a2 --- /dev/null +++ b/goodies/inc/mailenum.hxx @@ -0,0 +1,98 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: mailenum.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#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/makefile.mk b/goodies/inc/makefile.mk new file mode 100644 index 000000000000..98924a5a1192 --- /dev/null +++ b/goodies/inc/makefile.mk @@ -0,0 +1,51 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2008 by Sun Microsystems, Inc. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.3 $ +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org 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 version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* +PRJ=.. + +PRJNAME=goodies +TARGET=inc + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk + +# --- Files -------------------------------------------------------- +# --- Targets ------------------------------------------------------- + +.INCLUDE : target.mk + +.IF "$(ENABLE_PCH)"!="" +ALLTAR : \ + $(SLO)$/precompiled.pch \ + $(SLO)$/precompiled_ex.pch + +.ENDIF # "$(ENABLE_PCH)"!="" + diff --git a/goodies/inc/pch/precompiled_goodies.cxx b/goodies/inc/pch/precompiled_goodies.cxx new file mode 100644 index 000000000000..663a76ec3160 --- /dev/null +++ b/goodies/inc/pch/precompiled_goodies.cxx @@ -0,0 +1,32 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: precompiled_goodies.cxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "precompiled_goodies.hxx" + diff --git a/goodies/inc/pch/precompiled_goodies.hxx b/goodies/inc/pch/precompiled_goodies.hxx new file mode 100644 index 000000000000..fe6f2ec433e5 --- /dev/null +++ b/goodies/inc/pch/precompiled_goodies.hxx @@ -0,0 +1,174 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: precompiled_goodies.hxx,v $ + * $Revision: 1.4.42.1 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): Generated on 2006-09-01 17:49:44.889563 + +#ifdef PRECOMPILED_HEADERS + +//---MARKER--- +#include "sal/types.h" + +#include "com/sun/star/awt/FontDescriptor.hpp" +#include "com/sun/star/awt/FontUnderline.hpp" +#include "com/sun/star/awt/FontWeight.hpp" +#include "com/sun/star/awt/Gradient.hpp" +#include "com/sun/star/awt/Rectangle.hpp" +#include "com/sun/star/awt/Size.hpp" +#include "com/sun/star/awt/XBitmap.hpp" +#include "com/sun/star/awt/XDevice.hpp" +#include "com/sun/star/beans/PropertyAttribute.hpp" +#include "com/sun/star/beans/PropertyState.hpp" +#include "com/sun/star/beans/XPropertySet.hpp" +#include "com/sun/star/drawing/CircleKind.hpp" +#include "com/sun/star/drawing/FillStyle.hpp" +#include "com/sun/star/drawing/FlagSequence.hpp" +#include "com/sun/star/drawing/Hatch.hpp" +#include "com/sun/star/drawing/LineDash.hpp" +#include "com/sun/star/drawing/LineStyle.hpp" +#include "com/sun/star/drawing/PointSequence.hpp" +#include "com/sun/star/drawing/PointSequenceSequence.hpp" +#include "com/sun/star/drawing/PolyPolygonBezierCoords.hpp" +#include "com/sun/star/drawing/TextAdjust.hpp" +#include "com/sun/star/drawing/XDrawPage.hpp" +#include "com/sun/star/drawing/XDrawPages.hpp" +#include "com/sun/star/drawing/XDrawPagesSupplier.hpp" +#include "com/sun/star/drawing/XShape.hpp" +#include "com/sun/star/drawing/XShapeGrouper.hpp" +#include "com/sun/star/frame/XModel.hpp" +#include "com/sun/star/graphic/GraphicType.hpp" +#include "com/sun/star/graphic/XGraphic.hpp" +#include "com/sun/star/graphic/XGraphicProvider.hpp" +#include "com/sun/star/graphic/XGraphicRenderer.hpp" +#include "com/sun/star/io/XStream.hpp" +#include "com/sun/star/lang/XMultiServiceFactory.hpp" +#include "com/sun/star/lang/XServiceInfo.hpp" +#include "com/sun/star/lang/XUnoTunnel.hpp" +#include "com/sun/star/registry/XRegistryKey.hpp" +#include "com/sun/star/style/HorizontalAlignment.hpp" +#include "com/sun/star/task/XStatusIndicator.hpp" +#include "com/sun/star/text/XText.hpp" +#include "com/sun/star/text/XTextRange.hpp" + +#include "comphelper/processfactory.hxx" +#include "comphelper/propertysethelper.hxx" +#include "comphelper/propertysetinfo.hxx" + +#include "cppuhelper/factory.hxx" +#include "cppuhelper/implbase1.hxx" +#include "cppuhelper/servicefactory.hxx" + + +#include "osl/diagnose.h" +#include "osl/endian.h" +#include "osl/file.hxx" +#include "osl/process.h" + +#include "rtl/alloc.h" +#include "rtl/math.hxx" +#include "rtl/ustring.hxx" +#include "rtl/uuid.h" + +#include "svtools/FilterConfigItem.hxx" +#include "unotools/cacheoptions.hxx" +#include "svtools/fltcall.hxx" +#include "svl/itemprop.hxx" +#include "svl/lstner.hxx" +#include "svl/solar.hrc" +#include "svtools/stdctrl.hxx" +#include "svl/svarray.hxx" + +#include "toolkit/helper/vclunohelper.hxx" + +#include "tools/agapi.hxx" +#include "tools/agitem.hxx" +#include "tools/bigint.hxx" +#include "tools/chapi.hxx" +#include "tools/color.hxx" +#include "tools/datetime.hxx" +#include "tools/debug.hxx" +#include "tools/gen.hxx" +#include "tools/list.hxx" +#include "tools/poly.hxx" +#include "tools/rcid.h" +#include "tools/ref.hxx" +#include "tools/resid.hxx" +#include "tools/resmgr.hxx" +#include "tools/rtti.hxx" +#include "tools/shl.hxx" +#include "tools/solar.h" +#include "tools/string.hxx" +#include "tools/table.hxx" +#include "tools/tempfile.hxx" +#include "tools/time.hxx" +#include "tools/urlobj.hxx" +#include "tools/vcompat.hxx" +#include "tools/vector2d.hxx" + +#include "uno/mapping.hxx" + +#include "unotools/localfilehelper.hxx" +#include "unotools/processfactory.hxx" + +#include "vcl/alpha.hxx" +#include "vcl/animate.hxx" +#include "vcl/bitmap.hxx" +#include "vcl/bitmapex.hxx" +#include "vcl/bmpacc.hxx" +#include "vcl/button.hxx" +#include "vcl/dialog.hxx" +#include "vcl/field.hxx" +#include "vcl/fixed.hxx" +#include "vcl/floatwin.hxx" +#include "vcl/font.hxx" +#include "vcl/gdimtf.hxx" +#include "vcl/gradient.hxx" +#include "vcl/graph.h" +#include "vcl/hatch.hxx" +#include "vcl/image.hxx" +#include "vcl/imagerepository.hxx" +#include "vcl/lineinfo.hxx" +#include "vcl/lstbox.hxx" +#include "vcl/metric.hxx" +#include "vcl/msgbox.hxx" +#include "vcl/outdev.hxx" +#include "vcl/region.hxx" +#include "vcl/salbtype.hxx" +#include "vcl/sv.h" +#include "vcl/svapp.hxx" +#include "vcl/timer.hxx" +#include "vcl/virdev.hxx" +#include "vcl/window.hxx" + +#include "vos/macros.hxx" +#include "vos/mutex.hxx" +#include "vos/timer.hxx" +//---MARKER--- + +#endif |