summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2007-07-17 12:37:29 +0000
committerOliver Bolte <obo@openoffice.org>2007-07-17 12:37:29 +0000
commit85abb2436786118ba3be8692dcfc3dabff1efe82 (patch)
tree305a56de739507f8a6fdac843013425de9b45709 /sfx2
parent00a8e1a3c327ec30eb4e461e91060c9c66f60431 (diff)
INTEGRATION: CWS basemodelrefactoring (1.2.2); FILE MERGED
2007/05/30 15:26:24 mba 1.2.2.3: merge conflict 2007/05/29 21:45:08 mba 1.2.2.2: RESYNC: (1.2-1.4); FILE MERGED 2007/04/16 21:50:03 mba 1.2.2.1: add changes from CWS to headers moved on master
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/sfx2/docinf.hxx298
1 files changed, 79 insertions, 219 deletions
diff --git a/sfx2/inc/sfx2/docinf.hxx b/sfx2/inc/sfx2/docinf.hxx
index 87e0b2ac3e80..bd47b6c8355c 100644
--- a/sfx2/inc/sfx2/docinf.hxx
+++ b/sfx2/inc/sfx2/docinf.hxx
@@ -4,9 +4,9 @@
*
* $RCSfile: docinf.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: kz $ $Date: 2007-05-14 14:46:12 $
+ * last change: $Author: obo $ $Date: 2007-07-17 13:37:29 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -50,6 +50,10 @@
#include <com/sun/star/uno/Reference.hxx>
#endif
+#include <com/sun/star/uno/Any.hxx>
+
+#include <com/sun/star/document/XDocumentInfo.hpp>
+
#ifndef _ERRCODE_HXX //autogen wg. ErrCode
#include <tools/errcode.hxx>
#endif
@@ -63,242 +67,102 @@
#include <svtools/hint.hxx>
#endif
-class SvStream;
-
-#ifndef _TIMESTAMP_HXX
-#include <tools/timestamp.hxx>
-#endif
-
-#ifndef _SV_GDIMTF_HXX
-#include <vcl/gdimtf.hxx>
-#endif
-
#include <hash_map>
#include <svtools/itemprop.hxx>
-// SfxStamp changed to "tools/TimeStamp" !!!
-typedef TimeStamp SfxStamp ;
-
-//#if 0 // _SOLAR__PRIVATE
-struct OUStringHashCode
-{
- size_t operator()( const ::rtl::OUString& sString ) const
- {
- return sString.hashCode();
- }
-};
-
-struct SfxExtendedItemPropertyMap : public SfxItemPropertyMap
-{
- ::com::sun::star::uno::Any aValue;
-};
-
-typedef ::std::hash_map< ::rtl::OUString ,
- SfxExtendedItemPropertyMap ,
- OUStringHashCode ,
- ::std::equal_to< ::rtl::OUString > > TDynamicProps;
-//#endif
-
-class SFX2_DLLPUBLIC SfxDocUserKey
-{
-private:
-friend class SfxDocumentInfo;
-
-#define SFXDOCUSERKEY_LENMAX 19
-
- String aTitle;
- String aWord;
-
- SAL_DLLPRIVATE void AdjustTitle_Impl();
-
-public:
- SfxDocUserKey() {}
- SfxDocUserKey( const String& rTitle, const String& rWord );
-
- // Benoetigt der BCC OS/2
- const SfxDocUserKey& operator=(const SfxDocUserKey &rCopy);
-
- int operator==( const SfxDocUserKey& rCmp ) const
- { return aTitle == rCmp.aTitle && aWord == rCmp.aWord; }
- int operator!=( const SfxDocUserKey& rCmp ) const { return !operator==( rCmp ); }
-
- const String& GetTitle() const { return aTitle; }
- const String& GetWord() const { return aWord; }
-
- BOOL Load( SvStream& rStrm );
- BOOL Save( SvStream& rStrm ) const;
-};
-
-const BYTE MAXDOCUSERKEYS = 4;
-const int MAXDOCMAILINFOS = 256;
-
+class SfxObjectShell;
+class GDIMetaFile;
class SotStorage;
class SfxDocumentInfo_Impl;
+const BYTE MAXDOCUSERKEYS = 4;
+
class SFX2_DLLPUBLIC SfxDocumentInfo
{
-private:
- CharSet eFileCharSet; // Zeichensatz der Infos
-
- BOOL bPasswd : 1, // Dokument ist verschluesselt
- bPortableGraphics : 1, // Grafiken portabel Speichern
- bQueryTemplate : 1, // Nachladen von Vorlage abfragen
- bTemplateConfig : 1, // Vorlage enthaelt Konfiguration
- bReadOnly : 1,
- bSaveGraphicsCompressed : 1,
- bSaveOriginalGraphics : 1,
- bSaveVersionOnClose : 1;
-
-#define SFXDOCINFO_TITLELENMAX 63
-#define SFXDOCINFO_THEMELENMAX 63
-#define SFXDOCINFO_COMMENTLENMAX 255
-#define SFXDOCINFO_KEYWORDLENMAX 127
-
- SfxStamp aCreated;
- SfxStamp aChanged;
- SfxStamp aPrinted;
-
- String aTitle;
- String aTheme;
- String aComment;
- String aKeywords;
-
- SfxDocUserKey aUserKeys[MAXDOCUSERKEYS];
+ SfxDocumentInfo_Impl* pImp;
- String aTemplateName; // Name der Dokumentvorlage
- String aTemplateFileName; // Dateiname der Dokumentvorlage
+ SAL_DLLPRIVATE DateTime DATETIME_PROP(sal_Int32 nHandle) const;
+ SAL_DLLPRIVATE BOOL BOOL_PROP(sal_Int32 nHandle) const;
+ SAL_DLLPRIVATE sal_Int32 INT_PROP(sal_Int32 nHandle) const;
+ SAL_DLLPRIVATE String STRING_PROP(sal_Int32 nHandle) const;
+ SAL_DLLPRIVATE void SET_PROP(sal_Int32 nHandle, const com::sun::star::uno::Any& aValue );
- String aDefaultTarget;
- String aReloadURL;
- BOOL bReloadEnabled;
- sal_uInt32 nReloadSecs;
+public:
- DateTime aTemplateDate; // Stamp der Dokumentvorlage
+ SfxDocumentInfo( SfxObjectShell* pDoc=0);
- USHORT nUserDataSize;
- USHORT nDocNo; // schon mal rein: Dokumentnummer, was immer das sein mag
- void* pUserData; // Benutzer Daten, z.B. Doc-Statistik
- long lTime;
+ // deep copy
+ SfxDocumentInfo( const SfxDocumentInfo& );
- SfxDocumentInfo_Impl* pImp;
+ // shallow copy
+ SfxDocumentInfo( const com::sun::star::uno::Reference < com::sun::star::document::XDocumentInfo >& );
- SAL_DLLPRIVATE void Free();
- SAL_DLLPRIVATE String AdjustTextLen_Impl( const String& rText, USHORT nMax );
+ ~SfxDocumentInfo();
-public:
- SfxDocumentInfo( const SfxDocumentInfo& );
const SfxDocumentInfo& operator=( const SfxDocumentInfo& );
- SfxDocumentInfo();
- virtual ~SfxDocumentInfo();
-
int operator==( const SfxDocumentInfo& ) const;
- const SfxDocumentInfo& CopyUserData( const SfxDocumentInfo& rSource );
+
+ com::sun::star::uno::Reference < com::sun::star::document::XDocumentInfo > GetInfo() const;
sal_uInt32 LoadPropertySet( SotStorage* pStor );
- sal_Bool SavePropertySet( SotStorage* pStor ) const;
+ sal_Bool SavePropertySet( SotStorage* pStor, GDIMetaFile* pThumb ) const;
- void SetReloadURL( const String& rString );
- const String& GetReloadURL() const;
BOOL IsReloadEnabled() const;
+ sal_Int16 GetDocumentNumber() const;
+ sal_Int32 GetReloadDelay() const;
+ sal_Int32 GetTime() const;
+ String GetDefaultTarget() const;
+ String GetReloadURL() const;
+ String GetTemplateName() const;
+ String GetTemplateFileName() const;
+ String GetTitle() const;
+ String GetTheme() const;
+ String GetComment() const;
+ String GetKeywords()const;
+ String GetMimeType() const;
+ String GetAuthor() const;
+ DateTime GetCreationDate() const;
+ String GetModificationAuthor() const;
+ DateTime GetModificationDate() const;
+ String GetPrintedBy() const;
+ DateTime GetPrintDate() const;
+ DateTime GetTemplateDate() const;
+
void EnableReload( BOOL bEnable );
- const String& GetDefaultTarget() const;
- void SetDefaultTarget( const String& rString );
- sal_uInt32 GetReloadDelay() const;
+ void SetDocumentNumber(sal_Int16 nNo);
void SetReloadDelay( sal_uInt32 nDelay );
-
- BOOL IsReadOnly() const { return bReadOnly; }
- BOOL IsPasswd() const { return bPasswd; }
- BOOL IsPortableGraphics() const { return bPortableGraphics; }
- BOOL IsSaveOriginalGraphics() const { return bSaveOriginalGraphics; }
- BOOL IsSaveGraphicsCompressed() const { return bSaveGraphicsCompressed; }
- BOOL IsQueryLoadTemplate() const { return bQueryTemplate; }
-
- void SetReadOnly( BOOL b ) { bReadOnly = b; }
- void SetPasswd( BOOL b ) { bPasswd = b; }
- void SetPortableGraphics( BOOL b ) { bPortableGraphics = b; }
- void SetSaveOriginalGraphics( BOOL b ) { bSaveOriginalGraphics = b; }
- void SetSaveGraphicsCompressed( BOOL b ) { bSaveGraphicsCompressed = b; }
- void SetQueryLoadTemplate( BOOL b ) { bQueryTemplate = b; }
-
- const SfxStamp& GetCreated() const { return aCreated; }
- const SfxStamp& GetChanged() const { return aChanged; }
- const SfxStamp& GetPrinted() const { return aPrinted; }
- void SetCreated( const SfxStamp& rStamp ) { aCreated = rStamp; }
- void SetChanged( const SfxStamp& rStamp ) { aChanged = rStamp; }
- void SetPrinted( const SfxStamp& rStamp ) { aPrinted = rStamp; }
-
- const String& GetTemplateName() const { return aTemplateName; }
- const String& GetTemplateFileName() const { return aTemplateFileName; }
- const DateTime& GetTemplateDate() const { return aTemplateDate; }
- void SetTemplateName( const String& rName ) { aTemplateName = rName; bQueryTemplate = 1; }
- void SetTemplateFileName( const String& rFileName ) { aTemplateFileName = rFileName; bQueryTemplate = 1; }
- void SetTemplateDate(const DateTime& rDate) { aTemplateDate = rDate; bQueryTemplate = 1; }
-
- const String& GetTitle() const { return aTitle; }
- const String& GetTheme() const { return aTheme; }
- const String& GetComment() const { return aComment; }
- const String& GetKeywords()const { return aKeywords; }
-
- const GDIMetaFile &GetThumbnailMetaFile() const;
-
- void SetTitle( const String& rVal );
- void SetTheme( const String& rVal );
- void SetComment( const String& rVal );
- void SetKeywords( const String& rVal );
-
- void SetThumbnailMetaFile (const GDIMetaFile &aMetaFile);
-
- void SetChanged( const String& rChanger ) { SetChanged( SfxStamp( rChanger ) ); }
- void SetCreated( const String& rCreator ) { SetCreated( SfxStamp( rCreator ) ); }
-
- USHORT GetUserKeyCount() const { return MAXDOCUSERKEYS; }
- const SfxDocUserKey& GetUserKey( USHORT n ) const;
- void SetUserKey( const SfxDocUserKey& rKey, USHORT n );
-
- void SetSaveVersionOnClose( BOOL bSet ) { bSaveVersionOnClose = bSet; }
- BOOL IsSaveVersionOnClose() const { return bSaveVersionOnClose; }
-
- void SetTime(long l) { lTime = l; }
- long GetTime() const { return IsUseUserData() ? lTime : 0L; }
-
- void* GetUserData() const { return pUserData; }
- USHORT GetUserDataSize() const { return nUserDataSize; }
- void SetUserData(USHORT nSize, void *pData);
-
- USHORT GetDocumentNumber() const { return IsUseUserData() ? nDocNo : (USHORT) 0; }
- void SetDocumentNumber(USHORT nNo) { nDocNo = nNo; }
- void IncDocumentNumber() { ++nDocNo; }
- void SetTemplateConfig (BOOL bConfig)
- { bTemplateConfig = bConfig ? 1 : 0; }
- BOOL HasTemplateConfig () const
- { return bTemplateConfig; }
-
- String GetCopiesTo() const;
- void SetCopiesTo( const String& rStr );
- String GetOriginal() const;
- void SetOriginal( const String& rStr );
- String GetReferences() const;
- void SetReferences( const String& rStr );
- String GetRecipient() const;
- void SetRecipient( const String& rStr );
- String GetReplyTo() const;
- void SetReplyTo( const String& rStr );
- String GetBlindCopies() const;
- void SetBlindCopies( const String& rStr );
- String GetInReplyTo() const;
- void SetInReplyTo( const String& rStr );
- String GetNewsgroups() const;
- void SetNewsgroups( const String& rStr );
- String GetSpecialMimeType() const;
- void SetSpecialMimeType( const String& rStr );
- USHORT GetPriority() const;
- void SetPriority( USHORT nPrio );
- BOOL IsUseUserData() const;
- void SetUseUserData( BOOL bNew );
-
- void DeleteUserData( BOOL bUseAuthor );
- void DeleteUserDataCompletely();
-
+ void SetTime(sal_Int32 l);
+ void SetDefaultTarget( const String& rString );
+ void SetReloadURL( const String& rString );
+ void SetTemplateName( const String& rName );
+ void SetTemplateFileName( const String& rFileName );
+ void SetTitle( const String& rVal );
+ void SetTheme( const String& rVal );
+ void SetComment( const String& rVal );
+ void SetKeywords( const String& rVal );
+ void SetMimeType( const String& rVal );
+ void SetAuthor( const String& rAuthor );
+ void SetModificationAuthor( const String& rChangedBy );
+ void SetPrintedBy( const String& rPrintedBy );
+ void SetCreationDate(const DateTime& rDate);
+ void SetModificationDate(const DateTime& rDate);
+ void SetPrintDate(const DateTime& rDate);
+ void SetTemplateDate(const DateTime& rDate);
+ void IncDocumentNumber();
+ void SetCreated( const String& rAuthor );
+ void SetChanged( const String& rName );
+ void SetPrinted( const String& rName );
+
+ USHORT GetUserKeyCount() const;
+ String GetUserKeyTitle(USHORT n) const;
+ String GetUserKeyWord(USHORT n) const;
+ void SetUserKey( const String& rName, const String& rValue, USHORT n );
+ void SetUserKeyWord( const String& rValue, USHORT n );
+ void SetUserKeyTitle( const String& rValue, USHORT n );
+
+ void ClearTemplateInformation();
+ void DeleteUserData( const String* pAuthor=0 );
+ void ResetUserData( const String& rAuthor );
void Clear();
void ResetFromTemplate( const String& rTemplateName, const String& rFileName );
@@ -313,10 +177,6 @@ public:
BOOL SetCustomProperty(const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue);
-//#if 0 // _SOLAR__PRIVATE
- TDynamicProps& GetDynamicProps_Impl();
- const TDynamicProps& GetDynamicProps_Impl() const;
-//#endif
};
DECL_PTRHINT(SFX2_DLLPUBLIC, SfxDocumentInfoHint, SfxDocumentInfo);