summaryrefslogtreecommitdiff
path: root/svtools/inc
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2007-04-11 18:31:39 +0000
committerVladimir Glazounov <vg@openoffice.org>2007-04-11 18:31:39 +0000
commitd9d9be5379b7c3e37951d25290d30a44456aaaf9 (patch)
treeed5bfe80e08a035fb0049140d3fa11b3a3005341 /svtools/inc
parent523b266b7e808791be637d92228781673c5b5fdd (diff)
INTEGRATION: CWS hedaburemove01 (1.1.2); FILE ADDED
2007/02/09 16:12:48 vg 1.1.2.1: #72503# get rid of hedabu procedure: Moving headers to svtools/inc/svtools and correspondent necessary changes
Diffstat (limited to 'svtools/inc')
-rw-r--r--svtools/inc/svtools/parrtf.hxx106
-rw-r--r--svtools/inc/svtools/pathoptions.hxx158
-rw-r--r--svtools/inc/svtools/poolitem.hxx512
-rw-r--r--svtools/inc/svtools/printdlg.hxx278
4 files changed, 1054 insertions, 0 deletions
diff --git a/svtools/inc/svtools/parrtf.hxx b/svtools/inc/svtools/parrtf.hxx
new file mode 100644
index 000000000000..3bb0faab35c6
--- /dev/null
+++ b/svtools/inc/svtools/parrtf.hxx
@@ -0,0 +1,106 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: parrtf.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: vg $ $Date: 2007-04-11 19:30:55 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _PARRTF_HXX
+#define _PARRTF_HXX
+
+#ifndef INCLUDED_SVTDLLAPI_H
+#include "svtools/svtdllapi.h"
+#endif
+
+#ifndef _SVPARSER_HXX
+#include <svtools/svparser.hxx>
+#endif
+#ifndef _SVARRAY_HXX
+#include <svtools/svarray.hxx>
+#endif
+
+struct RtfParserState_Impl
+{
+ rtl_TextEncoding eCodeSet;
+ BYTE nUCharOverread;
+
+ RtfParserState_Impl( BYTE nUOverread, rtl_TextEncoding eCdSt )
+ : eCodeSet( eCdSt ), nUCharOverread( nUOverread )
+ {}
+};
+
+SV_DECL_VARARR( RtfParserStates_Impl, RtfParserState_Impl, 16, 16 )
+
+class SVT_DLLPUBLIC SvRTFParser : public SvParser
+{
+ RtfParserStates_Impl aParserStates;
+
+ int nOpenBrakets;
+ rtl_TextEncoding eCodeSet, eUNICodeSet;
+ BYTE nUCharOverread;
+
+private:
+ static short _inSkipGroup;
+
+protected:
+ sal_Unicode GetHexValue();
+ void ScanText( const sal_Unicode = 0 );
+ void SkipGroup();
+
+ // scanne das naechste Token,
+ virtual int _GetNextToken();
+
+ virtual void ReadUnknownData();
+ virtual void ReadBitmapData();
+ virtual void ReadOLEData();
+
+ virtual ~SvRTFParser();
+
+ rtl_TextEncoding GetCodeSet() const { return eCodeSet; }
+ void SetEncoding( rtl_TextEncoding eEnc );
+
+ rtl_TextEncoding GetUNICodeSet() const { return eUNICodeSet; }
+ void SetUNICodeSet( rtl_TextEncoding eSet ) { eUNICodeSet = eSet; }
+
+public:
+ SvRTFParser( SvStream& rIn, BYTE nStackSize = 3 );
+
+ virtual SvParserState CallParser(); // Aufruf des Parsers
+
+ int GetOpenBrakets() const { return nOpenBrakets; }
+
+ // fuers asynchrone lesen aus dem SvStream
+// virtual void SaveState( int nToken );
+// virtual void RestoreState();
+ virtual void Continue( int nToken );
+};
+
+#endif //_PARRTF_HXX
diff --git a/svtools/inc/svtools/pathoptions.hxx b/svtools/inc/svtools/pathoptions.hxx
new file mode 100644
index 000000000000..d54aac10eaf8
--- /dev/null
+++ b/svtools/inc/svtools/pathoptions.hxx
@@ -0,0 +1,158 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pathoptions.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: vg $ $Date: 2007-04-11 19:31:05 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX
+#define INCLUDED_SVTOOLS_PATHOPTIONS_HXX
+
+#ifndef INCLUDED_SVLDLLAPI_H
+#include "svtools/svldllapi.h"
+#endif
+
+#ifndef _STRING_HXX
+#include <tools/string.hxx>
+#endif
+#ifndef _COM_SUN_STAR_LANG_LOCALE_HPP_
+#include <com/sun/star/lang/Locale.hpp>
+#endif
+#ifndef INCLUDED_SVTOOLS_OPTIONS_HXX
+#include <svtools/options.hxx>
+#endif
+
+#define SVT_SEARCHPATH_DELIMITER ';'
+
+// class SvtPathOptions --------------------------------------------------
+
+class SvtPathOptions_Impl;
+class SVL_DLLPUBLIC SvtPathOptions: public svt::detail::Options
+{
+private:
+ SvtPathOptions_Impl* pImp;
+
+public:
+ enum Pathes
+ {
+ PATH_ADDIN,
+ PATH_AUTOCORRECT,
+ PATH_AUTOTEXT,
+ PATH_BACKUP,
+ PATH_BASIC,
+ PATH_BITMAP,
+ PATH_CONFIG,
+ PATH_DICTIONARY,
+ PATH_FAVORITES,
+ PATH_FILTER,
+ PATH_GALLERY,
+ PATH_GRAPHIC,
+ PATH_HELP,
+ PATH_LINGUISTIC,
+ PATH_MODULE,
+ PATH_PALETTE,
+ PATH_PLUGIN,
+ PATH_STORAGE,
+ PATH_TEMP,
+ PATH_TEMPLATE,
+ PATH_USERCONFIG,
+ PATH_USERDICTIONARY,
+ PATH_WORK,
+ PATH_UICONFIG,
+ PATH_COUNT // should always be the last element
+ };
+
+ SvtPathOptions();
+ virtual ~SvtPathOptions();
+
+ // get the pathes, not const because of using a mutex
+ const String& GetAddinPath() const;
+ const String& GetAutoCorrectPath() const;
+ const String& GetAutoTextPath() const;
+ const String& GetBackupPath() const;
+ const String& GetBasicPath() const;
+ const String& GetBitmapPath() const;
+ const String& GetConfigPath() const;
+ const String& GetDictionaryPath() const;
+ const String& GetFavoritesPath() const;
+ const String& GetFilterPath() const;
+ const String& GetGalleryPath() const;
+ const String& GetGraphicPath() const;
+ const String& GetHelpPath() const;
+ const String& GetLinguisticPath() const;
+ const String& GetModulePath() const;
+ const String& GetPalettePath() const;
+ const String& GetPluginPath() const;
+ const String& GetStoragePath() const;
+ const String& GetTempPath() const;
+ const String& GetTemplatePath() const;
+ const String& GetUserConfigPath() const;
+ const String& GetUserDictionaryPath() const;
+ const String& GetWorkPath() const;
+ const String& GetUIConfigPath() const;
+
+ BOOL IsPathReadonly(Pathes ePath)const;
+ const String& GetPath(Pathes ePath) const;
+
+ // set the pathes
+ void SetAddinPath( const String& rPath );
+ void SetAutoCorrectPath( const String& rPath );
+ void SetAutoTextPath( const String& rPath );
+ void SetBackupPath( const String& rPath );
+ void SetBasicPath( const String& rPath );
+ void SetBitmapPath( const String& rPath );
+ void SetConfigPath( const String& rPath );
+ void SetDictionaryPath( const String& rPath );
+ void SetFavoritesPath( const String& rPath );
+ void SetFilterPath( const String& rPath );
+ void SetGalleryPath( const String& rPath );
+ void SetGraphicPath( const String& rPath );
+ void SetHelpPath( const String& rPath );
+ void SetLinguisticPath( const String& rPath );
+ void SetModulePath( const String& rPath );
+ void SetPalettePath( const String& rPath );
+ void SetPluginPath( const String& rPath );
+ void SetStoragePath( const String& rPath );
+ void SetTempPath( const String& rPath );
+ void SetTemplatePath( const String& rPath );
+ void SetUserConfigPath( const String& rPath );
+ void SetUserDictionaryPath( const String& rPath );
+ void SetWorkPath( const String& rPath );
+ void SetPath( SvtPathOptions::Pathes ePath, const String& rNewPath );
+
+ String SubstituteVariable( const String& rVar );
+ String UseVariable( const String& rVar );
+ sal_Bool SearchFile( String& rIniFile, Pathes ePath = PATH_USERCONFIG );
+ ::com::sun::star::lang::Locale GetLocale() const;
+ sal_Bool IsReadonly() const;
+};
+
+#endif // #ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX
+
diff --git a/svtools/inc/svtools/poolitem.hxx b/svtools/inc/svtools/poolitem.hxx
new file mode 100644
index 000000000000..637f5e6a5780
--- /dev/null
+++ b/svtools/inc/svtools/poolitem.hxx
@@ -0,0 +1,512 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: poolitem.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: vg $ $Date: 2007-04-11 19:31:28 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef _SFXPOOLITEM_HXX
+#define _SFXPOOLITEM_HXX
+
+#ifndef INCLUDED_SVLDLLAPI_H
+#include "svtools/svldllapi.h"
+#endif
+
+#ifndef _COM_SUN_STAR_UNO_ANY_HXX_
+#include <com/sun/star/uno/Any.hxx>
+#endif
+
+#define TF_POOLABLE
+
+#ifndef _SAL_CONFIG_H_ /* defines _USE_NAMESPACE */
+#include <sal/config.h>
+#endif
+#ifndef _RTTI_HXX //autogen
+#include <tools/rtti.hxx>
+#endif
+#include <limits.h>
+#ifndef _SOLAR_H
+#include <tools/solar.h>
+#endif
+#ifndef _DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _STRING_HXX
+#include <tools/string.hxx>
+#endif
+#include <svtools/svarray.hxx>
+#include <svtools/hint.hxx>
+
+typedef long SfxArgumentError;
+
+class SbxVariable;
+class SbxObject;
+class SvStream;
+class Color;
+class IntlWrapper;
+
+namespace com { namespace sun { namespace star { namespace uno { class Any; } } } }
+
+#define SFX_ITEMS_DIRECT 0xffff
+#define SFX_ITEMS_NULL 0xfff0 // anstelle StoreSurrogate
+
+#define SFX_ITEMS_POOLDEFAULT 0xffff
+#define SFX_ITEMS_STATICDEFAULT 0xfffe
+#define SFX_ITEMS_DELETEONIDLE 0xfffd
+
+#define SFX_ITEMS_OLD_MAXREF 0xffef
+#define SFX_ITEMS_MAXREF 0xfffffffe
+#define SFX_ITEMS_SPECIAL 0xffffffff
+
+#define CONVERT_TWIPS 0x80 //Uno-Konvertierung fuer Massangaben (fuer MemberId)
+
+// -----------------------------------------------------------------------
+
+// UNO3 shortcuts
+
+// warning, if there is no boolean inside the any this will always return the value false
+inline sal_Bool Any2Bool( const ::com::sun::star::uno::Any&rValue )
+{
+ sal_Bool nValue = sal_False;
+ if( rValue.hasValue() )
+ {
+ if( rValue.getValueType() == ::getCppuBooleanType() )
+ {
+ nValue = *(sal_Bool*)rValue.getValue();
+ }
+ else
+ {
+ sal_Int32 nNum = 0;
+ if( rValue >>= nNum )
+ nValue = nNum != 0;
+ }
+ }
+
+ return nValue;
+}
+
+inline ::com::sun::star::uno::Any Bool2Any( sal_Bool bValue )
+{
+ return ::com::sun::star::uno::Any( &bValue, ::getCppuBooleanType() );
+}
+
+// -----------------------------------------------------------------------
+
+//! Notloesung!!!
+enum SfxFieldUnit
+{
+ SFX_FUNIT_NONE, SFX_FUNIT_MM, SFX_FUNIT_CM, SFX_FUNIT_M, SFX_FUNIT_KM,
+ SFX_FUNIT_TWIP, SFX_FUNIT_POINT, SFX_FUNIT_PICA,
+ SFX_FUNIT_INCH, SFX_FUNIT_FOOT, SFX_FUNIT_MILE, SFX_FUNIT_CUSTOM
+};
+
+enum SfxMapUnit
+{
+ SFX_MAPUNIT_100TH_MM,
+ SFX_MAPUNIT_10TH_MM,
+ SFX_MAPUNIT_MM,
+ SFX_MAPUNIT_CM,
+ SFX_MAPUNIT_1000TH_INCH,
+ SFX_MAPUNIT_100TH_INCH,
+ SFX_MAPUNIT_10TH_INCH,
+ SFX_MAPUNIT_INCH,
+ SFX_MAPUNIT_POINT,
+ SFX_MAPUNIT_TWIP,
+ SFX_MAPUNIT_PIXEL,
+ SFX_MAPUNIT_SYSFONT,
+ SFX_MAPUNIT_APPFONT,
+ SFX_MAPUNIT_RELATIVE,
+ SFX_MAPUNIT_ABSOLUTE
+};
+
+// -----------------------------------------------------------------------
+
+enum SfxItemPresentation
+
+/* [Beschreibung]
+
+ Die Werte dieses Enums bezeichnen den Grad der textuellen
+ Presentation eines Items nach Aufruf der virtuellen Methode
+ <SfxPoolItem::GetPresentation()const>.
+*/
+
+{
+ SFX_ITEM_PRESENTATION_NONE,
+ SFX_ITEM_PRESENTATION_NAMEONLY,
+ SFX_ITEM_PRESENTATION_NAMELESS,
+ SFX_ITEM_PRESENTATION_COMPLETE
+};
+
+// -----------------------------------------------------------------------
+
+typedef USHORT SfxItemState;
+
+#define SFX_ITEM_UNKNOWN 0x0000
+
+#define SFX_ITEM_DISABLED 0x0001
+#define SFX_ITEM_READONLY 0x0002
+
+#define SFX_ITEM_DONTCARE 0x0010
+#define SFX_ITEM_DEFAULT 0x0020
+#define SFX_ITEM_SET 0x0030
+
+// old stuff - dont use!!!
+#define SFX_ITEM_AVAILABLE SFX_ITEM_DEFAULT
+#define SFX_ITEM_OFF SFX_ITEM_DEFAULT
+#define SFX_ITEM_ON SFX_ITEM_SET
+
+DBG_NAMEEX_VISIBILITY(SfxPoolItem, SVL_DLLPUBLIC)
+DBG_NAMEEX(SfxVoidItem)
+DBG_NAMEEX(SfxItemHandle)
+
+class SvXMLUnitConverter;
+class SfxItemPool;
+class SfxItemSet;
+
+class String;
+namespace rtl
+{
+ class OUString;
+}
+
+// -----------------------------------------------------------------------
+
+class SVL_DLLPUBLIC SfxPoolItem
+{
+friend class SfxItemPool;
+friend class SfxItemDesruptor_Impl;
+friend class SfxItemPoolCache;
+friend class SfxItemSet;
+friend class SfxVoidItem;
+
+ ULONG nRefCount; // Referenzzaehler
+ USHORT nWhich;
+ USHORT nKind;
+
+private:
+ inline void SetRefCount( ULONG n );
+ inline void SetKind( USHORT n );
+public:
+ inline ULONG AddRef( ULONG n = 1 ) const;
+private:
+ inline ULONG ReleaseRef( ULONG n = 1 ) const;
+ SVL_DLLPRIVATE long Delete_Impl(void*);
+
+#if 0
+ // @@@ virtual, but private, and dummy impl. @@@
+ virtual void Store( SvStream & ) const;
+ virtual void GetVersion() const;
+#endif
+
+protected:
+ SfxPoolItem( USHORT nWhich = 0 );
+ SfxPoolItem( const SfxPoolItem& );
+
+public:
+ TYPEINFO();
+ virtual ~SfxPoolItem();
+
+ void SetWhich( USHORT nId ) {
+ DBG_CHKTHIS(SfxPoolItem, 0);
+ nWhich = nId; }
+ USHORT Which() const {
+ DBG_CHKTHIS(SfxPoolItem, 0);
+ return nWhich; }
+ virtual int operator==( const SfxPoolItem& ) const = 0;
+ int operator!=( const SfxPoolItem& rItem ) const
+ { return !(*this == rItem); }
+ virtual int Compare( const SfxPoolItem &rWith ) const;
+ virtual int Compare( const SfxPoolItem &rWith, const IntlWrapper& rIntlWrapper ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePresentation,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresentationMetric,
+ XubString &rText,
+ const IntlWrapper * pIntlWrapper = 0 ) const;
+
+ virtual USHORT GetVersion( USHORT nFileFormatVersion ) const;
+ virtual int ScaleMetrics( long lMult, long lDiv );
+ virtual int HasMetrics() const;
+
+ virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
+ virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
+
+ virtual SfxPoolItem* Create( SvStream &, USHORT nItemVersion ) const;
+ virtual SvStream& Store( SvStream &, USHORT nItemVersion ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const = 0;
+
+ ULONG GetRefCount() const { return nRefCount; }
+ inline USHORT GetKind() const { return nKind; }
+
+ /** Read in a Unicode string from a streamed byte string representation.
+
+ @param rStream Some (input) stream. Its Stream/TargetCharSets must
+ be set to correct values!
+
+ @param rString On success, returns the reconstructed Unicode string.
+
+ @return True if the string was successfuly read and reconstructed.
+ */
+ static bool readByteString(SvStream & rStream, UniString & rString);
+
+ /** Write a byte string representation of a Unicode string into a stream.
+
+ @param rStream Some (output) stream. Its Stream/TargetCharSets must
+ be set to correct values!
+
+ @param rString Some Unicode string.
+ */
+ static void writeByteString(SvStream & rStream,
+ UniString const & rString);
+
+ /** Read in a Unicode string from either a streamed Unicode or byte string
+ representation.
+
+ @param rStream Some (input) stream. If bUnicode is false, its
+ Stream/TargetCharSets must be set to correct values!
+
+ @param rString On success, returns the reconstructed Unicode string.
+
+ @param bUnicode Whether to read in a stream Unicode (true) or byte
+ string (false) representation.
+
+ @return True if the string was successfuly read and reconstructed.
+ */
+ static bool readUnicodeString(SvStream & rStream, UniString & rString,
+ bool bUnicode);
+
+ /** Write a Unicode string representation of a Unicode string into a
+ stream.
+
+ @param rStream Some (output) stream.
+
+ @param rString Some Unicode string.
+ */
+ static void writeUnicodeString(SvStream & rStream,
+ UniString const & rString);
+
+private:
+ SfxPoolItem& operator=( const SfxPoolItem& ); // n.i.!!
+};
+
+// -----------------------------------------------------------------------
+
+inline void SfxPoolItem::SetRefCount( ULONG n )
+{
+ DBG_CHKTHIS( SfxPoolItem, 0 );
+ nRefCount = n;
+ nKind = 0;
+}
+
+inline void SfxPoolItem::SetKind( USHORT n )
+{
+ DBG_CHKTHIS( SfxPoolItem, 0 );
+ nRefCount = SFX_ITEMS_SPECIAL;
+ nKind = n;
+}
+
+inline ULONG SfxPoolItem::AddRef( ULONG n ) const
+{
+ DBG_CHKTHIS( SfxPoolItem, 0 );
+ DBG_ASSERT( nRefCount <= SFX_ITEMS_MAXREF, "AddRef mit nicht-Pool-Item" );
+ DBG_ASSERT( ULONG_MAX - nRefCount > n, "AddRef: Referenzzaehler ueberschlaegt sich" );
+ return ( ((SfxPoolItem *)this)->nRefCount += n );
+}
+
+inline ULONG SfxPoolItem::ReleaseRef( ULONG n ) const
+{
+ DBG_CHKTHIS( SfxPoolItem, 0 );
+ DBG_ASSERT( nRefCount <= SFX_ITEMS_MAXREF, "AddRef mit nicht-Pool-Item" );
+ DBG_ASSERT( nRefCount >= n, "ReleaseRef: Referenzzaehler ueberschlaegt sich" );
+ ((SfxPoolItem *)this)->nRefCount -= n;
+ return nRefCount;
+}
+
+// -----------------------------------------------------------------------
+
+inline int IsPoolDefaultItem(const SfxPoolItem *pItem )
+{
+ return pItem && pItem->GetKind() == SFX_ITEMS_POOLDEFAULT;
+}
+
+inline int IsStaticDefaultItem(const SfxPoolItem *pItem )
+{
+ return pItem && pItem->GetKind() == SFX_ITEMS_STATICDEFAULT;
+}
+
+inline int IsDefaultItem( const SfxPoolItem *pItem )
+{
+ return pItem && pItem->GetKind() >= SFX_ITEMS_STATICDEFAULT;
+}
+
+inline int IsPooledItem( const SfxPoolItem *pItem )
+{
+ return pItem && pItem->GetRefCount() > 0 && pItem->GetRefCount() <= SFX_ITEMS_MAXREF;
+}
+
+inline int IsInvalidItem(const SfxPoolItem *pItem)
+{
+ return pItem == (SfxPoolItem *)-1;
+}
+
+// -----------------------------------------------------------------------
+
+class SVL_DLLPUBLIC SfxVoidItem: public SfxPoolItem
+{
+ SfxVoidItem & operator=( const SfxVoidItem& ); // not implemented.
+public:
+ TYPEINFO();
+ SfxVoidItem( USHORT nWhich );
+ SfxVoidItem( USHORT nWhich, SvStream & );
+ SfxVoidItem( const SfxVoidItem& );
+ ~SfxVoidItem();
+
+ virtual int operator==( const SfxPoolItem& ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ XubString &rText,
+ const IntlWrapper * = 0 ) const;
+
+ // von sich selbst eine Kopie erzeugen
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ void SetWhich(USHORT nWh) { nWhich = nWh; }
+};
+
+// -----------------------------------------------------------------------
+
+class SVL_DLLPUBLIC SfxSetItem: public SfxPoolItem
+{
+ SfxItemSet *pSet;
+
+ SfxSetItem & operator=( const SfxSetItem& ); // not implemented.
+
+public:
+ TYPEINFO();
+ SfxSetItem( USHORT nWhich, SfxItemSet *pSet );
+ SfxSetItem( USHORT nWhich, const SfxItemSet &rSet );
+ SfxSetItem( const SfxSetItem&, SfxItemPool *pPool = 0 );
+ ~SfxSetItem();
+
+ virtual int operator==( const SfxPoolItem& ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ XubString &rText,
+ const IntlWrapper * = 0 ) const;
+
+ // von sich selbst eine Kopie erzeugen
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const = 0;
+ virtual SfxPoolItem* Create(SvStream &, USHORT nVersion) const = 0;
+ virtual SvStream& Store(SvStream &, USHORT nVer) const;
+
+ const SfxItemSet& GetItemSet() const
+ { return *pSet; }
+ SfxItemSet& GetItemSet()
+ { return *pSet; }
+};
+
+// -----------------------------------------------------------------------
+
+#if 0 /* @@@ NOT USED @@@ */
+class SfxInvalidItem: public SfxPoolItem
+{
+friend class SfxItemSet;
+
+ const SfxPoolItem* pDefaultItem;
+
+private:
+ TYPEINFO();
+ SfxInvalidItem( USHORT nWhich, const SfxPoolItem &rDefault );
+ SfxInvalidItem( const SfxInvalidItem& );
+ virtual ~SfxInvalidItem();
+
+public:
+ virtual int operator==( const SfxPoolItem& ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ XubString &rText,
+ const IntlWrapper * = 0 ) const;
+ const SfxPoolItem* GetDefaultItem() const { return pDefaultItem; }
+
+ // von sich selbst eine Kopie erzeugen
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, USHORT nVersion) const;
+ virtual SvStream& Store(SvStream &, USHORT nVer ) const;
+};
+#endif /* @@@ NOT USED @@@ */
+
+// -----------------------------------------------------------------------
+// Handle Klasse fuer PoolItems
+
+class SVL_DLLPUBLIC SfxItemHandle
+{
+ USHORT *pRef;
+ SfxPoolItem *pItem;
+public:
+ SfxItemHandle( SfxPoolItem& );
+ SfxItemHandle( const SfxItemHandle& );
+ ~SfxItemHandle();
+
+ const SfxItemHandle &operator=(const SfxItemHandle &);
+ const SfxPoolItem &GetItem() const { return *pItem; }
+};
+
+// -----------------------------------------------------------------------
+
+DECL_PTRHINT(SVL_DLLPUBLIC, SfxPoolItemHint, SfxPoolItem);
+
+// -----------------------------------------------------------------------
+
+#if 0 /* @@@ NOT USED @@@ */
+class SfxItemChangedHint: public SfxHint
+{
+ const SfxPoolItem& _rOld;
+ const SfxPoolItem& _rNew;
+
+public:
+ TYPEINFO(); \
+ SfxItemChangedHint( const SfxPoolItem &rOld,
+ const SfxPoolItem &rNew )
+ : _rOld( rOld ),
+ _rNew( rNew )
+ {}
+
+ const SfxPoolItem& GetOldItem() const { return _rOld; }
+ const SfxPoolItem& GetNewItem() const { return _rNew; }
+};
+
+#endif /* @@@ NOT USED @@@ */
+
+#endif // #ifndef _SFXPOOLITEM_HXX
diff --git a/svtools/inc/svtools/printdlg.hxx b/svtools/inc/svtools/printdlg.hxx
new file mode 100644
index 000000000000..a18d38acda7c
--- /dev/null
+++ b/svtools/inc/svtools/printdlg.hxx
@@ -0,0 +1,278 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: printdlg.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: vg $ $Date: 2007-04-11 19:31:39 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _SV_PRINTDLG_HXX_
+#define _SV_PRINTDLG_HXX_
+
+#ifndef INCLUDED_SVTDLLAPI_H
+#include "svtools/svtdllapi.h"
+#endif
+
+#ifndef _VCL_DIALOG_HXX
+#include <vcl/dialog.hxx>
+#endif
+#ifndef _VCL_FIXED_HXX
+#include <vcl/fixed.hxx>
+#endif
+#ifndef _VCL_BUTTON_HXX
+#include <vcl/button.hxx>
+#endif
+#ifndef _VCL_GROUP_HXX
+#include <vcl/group.hxx>
+#endif
+#ifndef _VCL_FIELD_HXX
+#include <vcl/field.hxx>
+#endif
+#ifndef _VCL_EDIT_HXX
+#include <vcl/edit.hxx>
+#endif
+#ifndef _VCL_LSTBOX_HXX
+#include <vcl/lstbox.hxx>
+#endif
+#ifndef _STDCTRL_HXX
+#include <svtools/stdctrl.hxx>
+#endif
+
+class Printer;
+class QueueInfo;
+struct SvtPrinterImpl;
+
+// ---------------------
+// - PrintDialog-Types -
+// ---------------------
+
+enum PrintDialogRange { PRINTDIALOG_ALL, PRINTDIALOG_SELECTION,
+ PRINTDIALOG_FROMTO, PRINTDIALOG_RANGE };
+
+// ---------------
+// - PrintDialog -
+// ---------------
+
+class SVT_DLLPUBLIC PrintDialog : public ModalDialog
+{
+private:
+ FixedLine maFlPrinter;
+ FixedText maFtName;
+ ListBox maLbName;
+ PushButton maBtnProperties;
+ FixedText maFtStatus;
+ FixedInfo maFiStatus;
+ FixedText maFtType;
+ FixedInfo maFiType;
+ FixedText maFtLocation;
+ FixedInfo maFiLocation;
+ FixedText maFtComment;
+ FixedInfo maFiComment;
+ CheckBox maCbxFilePrint;
+ FixedInfo maFiPrintFile;
+ FixedText maFiFaxNo;
+ Edit maEdtFaxNo;
+ PushButton maBtnBrowse_nomore;
+ FixedLine maFlPrintRange;
+ RadioButton maRbtAll;
+ RadioButton maRbtPages;
+ RadioButton maRbtSelection;
+ Edit maEdtPages;
+ FixedLine maFlCopies;
+ FixedText maFtCopies;
+ NumericField maNumCopies;
+ FixedImage maImgCollate;
+ FixedImage maImgNotCollate;
+ CheckBox maCbxCollate;
+ PushButton maBtnOptions;
+ OKButton maBtnOK;
+ CancelButton maBtnCancel;
+ HelpButton maBtnHelp;
+ AutoTimer maStatusTimer;
+ FixedLine maFlSepCopiesRange;
+ FixedLine maFlSepButtonLine;
+
+ Printer* mpPrinter;
+ SvtPrinterImpl* mpPrinterImpl;
+
+ XubString maRangeText;
+ USHORT mnCopyCount;
+ USHORT mnFirstPage;
+ USHORT mnLastPage;
+ USHORT mnMinPage;
+ USHORT mnMaxPage;
+ PrintDialogRange meCheckRange;
+ BOOL mbAll;
+ BOOL mbSelection;
+ BOOL mbFromTo;
+ BOOL mbRange;
+ BOOL mbCollate;
+ BOOL mbCollateCheck;
+ BOOL mbOptions;
+ Link maOptionsHdlLink; // Link zum Options-Handler
+ Link maOKHdlLink; // Link zum OK-Handler
+
+ String maAllFilterStr;
+
+ SVT_DLLPRIVATE void ImplCheckOK();
+ SVT_DLLPRIVATE void ImplInitControls();
+ SVT_DLLPRIVATE void ImplFillDialogData();
+ SVT_DLLPRIVATE void ImplSetInfo();
+ SVT_DLLPRIVATE void ImplSetImages();
+ SVT_DLLPRIVATE bool ImplGetFilename();
+
+ DECL_DLLPRIVATE_LINK( ImplPropertiesHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplChangePrinterHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplModifyControlHdl, void* );
+ DECL_DLLPRIVATE_LINK( ImplStatusHdl, Timer* );
+
+public:
+ PrintDialog( Window* pWindow );
+ ~PrintDialog();
+
+ virtual long OK();
+ virtual long ClickOptionsHdl();
+
+ void SetPrinter( Printer* pNewPrinter ) { mpPrinter = pNewPrinter; }
+ Printer* GetPrinter() const { return mpPrinter; }
+
+ void EnableRange( PrintDialogRange eRange );
+ void DisableRange( PrintDialogRange eRange );
+ BOOL IsRangeEnabled( PrintDialogRange eRange ) const;
+
+ void CheckRange( PrintDialogRange eRange = PRINTDIALOG_ALL )
+ { meCheckRange = eRange; }
+ PrintDialogRange GetCheckedRange() const { return meCheckRange; }
+ BOOL IsRangeChecked( PrintDialogRange eRange ) const;
+
+ void SetRangeText( const XubString& rRange ) { maRangeText = rRange; }
+ const XubString& GetRangeText() const { return maRangeText; }
+
+ void SetFirstPage( USHORT nPage = 0 );
+ USHORT GetFirstPage() const { return mnFirstPage; }
+ void SetLastPage( USHORT nPage = 0 );
+ USHORT GetLastPage() const { return mnLastPage; }
+
+ void SetMinPage( USHORT nPage = 1 ) { mnMinPage = nPage; }
+ USHORT GetMinPage() const { return mnMinPage; }
+ void SetMaxPage( USHORT nPage = 65535 ) { mnMaxPage = nPage; }
+ USHORT GetMaxPage() const { return mnMaxPage; }
+
+ void SetCopyCount( USHORT nCopies = 1 ) { mnCopyCount = nCopies; }
+ USHORT GetCopyCount() const { return mnCopyCount; }
+
+ void EnableCollate( BOOL bEnable = TRUE )
+ { mbCollate = bEnable; }
+ BOOL IsCollateEnabled() const { return mbCollate; }
+ void CheckCollate( BOOL bCheck = TRUE )
+ { mbCollateCheck = bCheck; }
+ BOOL IsCollateChecked() const { return mbCollateCheck; }
+
+ void ShowOptionsButton( BOOL bShow = TRUE )
+ { mbOptions = bShow; }
+ BOOL IsOptionsButtonVisible() const { return mbOptions; }
+
+ void SetOptionsHdl( const Link& rLink ) { maOptionsHdlLink = rLink; }
+ const Link& GetOptionsHdl() const { return maOptionsHdlLink; }
+
+ void SetOKHdl( const Link& rLink ) { maOKHdlLink = rLink; }
+ const Link& GetOKHdl() const { return maOKHdlLink; }
+
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+
+ virtual short Execute();
+
+ void DisableHelp();
+};
+
+inline void PrintDialog::EnableRange( PrintDialogRange eRange )
+{
+ if ( eRange == PRINTDIALOG_ALL )
+ mbAll = TRUE;
+ else if ( eRange == PRINTDIALOG_SELECTION )
+ mbSelection = TRUE;
+ else if ( eRange == PRINTDIALOG_FROMTO )
+ mbFromTo = TRUE;
+ else
+ mbRange = TRUE;
+}
+
+inline void PrintDialog::DisableRange( PrintDialogRange eRange )
+{
+ if ( eRange == PRINTDIALOG_ALL )
+ mbAll = FALSE;
+ else if ( eRange == PRINTDIALOG_SELECTION )
+ mbSelection = FALSE;
+ else if ( eRange == PRINTDIALOG_FROMTO )
+ mbFromTo = FALSE;
+ else
+ mbRange = FALSE;
+}
+
+inline BOOL PrintDialog::IsRangeEnabled( PrintDialogRange eRange ) const
+{
+ BOOL bRet;
+
+ if ( eRange == PRINTDIALOG_ALL )
+ bRet = mbAll;
+ else if ( eRange == PRINTDIALOG_SELECTION )
+ bRet = mbSelection;
+ else if ( eRange == PRINTDIALOG_FROMTO )
+ bRet = mbFromTo;
+ else
+ bRet = mbRange;
+
+ return bRet;
+}
+
+inline BOOL PrintDialog::IsRangeChecked( PrintDialogRange eRange ) const
+{
+ if ( eRange == meCheckRange )
+ return TRUE;
+ else
+ return FALSE;
+}
+
+inline void PrintDialog::SetFirstPage( USHORT nPage )
+{
+ mnFirstPage = nPage;
+ if ( nPage && (nPage < mnMinPage) )
+ mnMinPage = nPage;
+}
+
+inline void PrintDialog::SetLastPage( USHORT nPage )
+{
+ mnLastPage = nPage;
+ if ( nPage && (nPage > mnMaxPage) )
+ mnMaxPage = nPage;
+}
+
+#endif // _SV_PRINTDLG_HXX_