diff options
author | Thomas Lange [tl] <tl@openoffice.org> | 2010-06-09 14:50:43 +0200 |
---|---|---|
committer | Thomas Lange [tl] <tl@openoffice.org> | 2010-06-09 14:50:43 +0200 |
commit | 5c14cccd4010d26ed84f85dc0c6944a34c407c91 (patch) | |
tree | 86ce5d2b0e40cd6874194a21adbda4c367b9a386 /sfx2/inc/sfx2 | |
parent | c3cc527322caac93bdd7d4a961a19d4366f86987 (diff) | |
parent | 6299e019bff7c651e9585d5bf2234539233a646d (diff) |
cws tl74: merge with DEV300_m81
Diffstat (limited to 'sfx2/inc/sfx2')
-rw-r--r-- | sfx2/inc/sfx2/Metadatable.hxx | 4 | ||||
-rw-r--r-- | sfx2/inc/sfx2/app.hxx | 4 | ||||
-rw-r--r-- | sfx2/inc/sfx2/childwin.hxx | 42 | ||||
-rw-r--r-- | sfx2/inc/sfx2/filedlghelper.hxx | 24 | ||||
-rw-r--r-- | sfx2/inc/sfx2/module.hxx | 2 | ||||
-rw-r--r-- | sfx2/inc/sfx2/objsh.hxx | 6 | ||||
-rw-r--r-- | sfx2/inc/sfx2/sfxsids.hrc | 1 | ||||
-rw-r--r-- | sfx2/inc/sfx2/taskpane.hxx | 245 | ||||
-rw-r--r-- | sfx2/inc/sfx2/titledockwin.hxx | 162 | ||||
-rw-r--r-- | sfx2/inc/sfx2/viewfrm.hxx | 66 | ||||
-rw-r--r-- | sfx2/inc/sfx2/viewsh.hxx | 7 |
11 files changed, 449 insertions, 114 deletions
diff --git a/sfx2/inc/sfx2/Metadatable.hxx b/sfx2/inc/sfx2/Metadatable.hxx index fb5c2cce13..6896fd689f 100644 --- a/sfx2/inc/sfx2/Metadatable.hxx +++ b/sfx2/inc/sfx2/Metadatable.hxx @@ -98,8 +98,8 @@ public: const bool i_bCopyPrecedesSource = false); /** create an Undo Metadatable, which remembers this' reference */ - ::boost::shared_ptr<MetadatableUndo> CreateUndo( - const bool i_isDelete = false); + ::boost::shared_ptr<MetadatableUndo> CreateUndo() const; + ::boost::shared_ptr<MetadatableUndo> CreateUndoForDelete(); /** restore this from Undo Metadatable */ void RestoreMetadata(::boost::shared_ptr<MetadatableUndo> const& i_pUndo); diff --git a/sfx2/inc/sfx2/app.hxx b/sfx2/inc/sfx2/app.hxx index 18c3735d1c..9811bf838b 100644 --- a/sfx2/inc/sfx2/app.hxx +++ b/sfx2/inc/sfx2/app.hxx @@ -33,6 +33,7 @@ #include <tools/solar.h> #include <svl/smplhint.hxx> #include <svl/poolitem.hxx> +#include <vcl/image.hxx> #include <tools/ref.hxx> #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/script/XLibraryContainer.hpp> @@ -316,6 +317,9 @@ public: SAL_DLLPRIVATE SfxModule* GetModule_Impl(); SAL_DLLPRIVATE ResMgr* GetOffResManager_Impl(); //#endif + + /** loads the application logo as used in the about dialog and impress slideshow pause screen */ + static Image GetApplicationLogo(); }; #define SFX_APP() SfxGetpApp() diff --git a/sfx2/inc/sfx2/childwin.hxx b/sfx2/inc/sfx2/childwin.hxx index d93999d99b..a83249963a 100644 --- a/sfx2/inc/sfx2/childwin.hxx +++ b/sfx2/inc/sfx2/childwin.hxx @@ -87,13 +87,13 @@ struct SfxChildWinInfo }; // Factory-Methode eines ChildWindows -typedef SfxChildWindow* (*SfxChildWinCtor)( Window *pParentWindow, +typedef SfxChildWindow* (*SfxChildWinCtor)( ::Window *pParentWindow, sal_uInt16 nId, SfxBindings *pBindings, SfxChildWinInfo *pInfo); // Factory-Methode eines ChildWindowsContexts -typedef SfxChildWindowContext* (*SfxChildWinContextCtor)( Window *pParentWindow, +typedef SfxChildWindowContext* (*SfxChildWinContextCtor)( ::Window *pParentWindow, SfxBindings *pBindings, SfxChildWinInfo *pInfo); struct SfxChildWinContextFactory @@ -143,8 +143,8 @@ struct SfxChildWindow_Impl; class SFX2_DLLPUBLIC SfxChildWindowContext { friend class SfxChildWindow; - Window* pWindow; - sal_uInt16 nContextId; + ::Window* pWindow; + sal_uInt16 nContextId; protected: SfxChildWindowContext( sal_uInt16 nId ); @@ -152,9 +152,9 @@ protected: public: virtual ~SfxChildWindowContext(); - void SetWindow( Window* pWin ) + void SetWindow( ::Window* pWin ) { pWindow=pWin; } - Window* GetWindow() const + ::Window* GetWindow() const { return pWindow; } sal_uInt16 GetContextId() const { return nContextId; } @@ -169,12 +169,12 @@ public: class SFX2_DLLPUBLIC SfxChildWindow { - Window* pParent; // parent window ( Topwindow ) - sal_uInt16 nType; // ChildWindow-Id + ::Window* pParent; // parent window ( Topwindow ) + sal_uInt16 nType; // ChildWindow-Id protected: SfxChildAlignment eChildAlignment;// aktuelles ::com::sun::star::drawing::Alignment - Window* pWindow; // eigentlicher Inhalt + ::Window* pWindow; // eigentlicher Inhalt SfxChildWindow_Impl* pImp; // Imp-Daten private: @@ -185,14 +185,14 @@ private: { return pContext; } protected: - SfxChildWindow(Window *pParentWindow, sal_uInt16 nId); + SfxChildWindow(::Window *pParentWindow, sal_uInt16 nId); public: virtual ~SfxChildWindow(); void Destroy(); - Window* GetWindow() const + ::Window* GetWindow() const { return pWindow; } - Window* GetParent() const + ::Window* GetParent() const { return pParent; } SfxChildAlignment GetAlignment() const { return eChildAlignment; } @@ -217,17 +217,17 @@ public: sal_uInt16 GetContextId() const { return pContext ? pContext->GetContextId(): 0; } - Window* GetContextWindow() const + ::Window* GetContextWindow() const { return pContext ? pContext->GetWindow(): 0; } - Window* GetContextWindow( SfxModule *pModule ) const; + ::Window* GetContextWindow( SfxModule *pModule ) const; virtual SfxChildWinInfo GetInfo() const; void SaveStatus(const SfxChildWinInfo& rInfo); static void RegisterChildWindow(SfxModule*, SfxChildWinFactory*); - static SfxChildWindow* CreateChildWindow( sal_uInt16, Window*, SfxBindings*, SfxChildWinInfo&); + static SfxChildWindow* CreateChildWindow( sal_uInt16, ::Window*, SfxBindings*, SfxChildWinInfo&); void SetHideNotDelete( sal_Bool bOn ); sal_Bool IsHideNotDelete() const; void SetHideAtToggle( sal_Bool bOn ); @@ -258,19 +258,19 @@ public: //------------------------------------------------------------------ //! demn"achst hinf"allig ! #define SFX_DECL_CHILDWINDOW_CONTEXT(Class) \ - static SfxChildWindowContext* CreateImpl(Window *pParent, \ + static SfxChildWindowContext* CreateImpl(::Window *pParent, \ SfxBindings *pBindings, SfxChildWinInfo* pInfo ); \ static void RegisterChildWindowContext(SfxModule *pMod=0); \ //! Das Macro der Zukunft ... #define SFX_DECL_CHILDWINDOWCONTEXT(Class) \ - static SfxChildWindowContext* CreateImpl(Window *pParent, \ + static SfxChildWindowContext* CreateImpl(::Window *pParent, \ SfxBindings *pBindings, SfxChildWinInfo* pInfo ); \ static void RegisterChildWindowContext(sal_uInt16, SfxModule *pMod=0); \ //! demn"achst hinf"allig ! #define SFX_IMPL_CHILDWINDOW_CONTEXT(Class, MyID, ShellClass) \ - SfxChildWindowContext* __EXPORT Class::CreateImpl( Window *pParent, \ + SfxChildWindowContext* __EXPORT Class::CreateImpl( ::Window *pParent, \ SfxBindings *pBindings, SfxChildWinInfo* pInfo ) \ { \ SfxChildWindowContext *pContext = new Class(pParent, \ @@ -290,7 +290,7 @@ public: // CreateImpl mu\s noch als Parameter die Factory mitbekommen wg. ContextId // Solange wird diese Id auf 0 gesetzt und in SfxChildWindow::CreateContext gepatched #define SFX_IMPL_CHILDWINDOWCONTEXT(Class, MyID) \ - SfxChildWindowContext* __EXPORT Class::CreateImpl( Window *pParent, \ + SfxChildWindowContext* __EXPORT Class::CreateImpl( ::Window *pParent, \ SfxBindings *pBindings, SfxChildWinInfo* pInfo ) \ { \ SfxChildWindowContext *pContext = new Class(pParent,0,pBindings,pInfo);\ @@ -305,7 +305,7 @@ public: #define SFX_DECL_CHILDWINDOW(Class) \ public : \ - static SfxChildWindow* CreateImpl(Window *pParent, sal_uInt16 nId, \ + static SfxChildWindow* CreateImpl(::Window *pParent, sal_uInt16 nId, \ SfxBindings *pBindings, SfxChildWinInfo* pInfo ); \ static void RegisterChildWindow (sal_Bool bVisible=sal_False, SfxModule *pMod=NULL, sal_uInt16 nFlags=0); \ static sal_uInt16 GetChildWindowId ();\ @@ -315,7 +315,7 @@ public: SFX_IMPL_POS_CHILDWINDOW(Class, MyID, CHILDWIN_NOPOS) #define SFX_IMPL_POS_CHILDWINDOW(Class, MyID, Pos) \ - SfxChildWindow* __EXPORT Class::CreateImpl( Window *pParent, \ + SfxChildWindow* __EXPORT Class::CreateImpl( ::Window *pParent, \ sal_uInt16 nId, SfxBindings *pBindings, SfxChildWinInfo* pInfo ) \ { \ SfxChildWindow *pWin = new Class(pParent, nId, pBindings, pInfo);\ diff --git a/sfx2/inc/sfx2/filedlghelper.hxx b/sfx2/inc/sfx2/filedlghelper.hxx index aff1ff8d49..4257353c9b 100644 --- a/sfx2/inc/sfx2/filedlghelper.hxx +++ b/sfx2/inc/sfx2/filedlghelper.hxx @@ -102,30 +102,6 @@ class Window; #define FILE_OPEN_SERVICE_NAME_SYSTEM "com.sun.star.ui.dialogs.SystemFilePicker" #define FILE_OPEN_SERVICE_NAME_OOO "com.sun.star.ui.dialogs.OfficeFilePicker" -//***************************************************************************** -// SfxUrlDialog -//***************************************************************************** - -//#if 0 // _SOLAR__PRIVATE -#ifndef DONT_USE_FILE_DIALOG_SERVICE - -class SfxUrlDialog : public ModalDialog -{ -private: - Edit aEdit; - OKButton aOk; - CancelButton aCancel; - -public: - SfxUrlDialog( Window* pParent ); - - String GetUrl() const { return aEdit.GetText(); } - void SetUrl( const String& rUrl ) { aEdit.SetText( rUrl ); } -}; - -#endif -//#endif - //----------------------------------------------------------------------------- namespace sfx2 { diff --git a/sfx2/inc/sfx2/module.hxx b/sfx2/inc/sfx2/module.hxx index c6b5b523c3..2cb48c64da 100644 --- a/sfx2/inc/sfx2/module.hxx +++ b/sfx2/inc/sfx2/module.hxx @@ -93,6 +93,8 @@ public: virtual void Invalidate(USHORT nId = 0); BOOL IsActive() const; + /*virtual*/ bool IsChildWindowAvailable( const USHORT i_nId, const SfxViewFrame* i_pViewFrame ) const; + static SfxModule* GetActiveModule( SfxViewFrame* pFrame=NULL ); static FieldUnit GetCurrentFieldUnit(); FieldUnit GetFieldUnit() const; diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx index 97196ad3c4..42021778b4 100644 --- a/sfx2/inc/sfx2/objsh.hxx +++ b/sfx2/inc/sfx2/objsh.hxx @@ -398,7 +398,8 @@ public: const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aParams, ::com::sun::star::uno::Any& aRet, ::com::sun::star::uno::Sequence< sal_Int16 >& aOutParamIndex, - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aOutParam + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aOutParam, + bool bRaiseError = true ); static ErrCode CallXScript( @@ -407,7 +408,8 @@ public: const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aParams, ::com::sun::star::uno::Any& aRet, ::com::sun::star::uno::Sequence< sal_Int16 >& aOutParamIndex, - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aOutParam + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aOutParam, + bool bRaiseError = true ); /** adjusts the internal macro mode, according to the current security settings diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc index 2632678b22..846b6c547f 100644 --- a/sfx2/inc/sfx2/sfxsids.hrc +++ b/sfx2/inc/sfx2/sfxsids.hrc @@ -870,6 +870,7 @@ #define SID_HYPERLINK_GETLINK (SID_SVX_START + 361) #define SID_HYPERLINK_SETLINK (SID_SVX_START + 362) #define SID_NAVIGATOR (SID_SVX_START + 366) +#define SID_TASKPANE (SID_SVX_START + 370) #define SID_ZOOM_NEXT (SID_SVX_START + 402) #define SID_ZOOM_PREV (SID_SVX_START + 403) #define SID_INET_DLG (SID_SVX_START + 416) diff --git a/sfx2/inc/sfx2/taskpane.hxx b/sfx2/inc/sfx2/taskpane.hxx new file mode 100644 index 0000000000..1ddcf90c29 --- /dev/null +++ b/sfx2/inc/sfx2/taskpane.hxx @@ -0,0 +1,245 @@ +/************************************************************************* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 SFX_TASKPANE_HXX +#define SFX_TASKPANE_HXX + +#include "sfx2/dllapi.h" +#include "sfx2/childwin.hxx" +#include "sfx2/titledockwin.hxx" + +#include <svtools/toolpanel/tabalignment.hxx> +#include <svtools/toolpanel/tabitemcontent.hxx> + +#include <boost/scoped_ptr.hpp> +#include <boost/optional.hpp> + +namespace svt +{ + class ToolPanelDeck; +} + +//...................................................................................................................... +namespace sfx2 +{ +//...................................................................................................................... + + //================================================================================================================== + //= ITaskPaneToolPanelAccess + //================================================================================================================== + class SAL_NO_VTABLE ITaskPaneToolPanelAccess + { + public: + virtual void ActivateToolPanel( const ::rtl::OUString& i_rPanelURL ) = 0; + }; + + //================================================================================================================== + //= TaskPaneWrapper + //================================================================================================================== + class SFX2_DLLPUBLIC TaskPaneWrapper :public SfxChildWindow + ,public ITaskPaneToolPanelAccess + { + public: + TaskPaneWrapper( + Window* i_pParent, + USHORT i_nId, + SfxBindings* i_pBindings, + SfxChildWinInfo* i_pInfo + ); + + SFX_DECL_CHILDWINDOW( TaskPaneWrapper ); + + // ITaskPaneToolPanelAccess + virtual void ActivateToolPanel( const ::rtl::OUString& i_rPanelURL ); + }; + + //================================================================================================================== + //= IToolPanelCompare + //================================================================================================================== + class SFX2_DLLPUBLIC SAL_NO_VTABLE IToolPanelCompare + { + public: + /** compares to tool panel URLs + @return + <ul> + <li>-1 if the tool panel described by i_rLHS should precede the one described by i_rRHS</li> + <li>0 if the two panels have no particular relative order</li> + <li>1 if the tool panel described by i_rLHS should succeed the one described by i_rRHS</li> + + */ + virtual short compareToolPanelsURLs( + const ::rtl::OUString& i_rLHS, + const ::rtl::OUString& i_rRHS + ) const = 0; + }; + + //================================================================================================================== + //= ModuleTaskPane + //================================================================================================================== + class ModuleTaskPane_Impl; + /** SFX-less version of a module dependent task pane, filled with tool panels as specified in the respective + module's configuration + */ + class SFX2_DLLPUBLIC ModuleTaskPane : public Window + { + public: + /** creates a new instance + @param i_rParentWindow + the parent window + @param i_rDocumentFrame + the frame to which the task pane belongs. Will be passed to any custom tool panels created + via an XUIElementFactory. Also, it is used to determine the module which the task pane is + responsible for, thus controlling which tool panels are actually available. + */ + ModuleTaskPane( + Window& i_rParentWindow, + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rDocumentFrame + ); + /** creates a new instance + @param i_rParentWindow + the parent window + @param i_rDocumentFrame + the frame to which the task pane belongs. Will be passed to any custom tool panels created + via an XUIElementFactory. Also, it is used to determine the module which the task pane is + responsible for, thus controlling which tool panels are actually available. + @param i_rCompare + a comparator for tool panel URLs, which allows controlling the order in which the panels are + added to the tool panel deck. + */ + ModuleTaskPane( + Window& i_rParentWindow, + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rDocumentFrame, + const IToolPanelCompare& i_rCompare + ); + ~ModuleTaskPane(); + + /** determines whether a given module has any registered tool panels + */ + static bool ModuleHasToolPanels( const ::rtl::OUString& i_rModuleIdentifier ); + /** determines whether a given module has any registered tool panels + */ + static bool ModuleHasToolPanels( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rDocumentFrame ); + + /** provides access to the Window aspect of the PanelDeck + + Be careful with this method. For instance, you're not allowed to insert arbitrary IToolPanel implementations + into the deck, as the ModuleTaskPane has certain assumptions about the panel implementations. However, + you're allowed to remove and re-insert panels, which have originally been created by the ModuleTaskPane + itself. + */ + ::svt::ToolPanelDeck& GetPanelDeck(); + const ::svt::ToolPanelDeck& GetPanelDeck() const; + + /** returns the position of the panel with the given resource URL + */ + ::boost::optional< size_t > + GetPanelPos( const ::rtl::OUString& i_rResourceURL ); + + /** returns the resource URL of the panel at the specified position + */ + ::rtl::OUString + GetPanelResourceURL( const size_t i_nPanelPos ) const; + + /// sets the "classical" layout of the tool panel deck, using drawers + void SetDrawersLayout(); + /// sets the new layout of the tool panel deck, using tabs + void SetTabsLayout( const ::svt::TabAlignment i_eTabAlignment, const ::svt::TabItemContent i_eTabContent ); + + protected: + // Window overridables + virtual void Resize(); + virtual void GetFocus(); + + private: + ::boost::scoped_ptr< ModuleTaskPane_Impl > m_pImpl; + }; + + //================================================================================================================== + //= TaskPaneController + //================================================================================================================== + class TaskPaneController_Impl; + /** is a helper class for connecting a ModuleTaskPane and a TitledDockingWindow, for clients of the ModuleTaskPane + which do not use the TaskPaneDockingWindow + + The controller will add a drop down menu to the docking window which contains one item for each panel in the + panel deck, and allows toggling their visibility. + */ + class SFX2_DLLPUBLIC TaskPaneController + { + public: + TaskPaneController( + ModuleTaskPane& i_rTaskPane, + TitledDockingWindow& i_rDockingWindow + ); + ~TaskPaneController(); + + /** sets the default title to be used for the TitledDockingWindow + + When the controller switches the docking window to "tabbed" mode, then the title of the docking window + will contain the name of the currently active panel (since this name isn't to be seen elsewhere). + When the controller switches the docking window to "drawer" mode, then the title of the docking window + contains the default title as given here (since in this mode, the names of the panels are shown in + the drawers). + */ + void SetDefaultTitle( const String& i_rTitle ); + + /// activates the panel with the given URL + void ActivateToolPanel( const ::rtl::OUString& i_rPanelURL ); + + private: + ::boost::scoped_ptr< TaskPaneController_Impl > m_pImpl; + }; + + //================================================================================================================== + //= TaskPaneDockingWindow + //================================================================================================================== + class TaskPaneDockingWindow :public TitledDockingWindow + ,public ITaskPaneToolPanelAccess + { + public: + TaskPaneDockingWindow( SfxBindings* i_pBindings, TaskPaneWrapper& i_rWrapper, + Window* i_pParent, WinBits i_nBits ); + + // ITaskPaneToolPanelAccess + virtual void ActivateToolPanel( const ::rtl::OUString& i_rPanelURL ); + + protected: + // Window overridables + virtual void GetFocus(); + + // TitledDockingWindow overridables + virtual void onLayoutDone(); + + private: + ModuleTaskPane m_aTaskPane; + TaskPaneController m_aPaneController; + }; + +//...................................................................................................................... +} // namespace sfx2 +//...................................................................................................................... + +#endif // SFX_TASKPANE_HXX diff --git a/sfx2/inc/sfx2/titledockwin.hxx b/sfx2/inc/sfx2/titledockwin.hxx new file mode 100644 index 0000000000..f63d68525e --- /dev/null +++ b/sfx2/inc/sfx2/titledockwin.hxx @@ -0,0 +1,162 @@ +/************************************************************************* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 SFX_TITLEDOCKWIN_HXX +#define SFX_TITLEDOCKWIN_HXX + +#include "sfx2/dllapi.h" +#include "sfx2/dockwin.hxx" + +#include <vcl/toolbox.hxx> +#include <tools/svborder.hxx> + +//...................................................................................................................... +namespace sfx2 +{ +//...................................................................................................................... + + //================================================================================================================== + //= TitledDockingWindow + //================================================================================================================== + class SFX2_DLLPUBLIC TitledDockingWindow : public SfxDockingWindow + { + public: + TitledDockingWindow( + SfxBindings* i_pBindings, SfxChildWindow* i_pChildWindow, + Window* i_pParent, WinBits i_nStyle = 0 + ); + + TitledDockingWindow( SfxBindings* i_pBindings, SfxChildWindow* i_pChildWindow, + Window* i_pParent, const ResId& i_rResId + ); + + virtual ~TitledDockingWindow(); + + /** sets a title to be displayed in the docking window + */ + void SetTitle( const String& i_rTitle ); + /** returns the current title displayed in the docking window + + Note that if you never called SetTitle before, then this method will not return an empty string, + but the window text (Window::GetText), since this is what is displayed as title then. + */ + String GetTitle() const; + + /** adds a drop down item to the toolbox. Usually, this is used to add some kind of menu to the toolbox. + + @param i_rItemText + the text to display for the item + @param i_nHelpId + the help ID for the new toolbox item + @param i_rCallback + the callback to invoke when the drop item has been clicked + @return + the ID of the newly created toolbox item + */ + USHORT AddDropDownToolBoxItem( const String& i_rItemText, ULONG i_nHelpId, const Link& i_rCallback ) + { + return impl_addDropDownToolBoxItem( i_rItemText, i_nHelpId, i_rCallback ); + } + + void SetEndDockingHdl( const Link& i_rEndDockingHdl ) { m_aEndDockingHdl = i_rEndDockingHdl; } + const Link& GetEndDockingHdl() const { return m_aEndDockingHdl; } + + /** resets the toolbox. Upon return, the only item in the toolbox is the closer. + */ + void ResetToolBox() + { + impl_resetToolBox(); + } + + /** returns the content window, which is to be used as parent window for any content to be displayed + in the docking window. + */ + ::Window& GetContentWindow() { return m_aContentWindow; } + const ::Window& GetContentWindow() const { return m_aContentWindow; } + + ToolBox& GetToolBox() { return m_aToolbox; } + const ToolBox& GetToolBox() const { return m_aToolbox; } + + protected: + // Window overridables + virtual void Paint( const Rectangle& i_rArea ); + virtual void Resize(); + virtual void StateChanged( StateChangedType i_nType ); + virtual void DataChanged( const DataChangedEvent& i_rDataChangedEvent ); + virtual void SetText( const String& i_rText ); + + // DockingWindow overridables + void EndDocking( const Rectangle& rRect, BOOL bFloatMode ); + + // own overridables + virtual void onLayoutDone(); + + protected: + /** internal version of ResetToolBox + */ + void impl_resetToolBox(); + + /** internal version of AddDropDownToolBoxItem + */ + USHORT impl_addDropDownToolBoxItem( const String& i_rItemText, ULONG i_nHelpId, const Link& i_rCallback ); + + /** returns the current title. + + If no title has been set via SetTitle, then the window text (Window::GetText) is returned. + */ + String impl_getTitle() const; + + private: + DECL_LINK( OnToolboxItemSelected, ToolBox* ); + + void impl_construct(); + void impl_layout(); + void impl_scheduleLayout(); + + private: + String m_sTitle; + ToolBox m_aToolbox; + Window m_aContentWindow; + + Link m_aEndDockingHdl; + + /** The border that is painted arround the inner window. The bevel + shadow lines are part of the border, so where the border is 0 no + such line is painted. + */ + SvBorder m_aBorder; + + /** Remember that a layout is pending, i.e. Resize() has been called + since the last Paint(). + */ + bool m_bLayoutPending; + }; + +//...................................................................................................................... +} // namespace sfx2 +//...................................................................................................................... + +#endif // SFX_TITLEDOCKWIN_HXX diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index 06e6b9dcae..81b296b267 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -40,6 +40,8 @@ #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/frame/XController2.hpp> +#include <tools/svborder.hxx> + class SfxMacro; class SvBorder; class SfxDispatcher; @@ -70,67 +72,6 @@ SV_DECL_REF(SfxObjectShell) #endif //======================================================================== -#include <tools/gen.hxx> -class SvBorder -{ - long nTop, nRight, nBottom, nLeft; -public: - SvBorder() - { nTop = nRight = nBottom = nLeft = 0; } - SvBorder( const Size & rSz ) - { nTop = nBottom = rSz.Height(); nRight = nLeft = rSz.Width(); } - SvBorder( const Rectangle & rOuter, const Rectangle & rInner ); - SvBorder( long nLeftP, long nTopP, long nRightP, long nBottomP ) - { nLeft = nLeftP; nTop = nTopP; nRight = nRightP; nBottom = nBottomP; } - BOOL operator == ( const SvBorder & rObj ) const - { - return nTop == rObj.nTop && nRight == rObj.nRight && - nBottom == rObj.nBottom && nLeft == rObj.nLeft; - } - BOOL operator != ( const SvBorder & rObj ) const - { return !(*this == rObj); } - SvBorder & operator = ( const SvBorder & rBorder ) - { - Left() = rBorder.Left(); - Top() = rBorder.Top(); - Right() = rBorder.Right(); - Bottom() = rBorder.Bottom(); - return *this; - } - SvBorder & operator += ( const SvBorder & rBorder ) - { - Left() += rBorder.Left(); - Top() += rBorder.Top(); - Right() += rBorder.Right(); - Bottom() += rBorder.Bottom(); - return *this; - } - SvBorder & operator -= ( const SvBorder & rBorder ) - { - Left() -= rBorder.Left(); - Top() -= rBorder.Top(); - Right() -= rBorder.Right(); - Bottom() -= rBorder.Bottom(); - return *this; - } - BOOL IsInside( const SvBorder & rInside ) - { - return nTop >= rInside.nTop && nRight >= rInside.nRight && - nBottom >= rInside.nBottom && nLeft >= rInside.nLeft; - } - long & Top() { return nTop; } - long & Right() { return nRight; } - long & Bottom() { return nBottom; } - long & Left() { return nLeft; } - long Top() const { return nTop; } - long Right() const { return nRight; } - long Bottom() const { return nBottom; } - long Left() const { return nLeft; } -}; -Rectangle & operator += ( Rectangle & rRect, const SvBorder & rBorder ); -Rectangle & operator -= ( Rectangle & rRect, const SvBorder & rBorder ); - - DBG_NAMEEX(SfxViewFrame) class SFX2_DLLPUBLIC SfxViewFrame: public SfxShell, public SfxListener { @@ -228,6 +169,8 @@ public: String UpdateTitle(); + static void ActivateToolPanel( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame, const ::rtl::OUString& i_rPanelURL ); + // interne Handler SAL_DLLPRIVATE virtual BOOL SetBorderPixelImpl( const SfxViewShell *pSh, const SvBorder &rBorder ); SAL_DLLPRIVATE virtual const SvBorder& GetBorderPixelImpl( const SfxViewShell *pSh ) const; @@ -304,6 +247,7 @@ public: SAL_DLLPRIVATE void INetState_Impl(SfxItemSet &); SAL_DLLPRIVATE void SetCurViewId_Impl( const USHORT i_nID ); + SAL_DLLPRIVATE void ActivateToolPanel_Impl( const ::rtl::OUString& i_rPanelURL ); //#endif private: diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx index 3e633d0605..0e8bc90260 100644 --- a/sfx2/inc/sfx2/viewsh.hxx +++ b/sfx2/inc/sfx2/viewsh.hxx @@ -59,6 +59,7 @@ class SfxTabPage; class SfxPrintMonitor; class SfxFrameSetDescriptor; class PrintDialog; +class Printer; class SfxPrinter; class SfxProgress; class SvStringsDtor; @@ -149,6 +150,7 @@ class SFX2_DLLPUBLIC SfxViewShell: public SfxShell, public SfxListener friend class SfxViewFrame; friend class SfxPlugInFrame; friend class SfxBaseController; +friend class SfxPrinterController; #endif struct SfxViewShell_Impl* pImp; @@ -188,10 +190,6 @@ public: SfxViewShell( SfxViewFrame *pFrame, USHORT nFlags = 0 ); virtual ~SfxViewShell(); - // In-Place - // should be superfluous - //virtual SfxInPlaceClient* CreateIPClient( WorkWindow * pTop, WorkWindow * pDoc, Window * pDraw ); - SfxInPlaceClient* GetIPClient() const; SfxInPlaceClient* GetUIActiveClient() const; SfxInPlaceClient* FindIPClient( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& xObj, Window *pObjParentWin ) const; @@ -250,6 +248,7 @@ public: void LockPrinter( BOOL bLock = TRUE ); BOOL IsPrinterLocked() const; virtual JobSetup GetJobSetup() const; + Printer* GetActivePrinter() const; // Workingset virtual void WriteUserData( String&, BOOL bBrowse = FALSE ); |