2000-09-18 16:07:07 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 17:52:14 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 17:52:14 +00:00
|
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 17:52:14 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 17:52:14 +00:00
|
|
|
* $RCSfile: scmod.hxx,v $
|
2008-09-30 05:48:28 +00:00
|
|
|
* $Revision: 1.24.32.1 $
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 17:52:14 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 17:52:14 +00:00
|
|
|
* 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.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 17:52:14 +00:00
|
|
|
* 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).
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 17:52:14 +00:00
|
|
|
* 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.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#ifndef SC_SCMOD_HXX
|
|
|
|
#define SC_SCMOD_HXX
|
|
|
|
|
2004-08-23 08:26:06 +00:00
|
|
|
#include "scdllapi.h"
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "scdll.hxx"
|
|
|
|
#include <vcl/timer.hxx>
|
|
|
|
#include <svtools/lstner.hxx>
|
|
|
|
#include "global.hxx" // ScInputMode
|
|
|
|
#include "markdata.hxx" //ScMarkData
|
|
|
|
#include "shellids.hxx"
|
|
|
|
|
2004-10-04 19:04:03 +00:00
|
|
|
#include <tools/shl.hxx>
|
|
|
|
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
class KeyEvent;
|
|
|
|
class SdrModel;
|
|
|
|
class SdrView;
|
|
|
|
class EditView;
|
|
|
|
class SfxErrorHandler;
|
|
|
|
class SvxErrorHandler;
|
2002-04-24 12:35:43 +00:00
|
|
|
class SvtAccessibilityOptions;
|
2003-05-27 14:07:24 +00:00
|
|
|
class SvtCTLOptions;
|
2004-04-29 15:33:52 +00:00
|
|
|
class SvtUserOptions;
|
2002-04-24 12:35:43 +00:00
|
|
|
|
2003-03-26 17:07:02 +00:00
|
|
|
namespace svtools { class ColorConfig; }
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
class ScRange;
|
|
|
|
class ScDocument;
|
|
|
|
class ScViewCfg;
|
|
|
|
class ScDocCfg;
|
|
|
|
class ScAppCfg;
|
|
|
|
class ScInputCfg;
|
2001-05-29 18:46:58 +00:00
|
|
|
class ScPrintCfg;
|
2000-09-18 16:07:07 +00:00
|
|
|
class ScViewOptions;
|
|
|
|
class ScDocOptions;
|
|
|
|
class ScAppOptions;
|
|
|
|
class ScInputOptions;
|
2001-05-29 18:46:58 +00:00
|
|
|
class ScPrintOptions;
|
2000-09-18 16:07:07 +00:00
|
|
|
class ScInputHandler;
|
|
|
|
class ScInputWindow;
|
|
|
|
class ScTabViewShell;
|
|
|
|
class ScFunctionDlg;
|
|
|
|
class ScArgDlgBase;
|
|
|
|
class ScTeamDlg;
|
|
|
|
class ScEditFunctionDlg;
|
|
|
|
class ScMessagePool;
|
|
|
|
class EditFieldInfo;
|
|
|
|
class ScNavipiCfg;
|
2006-08-04 11:11:26 +00:00
|
|
|
class ScAddInCfg;
|
2000-09-18 16:07:07 +00:00
|
|
|
class ScFormEditData;
|
2001-02-14 18:12:19 +00:00
|
|
|
class ScTransferObj;
|
|
|
|
class ScDrawTransferObj;
|
2001-10-02 17:32:43 +00:00
|
|
|
class ScSelectionTransferObj;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
//==================================================================
|
|
|
|
|
|
|
|
// for internal Drag&Drop:
|
|
|
|
|
|
|
|
#define SC_DROP_NAVIGATOR 1
|
|
|
|
#define SC_DROP_TABLE 2
|
|
|
|
|
|
|
|
struct ScDragData
|
|
|
|
{
|
2001-03-23 18:26:39 +00:00
|
|
|
ScTransferObj* pCellTransfer;
|
|
|
|
ScDrawTransferObj* pDrawTransfer;
|
|
|
|
|
|
|
|
String aLinkDoc;
|
|
|
|
String aLinkTable;
|
|
|
|
String aLinkArea;
|
|
|
|
ScDocument* pJumpLocalDoc;
|
|
|
|
String aJumpTarget;
|
|
|
|
String aJumpText;
|
2000-09-18 16:07:07 +00:00
|
|
|
};
|
|
|
|
|
2001-02-14 18:12:19 +00:00
|
|
|
struct ScClipData
|
|
|
|
{
|
|
|
|
ScTransferObj* pCellClipboard;
|
|
|
|
ScDrawTransferObj* pDrawClipboard;
|
|
|
|
};
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
//==================================================================
|
|
|
|
|
|
|
|
|
2003-09-19 07:20:57 +00:00
|
|
|
class ScModule: public SfxModule, public SfxListener
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
Timer aIdleTimer;
|
|
|
|
Timer aSpellTimer;
|
|
|
|
ScDragData aDragData;
|
2001-02-14 18:12:19 +00:00
|
|
|
ScClipData aClipData;
|
2001-10-02 17:32:43 +00:00
|
|
|
ScSelectionTransferObj* pSelTransfer;
|
2000-09-18 16:07:07 +00:00
|
|
|
ScMessagePool* pMessagePool;
|
|
|
|
// globalen InputHandler gibt's nicht mehr, jede View hat einen
|
|
|
|
ScInputHandler* pRefInputHandler;
|
|
|
|
ScTeamDlg* pTeamDlg;
|
|
|
|
ScViewCfg* pViewCfg;
|
|
|
|
ScDocCfg* pDocCfg;
|
|
|
|
ScAppCfg* pAppCfg;
|
|
|
|
ScInputCfg* pInputCfg;
|
2001-05-29 18:46:58 +00:00
|
|
|
ScPrintCfg* pPrintCfg;
|
2000-09-18 16:07:07 +00:00
|
|
|
ScNavipiCfg* pNavipiCfg;
|
2006-08-04 11:11:26 +00:00
|
|
|
ScAddInCfg* pAddInCfg;
|
2003-03-26 17:07:02 +00:00
|
|
|
svtools::ColorConfig* pColorConfig;
|
2002-04-24 12:35:43 +00:00
|
|
|
SvtAccessibilityOptions* pAccessOptions;
|
2003-05-27 14:07:24 +00:00
|
|
|
SvtCTLOptions* pCTLOptions;
|
2004-04-29 15:33:52 +00:00
|
|
|
SvtUserOptions* pUserOptions;
|
2000-09-18 16:07:07 +00:00
|
|
|
SfxErrorHandler* pErrorHdl;
|
|
|
|
SvxErrorHandler* pSvxErrorHdl;
|
|
|
|
ScFormEditData* pFormEditData;
|
|
|
|
USHORT nCurRefDlgId;
|
|
|
|
BOOL bIsWaterCan;
|
|
|
|
BOOL bIsInEditCommand;
|
2004-09-08 14:28:31 +00:00
|
|
|
BOOL bIsInExecuteDrop;
|
2008-03-07 11:15:47 +00:00
|
|
|
bool mbIsInSharedDocLoading;
|
|
|
|
bool mbIsInSharedDocSaving;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
public:
|
2007-02-27 10:57:59 +00:00
|
|
|
SFX_DECL_INTERFACE(SCID_APP)
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
ScModule( SfxObjectFactory* pFact );
|
|
|
|
virtual ~ScModule();
|
|
|
|
|
|
|
|
virtual void FillStatusBar(StatusBar &rBar);
|
|
|
|
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
|
|
|
|
void DeleteCfg();
|
|
|
|
|
|
|
|
// von der Applikation verschoben:
|
|
|
|
|
|
|
|
DECL_LINK( IdleHandler, Timer* ); // Timer statt idle
|
|
|
|
DECL_LINK( SpellTimerHdl, Timer* );
|
|
|
|
DECL_LINK( CalcFieldValueHdl, EditFieldInfo* );
|
|
|
|
|
|
|
|
void Execute( SfxRequest& rReq );
|
|
|
|
void GetState( SfxItemSet& rSet );
|
2005-11-16 09:12:22 +00:00
|
|
|
void HideDisabledSlots( SfxItemSet& rSet );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
void AnythingChanged();
|
|
|
|
|
|
|
|
// Drag & Drop:
|
|
|
|
const ScDragData& GetDragData() const { return aDragData; }
|
2001-03-23 18:26:39 +00:00
|
|
|
void SetDragObject( ScTransferObj* pCellObj, ScDrawTransferObj* pDrawObj );
|
2000-09-18 16:07:07 +00:00
|
|
|
void ResetDragObject();
|
|
|
|
void SetDragLink( const String& rDoc, const String& rTab, const String& rArea );
|
|
|
|
void SetDragJump( ScDocument* pLocalDoc,
|
|
|
|
const String& rTarget, const String& rText );
|
|
|
|
|
2001-02-14 18:12:19 +00:00
|
|
|
// clipboard:
|
|
|
|
const ScClipData& GetClipData() const { return aClipData; }
|
|
|
|
void SetClipObject( ScTransferObj* pCellObj, ScDrawTransferObj* pDrawObj );
|
|
|
|
|
|
|
|
ScDocument* GetClipDoc(); // called from document - should be removed later
|
|
|
|
|
2001-10-02 17:32:43 +00:00
|
|
|
// X selection:
|
|
|
|
ScSelectionTransferObj* GetSelectionTransfer() const { return pSelTransfer; }
|
|
|
|
void SetSelectionTransfer( ScSelectionTransferObj* pNew );
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
void SetWaterCan( BOOL bNew ) { bIsWaterCan = bNew; }
|
|
|
|
BOOL GetIsWaterCan() const { return bIsWaterCan; }
|
|
|
|
|
|
|
|
void SetInEditCommand( BOOL bNew ) { bIsInEditCommand = bNew; }
|
|
|
|
BOOL IsInEditCommand() const { return bIsInEditCommand; }
|
|
|
|
|
2004-09-08 14:28:31 +00:00
|
|
|
void SetInExecuteDrop( BOOL bNew ) { bIsInExecuteDrop = bNew; }
|
|
|
|
BOOL IsInExecuteDrop() const { return bIsInExecuteDrop; }
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// Options:
|
|
|
|
const ScViewOptions& GetViewOptions ();
|
|
|
|
const ScDocOptions& GetDocOptions ();
|
2004-08-23 08:26:06 +00:00
|
|
|
SC_DLLPUBLIC const ScAppOptions& GetAppOptions ();
|
2000-09-18 16:07:07 +00:00
|
|
|
const ScInputOptions& GetInputOptions ();
|
2004-08-23 08:26:06 +00:00
|
|
|
SC_DLLPUBLIC const ScPrintOptions& GetPrintOptions ();
|
2000-09-18 16:07:07 +00:00
|
|
|
void SetViewOptions ( const ScViewOptions& rOpt );
|
|
|
|
void SetDocOptions ( const ScDocOptions& rOpt );
|
2004-08-23 08:26:06 +00:00
|
|
|
SC_DLLPUBLIC void SetAppOptions ( const ScAppOptions& rOpt );
|
2000-09-18 16:07:07 +00:00
|
|
|
void SetInputOptions ( const ScInputOptions& rOpt );
|
2001-05-29 18:46:58 +00:00
|
|
|
void SetPrintOptions ( const ScPrintOptions& rOpt );
|
2000-09-18 16:07:07 +00:00
|
|
|
void InsertEntryToLRUList(USHORT nFIndex);
|
|
|
|
void RecentFunctionsChanged();
|
|
|
|
|
2000-11-26 12:38:36 +00:00
|
|
|
static void GetSpellSettings( USHORT& rDefLang, USHORT& rCjkLang, USHORT& rCtlLang,
|
2008-12-15 12:01:46 +00:00
|
|
|
BOOL& rAutoSpell );
|
2000-09-18 16:07:07 +00:00
|
|
|
static void SetAutoSpellProperty( BOOL bSet );
|
|
|
|
static BOOL HasThesaurusLanguage( USHORT nLang );
|
|
|
|
|
2003-05-27 14:07:24 +00:00
|
|
|
USHORT GetOptDigitLanguage(); // from CTL options
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
ScNavipiCfg& GetNavipiCfg();
|
2006-08-04 11:11:26 +00:00
|
|
|
ScAddInCfg& GetAddInCfg();
|
2003-03-26 17:07:02 +00:00
|
|
|
svtools::ColorConfig& GetColorConfig();
|
2002-04-24 12:35:43 +00:00
|
|
|
SvtAccessibilityOptions& GetAccessOptions();
|
2003-05-27 14:07:24 +00:00
|
|
|
SvtCTLOptions& GetCTLOptions();
|
2004-04-29 15:33:52 +00:00
|
|
|
SvtUserOptions& GetUserOptions();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
void ModifyOptions( const SfxItemSet& rOptSet );
|
|
|
|
|
|
|
|
// InputHandler:
|
|
|
|
BOOL IsEditMode(); // nicht bei SC_INPUT_TYPE
|
|
|
|
BOOL IsInputMode(); // auch bei SC_INPUT_TYPE
|
|
|
|
void SetInputMode( ScInputMode eMode );
|
|
|
|
BOOL InputKeyEvent( const KeyEvent& rKEvt, BOOL bStartEdit = FALSE );
|
2007-04-25 14:57:47 +00:00
|
|
|
SC_DLLPUBLIC void InputEnterHandler( BYTE nBlockMode = 0 );
|
2000-09-18 16:07:07 +00:00
|
|
|
void InputCancelHandler();
|
|
|
|
void InputSelection( EditView* pView );
|
|
|
|
void InputChanged( EditView* pView );
|
2002-10-24 16:17:42 +00:00
|
|
|
ScInputHandler* GetInputHdl( ScTabViewShell* pViewSh = NULL, BOOL bUseRef = TRUE );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
void SetRefInputHdl( ScInputHandler* pNew );
|
|
|
|
ScInputHandler* GetRefInputHdl();
|
|
|
|
|
|
|
|
void ViewShellGone(ScTabViewShell* pViewSh);
|
|
|
|
void ViewShellChanged();
|
|
|
|
// Kommunikation mit Funktionsautopilot
|
|
|
|
void InputGetSelection( xub_StrLen& rStart, xub_StrLen& rEnd );
|
|
|
|
void InputSetSelection( xub_StrLen nStart, xub_StrLen nEnd );
|
|
|
|
void InputReplaceSelection( const String& rStr );
|
|
|
|
String InputGetFormulaStr();
|
|
|
|
void ActivateInputWindow( const String* pStr = NULL,
|
|
|
|
BOOL bMatrix = FALSE );
|
|
|
|
|
|
|
|
void InitFormEditData();
|
|
|
|
void ClearFormEditData();
|
|
|
|
ScFormEditData* GetFormEditData() { return pFormEditData; }
|
|
|
|
|
|
|
|
// Referenzeingabe:
|
2000-11-09 18:52:44 +00:00
|
|
|
void SetRefDialog( USHORT nId, BOOL bVis, SfxViewFrame* pViewFrm = NULL );
|
2000-09-18 16:07:07 +00:00
|
|
|
BOOL IsModalMode(SfxObjectShell* pDocSh = NULL);
|
|
|
|
BOOL IsFormulaMode();
|
|
|
|
BOOL IsRefDialogOpen();
|
|
|
|
BOOL IsTableLocked();
|
|
|
|
void OpenTeamDlg();
|
|
|
|
void SetTeamDlg( ScTeamDlg* pDlg ) { pTeamDlg = pDlg; }
|
|
|
|
ScTeamDlg* GetTeamDlg() const { return pTeamDlg; }
|
|
|
|
void SetReference( const ScRange& rRef, ScDocument* pDoc,
|
|
|
|
const ScMarkData* pMarkData = NULL );
|
|
|
|
void AddRefEntry();
|
|
|
|
void EndReference();
|
|
|
|
USHORT GetCurRefDlgId() const { return nCurRefDlgId; }
|
|
|
|
|
|
|
|
//virtuelle Methoden fuer den Optionendialog
|
|
|
|
virtual SfxItemSet* CreateItemSet( USHORT nId );
|
|
|
|
virtual void ApplyItemSet( USHORT nId, const SfxItemSet& rSet );
|
|
|
|
virtual SfxTabPage* CreateTabPage( USHORT nId, Window* pParent, const SfxItemSet& rSet );
|
2008-03-07 11:15:47 +00:00
|
|
|
|
|
|
|
void SetInSharedDocLoading( bool bNew ) { mbIsInSharedDocLoading = bNew; }
|
|
|
|
bool IsInSharedDocLoading() const { return mbIsInSharedDocLoading; }
|
|
|
|
void SetInSharedDocSaving( bool bNew ) { mbIsInSharedDocSaving = bNew; }
|
|
|
|
bool IsInSharedDocSaving() const { return mbIsInSharedDocSaving; }
|
2000-09-18 16:07:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#define SC_MOD() ( *(ScModule**) GetAppData(SHL_CALC) )
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|