2004-07-13 12:58:29 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 19:47:23 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2004-07-13 12:58:29 +00:00
|
|
|
*
|
2008-04-10 19:47:23 +00:00
|
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
2004-07-13 12:58:29 +00:00
|
|
|
*
|
2008-04-10 19:47:23 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2004-07-13 12:58:29 +00:00
|
|
|
*
|
2008-04-10 19:47:23 +00:00
|
|
|
* $RCSfile: PaneDockingWindow.hxx,v $
|
2008-07-02 10:52:00 +00:00
|
|
|
* $Revision: 1.12 $
|
2004-07-13 12:58:29 +00:00
|
|
|
*
|
2008-04-10 19:47:23 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2004-07-13 12:58:29 +00:00
|
|
|
*
|
2008-04-10 19:47:23 +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.
|
2004-07-13 12:58:29 +00:00
|
|
|
*
|
2008-04-10 19:47:23 +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).
|
2004-07-13 12:58:29 +00:00
|
|
|
*
|
2008-04-10 19:47:23 +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.
|
2004-07-13 12:58:29 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#ifndef SD_PANE_DOCKING_WINDOW_HXX
|
|
|
|
#define SD_PANE_DOCKING_WINDOW_HXX
|
|
|
|
|
|
|
|
#include <sfx2/dockwin.hxx>
|
2004-10-04 17:36:25 +00:00
|
|
|
#include <sfx2/viewfrm.hxx>
|
2007-04-03 15:04:55 +00:00
|
|
|
|
|
|
|
#include <boost/scoped_ptr.hpp>
|
2008-07-02 10:52:00 +00:00
|
|
|
#include <boost/shared_ptr.hpp>
|
2004-07-13 12:58:29 +00:00
|
|
|
|
|
|
|
class ToolBox;
|
|
|
|
|
|
|
|
namespace sd {
|
|
|
|
|
|
|
|
class PaneDockingWindow
|
|
|
|
: public SfxDockingWindow
|
|
|
|
{
|
|
|
|
public:
|
2004-09-08 12:43:14 +00:00
|
|
|
/** Create a new docking window that will be displayed in the specified
|
|
|
|
pane.
|
|
|
|
The constructor will determine the ViewShellBase via the given
|
|
|
|
bindings and tell its PaneManager about the new window. It will ask
|
|
|
|
the PaneManager for a window title.
|
|
|
|
@param pBindings
|
|
|
|
Used, among others, to determine the ViewShellBase and
|
|
|
|
PaneManager that manage the new docking window.
|
|
|
|
@param pChildWindow
|
|
|
|
This child window is the logical container for the new docking
|
|
|
|
window.
|
|
|
|
@param pParent
|
|
|
|
The parent window of the new docking window.
|
|
|
|
@param rResId
|
|
|
|
The resource is used to determine initial size and attributes.
|
|
|
|
@param ePane
|
|
|
|
The pane in which to show the docking window.
|
|
|
|
*/
|
2004-07-13 12:58:29 +00:00
|
|
|
PaneDockingWindow (
|
|
|
|
SfxBindings *pBindings,
|
|
|
|
SfxChildWindow *pChildWindow,
|
|
|
|
::Window* pParent,
|
|
|
|
const ResId& rResId,
|
2007-04-03 15:04:55 +00:00
|
|
|
const ::rtl::OUString& rsTitle);
|
2004-07-13 12:58:29 +00:00
|
|
|
|
|
|
|
virtual ~PaneDockingWindow (void);
|
|
|
|
|
|
|
|
virtual void Paint (const Rectangle& rRectangle);
|
|
|
|
virtual void Resize (void);
|
|
|
|
|
2004-09-08 12:43:14 +00:00
|
|
|
virtual long Notify( NotifyEvent& rNEvt );
|
|
|
|
virtual void StateChanged( StateChangedType nType );
|
|
|
|
virtual void DataChanged( const DataChangedEvent& rDCEvt );
|
2004-07-13 12:58:29 +00:00
|
|
|
|
slidecopy: initial version of a "Tool Panel"
At the moment, this implementation is parallel to the existing TaskPane implementation, but on the medium term, it is
intended to replace it. No change in functionality is planned for the moment, just the panel selection is done via
a tab bar, instead of the the "jumping drawers".
Pending tasks (as known so far):
- Accessibility. No implementation at all, yet.
- showing/hiding tool panels from the "View" drop down menu
- connection to the resource framework. At the moment, de/activating panels completely bypasses the resource
framework.
- alternative implementation of the PanelDeckLayouter which mimics the old design. To be activated by default, for
the moment.
- removal of the (old, by then) TaskPane implementation. Care needs to be taken that the framework API stays
unchanged, i.e., the current ToolPanel resource must be renamed back to RightPane when RightPane is not
occupied anymore by the old implementation. Same for other resource names.
2010-03-15 13:53:19 +01:00
|
|
|
virtual void EndDocking( const Rectangle& rRect, BOOL bFloatMode );
|
|
|
|
|
2004-11-16 15:12:50 +00:00
|
|
|
/** Initializing the title tool box either creates a new title tool box
|
|
|
|
or clears all items from an existing one. A closer is added as only
|
|
|
|
item.
|
|
|
|
*/
|
|
|
|
void InitializeTitleToolBox (void);
|
|
|
|
|
2004-07-13 12:58:29 +00:00
|
|
|
/** Add a top down menu to the title bar or rather the top-level menu
|
|
|
|
entry. The given callback is called when the menu is clicked and it
|
|
|
|
is the task of the callback to show the menu.
|
|
|
|
@return
|
|
|
|
The id of the new menu is returned. It can be compared by the
|
|
|
|
callback to the value of GetCurItemId() when called at the given
|
|
|
|
tool box.
|
|
|
|
*/
|
2005-01-31 13:52:33 +00:00
|
|
|
USHORT AddMenu (const String& rsMenuName, ULONG nHelpId, const Link& rCallback);
|
2004-07-13 12:58:29 +00:00
|
|
|
|
slidecopy: initial version of a "Tool Panel"
At the moment, this implementation is parallel to the existing TaskPane implementation, but on the medium term, it is
intended to replace it. No change in functionality is planned for the moment, just the panel selection is done via
a tab bar, instead of the the "jumping drawers".
Pending tasks (as known so far):
- Accessibility. No implementation at all, yet.
- showing/hiding tool panels from the "View" drop down menu
- connection to the resource framework. At the moment, de/activating panels completely bypasses the resource
framework.
- alternative implementation of the PanelDeckLayouter which mimics the old design. To be activated by default, for
the moment.
- removal of the (old, by then) TaskPane implementation. Care needs to be taken that the framework API stays
unchanged, i.e., the current ToolPanel resource must be renamed back to RightPane when RightPane is not
occupied anymore by the old implementation. Same for other resource names.
2010-03-15 13:53:19 +01:00
|
|
|
void SetEndDockingHdl( const Link& i_rEndDockingHdl ) { maEndDockingHdl = i_rEndDockingHdl; }
|
|
|
|
const Link& GetEndDockingHdl() const { return maEndDockingHdl; }
|
|
|
|
|
2004-09-08 12:43:14 +00:00
|
|
|
/** Set the title of the docking window to the given string. Use this
|
|
|
|
method when the title is not yet known at the time of construction
|
|
|
|
or can not be passed to the constructor.
|
|
|
|
*/
|
|
|
|
void SetTitle (const String& rsTitle);
|
|
|
|
|
2007-04-03 15:04:55 +00:00
|
|
|
::Window* GetContentWindow (void);
|
|
|
|
|
2008-07-02 10:52:00 +00:00
|
|
|
::boost::shared_ptr<ToolBox> GetTitleToolBox (void) const;
|
|
|
|
|
2004-07-13 12:58:29 +00:00
|
|
|
private:
|
|
|
|
/** Title that is shown at the top of the docking window.
|
|
|
|
*/
|
2007-04-03 15:04:55 +00:00
|
|
|
::rtl::OUString msTitle;
|
2004-07-13 12:58:29 +00:00
|
|
|
|
|
|
|
/** The tool box that is displayed in the window title area contains
|
|
|
|
menus and the closer button.
|
|
|
|
*/
|
2008-07-02 10:52:00 +00:00
|
|
|
::boost::shared_ptr<ToolBox> mpTitleToolBox;
|
2004-07-13 12:58:29 +00:00
|
|
|
|
|
|
|
/** 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 maBorder;
|
|
|
|
|
|
|
|
sal_uInt16 mnChildWindowId;
|
|
|
|
|
2007-04-03 15:04:55 +00:00
|
|
|
::boost::scoped_ptr< ::Window> mpContentWindow;
|
|
|
|
|
slidecopy: initial version of a "Tool Panel"
At the moment, this implementation is parallel to the existing TaskPane implementation, but on the medium term, it is
intended to replace it. No change in functionality is planned for the moment, just the panel selection is done via
a tab bar, instead of the the "jumping drawers".
Pending tasks (as known so far):
- Accessibility. No implementation at all, yet.
- showing/hiding tool panels from the "View" drop down menu
- connection to the resource framework. At the moment, de/activating panels completely bypasses the resource
framework.
- alternative implementation of the PanelDeckLayouter which mimics the old design. To be activated by default, for
the moment.
- removal of the (old, by then) TaskPane implementation. Care needs to be taken that the framework API stays
unchanged, i.e., the current ToolPanel resource must be renamed back to RightPane when RightPane is not
occupied anymore by the old implementation. Same for other resource names.
2010-03-15 13:53:19 +01:00
|
|
|
Link maEndDockingHdl;
|
|
|
|
|
2007-04-03 15:04:55 +00:00
|
|
|
/** Remember that a layout is pending, i.e. Resize() has been called
|
|
|
|
since the last Paint().
|
|
|
|
*/
|
|
|
|
bool mbIsLayoutPending;
|
|
|
|
|
2004-07-13 12:58:29 +00:00
|
|
|
DECL_LINK(ToolboxSelectHandler, ToolBox*);
|
2007-04-03 15:04:55 +00:00
|
|
|
|
|
|
|
/** This does the actual placing and sizing of the title bar and the
|
|
|
|
content window after the size of the docking window has changed.
|
|
|
|
This method is called from withing the Paint() method when since its
|
|
|
|
last invocation the size of the docking window has changed.
|
|
|
|
*/
|
|
|
|
void Layout (void);
|
2004-07-13 12:58:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end of namespace ::sd
|
|
|
|
|
|
|
|
#endif
|