diff options
author | Matthias Huetsch [mhu] <matthias.huetsch@sun.com> | 2010-06-25 16:25:27 +0200 |
---|---|---|
committer | Matthias Huetsch [mhu] <matthias.huetsch@sun.com> | 2010-06-25 16:25:27 +0200 |
commit | b3ae35891f2323835237f04a54bb53d2b30546f0 (patch) | |
tree | 41835a7726be957ce839efa7ebc534d55c422966 /sd/source/ui/toolpanel | |
parent | f6a123d12d2abaaa73935f1439dfe622b26f4572 (diff) | |
parent | 8c75156a84a5088506c49101efad199dc7b8d05e (diff) |
Update from master repository (DEV300_m83).
Diffstat (limited to 'sd/source/ui/toolpanel')
30 files changed, 168 insertions, 873 deletions
diff --git a/sd/source/ui/toolpanel/EmptyWindow.cxx b/sd/source/ui/toolpanel/EmptyWindow.cxx deleted file mode 100644 index 2e964fa4e30b..000000000000 --- a/sd/source/ui/toolpanel/EmptyWindow.cxx +++ /dev/null @@ -1,96 +0,0 @@ -/************************************************************************* - * - * 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. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sd.hxx" - -#include "EmptyWindow.hxx" - -namespace sd { namespace toolpanel { - - -EmptyWindow::EmptyWindow ( - Window* pParentWindow, - Color aBackgroundColor, - const String& rText) - : Window (pParentWindow, WinBits()), - msText (rText) -{ - SetBackground (aBackgroundColor); -} - - - - -EmptyWindow::~EmptyWindow (void) -{ -} - - - - -void EmptyWindow::Paint (const Rectangle& ) -{ - Size aWindowSize (GetOutputSizePixel()); - Point aPosition(aWindowSize.Width()/2,aWindowSize.Height()/2); - - Rectangle aBBox; - aPosition = Point(10,aWindowSize.Height()/2); - if (GetTextBoundRect (aBBox, msText)) - aPosition = Point ( - (aWindowSize.Width()-aBBox.GetWidth())/2, - (aWindowSize.Height()-aBBox.GetHeight())/2); - DrawText (aPosition, msText); - - String sSizeString = String::CreateFromInt32(aWindowSize.Width()); - sSizeString.Append (String::CreateFromAscii(" x ")); - sSizeString.Append (String::CreateFromInt32(aWindowSize.Height())); - if (GetTextBoundRect (aBBox, sSizeString)) - aPosition = Point ( - (aWindowSize.Width()-aBBox.GetWidth())/2, - aPosition.Y() + GetTextHeight() + aBBox.GetHeight()); - DrawText (aPosition, sSizeString); -} - - - - -void EmptyWindow::Resize (void) -{ - Window::Resize(); -} - - - - -void EmptyWindow::GetFocus (void) -{ - GetParent()->GrabFocus(); -} - - -} } // end of namespace ::sd::tpv diff --git a/sd/source/ui/toolpanel/EmptyWindow.hxx b/sd/source/ui/toolpanel/EmptyWindow.hxx deleted file mode 100644 index 4137020874f5..000000000000 --- a/sd/source/ui/toolpanel/EmptyWindow.hxx +++ /dev/null @@ -1,57 +0,0 @@ -/************************************************************************* - * - * 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 SD_EMPTY_WINDOW_HXX -#define SD_EMPTY_WINDOW_HXX - -#include <vcl/window.hxx> - -namespace sd { namespace toolpanel { - -/** Simply paint a solid background and a centered text. -*/ -class EmptyWindow - : public ::Window -{ -public: - EmptyWindow ( - ::Window* pParentWindow, - Color rBackgroundColor, - const String& rText); - virtual ~EmptyWindow (void); - - virtual void Paint (const Rectangle& rBoundingBox); - virtual void Resize (void); - virtual void GetFocus (void); - -private: - String msText; -}; - -} } // end of namespace ::sd::toolpanel - -#endif diff --git a/sd/source/ui/toolpanel/LayoutMenu.cxx b/sd/source/ui/toolpanel/LayoutMenu.cxx index 7e0fd41ffb89..ec4eb1e43d4d 100755 --- a/sd/source/ui/toolpanel/LayoutMenu.cxx +++ b/sd/source/ui/toolpanel/LayoutMenu.cxx @@ -263,14 +263,6 @@ LayoutMenu::~LayoutMenu (void) -String LayoutMenu::GetSelectedLayoutName (void) -{ - return GetItemText (GetSelectItemId()); -} - - - - AutoLayout LayoutMenu::GetSelectedAutoLayout (void) { AutoLayout aResult = AUTOLAYOUT_NONE; diff --git a/sd/source/ui/toolpanel/LayoutMenu.hxx b/sd/source/ui/toolpanel/LayoutMenu.hxx index 86e01e9f803b..627a363fb576 100755 --- a/sd/source/ui/toolpanel/LayoutMenu.hxx +++ b/sd/source/ui/toolpanel/LayoutMenu.hxx @@ -90,10 +90,6 @@ public: static std::auto_ptr<ControlFactory> CreateControlFactory ( ToolPanelViewShell& i_rPanelViewShell ); - /** Return the name of the currently selected layout. - */ - String GetSelectedLayoutName (void); - /** Return a numerical value representing the currently selected layout. */ diff --git a/sd/source/ui/toolpanel/ScrollPanel.cxx b/sd/source/ui/toolpanel/ScrollPanel.cxx index cae08c76ca39..6b10ed889424 100755 --- a/sd/source/ui/toolpanel/ScrollPanel.cxx +++ b/sd/source/ui/toolpanel/ScrollPanel.cxx @@ -134,15 +134,6 @@ ScrollPanel::~ScrollPanel (void) -void ScrollPanel::ListHasChanged (void) -{ - mpControlContainer->ListHasChanged (); - RequestResize (); -} - - - - TitledControl* ScrollPanel::AddControl ( ::std::auto_ptr<TreeNode> pControl, const String& rTitle, diff --git a/sd/source/ui/toolpanel/SimpleLayoutWrapper.cxx b/sd/source/ui/toolpanel/SimpleLayoutWrapper.cxx deleted file mode 100644 index 0aa2d3f91760..000000000000 --- a/sd/source/ui/toolpanel/SimpleLayoutWrapper.cxx +++ /dev/null @@ -1,98 +0,0 @@ -/************************************************************************* - * - * 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. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sd.hxx" - -#include "SimpleLayoutWrapper.hxx" - -#include <vcl/window.hxx> - -namespace sd { namespace toolpanel { - -SimpleLayoutWrapper::SimpleLayoutWrapper ( - ::std::auto_ptr< ::Window> pWindow, - int nPreferredWidth, - int nPreferredHeight, - bool bIsResizable) - : mpWindow (pWindow), - mnPreferredWidth(nPreferredWidth), - mnPreferredHeight(nPreferredHeight), - mbIsResizable (bIsResizable) -{ -} - - - - -SimpleLayoutWrapper::~SimpleLayoutWrapper (void) -{ -} - - - - -Size SimpleLayoutWrapper::GetPreferredSize (void) -{ - return Size (mnPreferredWidth, mnPreferredHeight); -} - - - - -sal_Int32 SimpleLayoutWrapper::GetPreferredWidth (sal_Int32) -{ - return mnPreferredWidth; -} - - - - -sal_Int32 SimpleLayoutWrapper::GetPreferredHeight (sal_Int32) -{ - return mnPreferredHeight; -} - - - - -bool SimpleLayoutWrapper::IsResizable (void) -{ - return mbIsResizable; -} - - - - -::Window* SimpleLayoutWrapper::GetWindow (void) -{ - return mpWindow.get(); -} - - -} } // end of namespace ::sd::toolpanel - diff --git a/sd/source/ui/toolpanel/SimpleLayoutWrapper.hxx b/sd/source/ui/toolpanel/SimpleLayoutWrapper.hxx deleted file mode 100644 index a05d9d6ff295..000000000000 --- a/sd/source/ui/toolpanel/SimpleLayoutWrapper.hxx +++ /dev/null @@ -1,70 +0,0 @@ -/************************************************************************* - * - * 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 SD_TASKPANE_SIMPLE_LAYOUT_WRAPPER_HXX -#define SD_TASKPANE_SIMPLE_LAYOUT_WRAPPER_HXX - -#include "taskpane/ILayoutableWindow.hxx" - -#include <memory> - -namespace sd { namespace toolpanel { - - -/** Simple wrapper arround a regular VCL window that implements the - methods that return the preferred size of the window. They are - given once to the constructor and are not modified by the wrapper. -*/ -class SimpleLayoutWrapper - : public virtual ILayoutableWindow -{ -public: - SimpleLayoutWrapper ( - ::std::auto_ptr< ::Window> pWindow, - int nPreferredWidth, - int nPreferredHeight, - bool bIsResizable); - virtual ~SimpleLayoutWrapper (void); - - virtual Size GetPreferredSize (void); - virtual sal_Int32 GetPreferredWidth (sal_Int32 nHeight); - virtual sal_Int32 GetPreferredHeight (sal_Int32 nWidth); - virtual bool IsResizable (void); - virtual ::Window* GetWindow (void); - - using sd::toolpanel::ILayoutableWindow::GetPreferredWidth; - using sd::toolpanel::ILayoutableWindow::GetPreferredHeight; -private: - ::std::auto_ptr< ::Window> mpWindow; - int mnPreferredWidth; - int mnPreferredHeight; - bool mbIsResizable; -}; - -} } // end of namespace ::sd::toolpanel - -#endif diff --git a/sd/source/ui/toolpanel/SubToolPanel.cxx b/sd/source/ui/toolpanel/SubToolPanel.cxx index f554d44e8f18..73783b0f0a41 100755 --- a/sd/source/ui/toolpanel/SubToolPanel.cxx +++ b/sd/source/ui/toolpanel/SubToolPanel.cxx @@ -115,64 +115,6 @@ SubToolPanel::~SubToolPanel (void) -void SubToolPanel::ListHasChanged (void) -{ - mpControlContainer->ListHasChanged (); - RequestResize (); -} - - - - -void SubToolPanel::AddControl ( - ::std::auto_ptr<TreeNode> pControl, - const String& rTitle, - ULONG nHelpId) -{ - pControl->GetWindow()->AddEventListener ( - LINK(this,SubToolPanel,WindowEventListener)); - - // We are interested only in the title. The control itself is - // managed by the content object. - TitledControl* pTitledControl = new TitledControl( - this, - pControl, - rTitle, - TitledControlStandardClickHandler(GetControlContainer(), ControlContainer::ES_TOGGLE), - TitleBar::TBT_SUB_CONTROL_HEADLINE); - pTitledControl->GetWindow()->SetParent(this); - pTitledControl->GetWindow()->SetHelpId(nHelpId); - ::std::auto_ptr<TreeNode> pChild (pTitledControl); - - // Add a down link only for the first control so that when - // entering the sub tool panel the focus is set to the first control. - if (mpControlContainer->GetControlCount() == 0) - FocusManager::Instance().RegisterDownLink(GetParent(), pTitledControl->GetWindow()); - FocusManager::Instance().RegisterUpLink(pTitledControl->GetWindow(), GetParent()); - - mpControlContainer->AddControl (pChild); -} - - - - -void SubToolPanel::AddControl (::std::auto_ptr<TreeNode> pControl) -{ - pControl->GetWindow()->AddEventListener ( - LINK(this,SubToolPanel,WindowEventListener)); - - // Add a down link only for the first control so that when - // entering the sub tool panel the focus is set to the first control. - if (mpControlContainer->GetControlCount() == 0) - FocusManager::Instance().RegisterDownLink(GetParent(), pControl->GetWindow()); - FocusManager::Instance().RegisterUpLink(pControl->GetWindow(), GetParent()); - - mpControlContainer->AddControl (pControl); -} - - - - void SubToolPanel::Paint (const Rectangle& rRect) { if (mbIsRearrangePending) diff --git a/sd/source/ui/toolpanel/TaskPaneShellManager.cxx b/sd/source/ui/toolpanel/TaskPaneShellManager.cxx index 52054c43fe8b..0a9667dd2431 100755 --- a/sd/source/ui/toolpanel/TaskPaneShellManager.cxx +++ b/sd/source/ui/toolpanel/TaskPaneShellManager.cxx @@ -76,19 +76,6 @@ void TaskPaneShellManager::ReleaseShell (SfxShell* ) // Nothing to do. } -// hack for annotation panel, better fix? -void TaskPaneShellManager_AddSubShell ( TaskPaneShellManager* pManager, sal_Int32 nId, SfxShell* pShell, ::Window* pWindow ) -{ - if( pManager != NULL ) - pManager->AddSubShell( (ShellId)nId, pShell, pWindow ); -} - -void TaskPaneShellManager_RemoveSubShell ( TaskPaneShellManager* pManager, const SfxShell* pShell) -{ - if( pManager != NULL ) - pManager->RemoveSubShell( pShell ); -} - void TaskPaneShellManager::AddSubShell ( ShellId nId, SfxShell* pShell, diff --git a/sd/source/ui/toolpanel/TaskPaneTreeNode.cxx b/sd/source/ui/toolpanel/TaskPaneTreeNode.cxx index f70e643636d5..8c69e12c504d 100755 --- a/sd/source/ui/toolpanel/TaskPaneTreeNode.cxx +++ b/sd/source/ui/toolpanel/TaskPaneTreeNode.cxx @@ -55,22 +55,6 @@ TreeNode::~TreeNode (void) -bool TreeNode::IsLeaf (void) -{ - return (mpControlContainer.get()==NULL); -} - - - - -bool TreeNode::IsRoot (void) -{ - return (mpParent==NULL); -} - - - - void TreeNode::SetParentNode (TreeNode* pNewParent) { mpParent = pNewParent; @@ -277,18 +261,6 @@ void TreeNode::AddStateChangeListener (const Link& rListener) -void TreeNode::RemoveStateChangeListener (const Link& rListener) -{ - maStateChangeListeners.erase ( - ::std::find ( - maStateChangeListeners.begin(), - maStateChangeListeners.end(), - rListener)); -} - - - - void TreeNode::FireStateChangeEvent ( TreeNodeStateChangeEventId eEventId, TreeNode* pChild) const diff --git a/sd/source/ui/toolpanel/TestMenu.cxx b/sd/source/ui/toolpanel/TestMenu.cxx index 54c865f12728..a8f0b6df7893 100755 --- a/sd/source/ui/toolpanel/TestMenu.cxx +++ b/sd/source/ui/toolpanel/TestMenu.cxx @@ -37,6 +37,7 @@ namespace sd { namespace toolpanel { +#ifdef SHOW_COLOR_MENU /** This factory class is used to create instances of ColorMenu. It can be extended so that its constructor stores arguments that later are passed to new ColorMenu objects. @@ -82,16 +83,12 @@ ColorMenu::~ColorMenu (void) } - - ::std::auto_ptr<ControlFactory> ColorMenu::CreateControlFactory (void) { return ::std::auto_ptr<ControlFactory>(new ColorMenuFactory()); } - - /** The preferred size depends on the preferred number of columns, the number of items, and the size of the items. */ @@ -316,5 +313,6 @@ void ColorMenu::Fill (void) maSet.InsertItem (++i, rSettings.GetFontColor()); maSet.SetItemText (i, String::CreateFromAscii("FontColor")); } +#endif } } // end of namespace ::sd::toolpanel diff --git a/sd/source/ui/toolpanel/TestMenu.hxx b/sd/source/ui/toolpanel/TestMenu.hxx index 2b5dfe2e2e57..0c4b3bfe6530 100755 --- a/sd/source/ui/toolpanel/TestMenu.hxx +++ b/sd/source/ui/toolpanel/TestMenu.hxx @@ -39,6 +39,8 @@ namespace sd { namespace toolpanel { class ControlFactory; +#ifdef SHOW_COLOR_MENU + /** This demo menu shows the colors that are available from the StyleSettings. */ @@ -75,6 +77,7 @@ private: int CalculateRowCount (const Size& rItemSize, int nColumnCount); void Fill (void); }; +#endif } } // end of namespace ::sd::toolpanel diff --git a/sd/source/ui/toolpanel/TestPanel.cxx b/sd/source/ui/toolpanel/TestPanel.cxx index f0b6951cefc4..044b40dcdb4f 100755 --- a/sd/source/ui/toolpanel/TestPanel.cxx +++ b/sd/source/ui/toolpanel/TestPanel.cxx @@ -37,6 +37,7 @@ namespace sd { namespace toolpanel { +#ifdef SHOW_TEST_PANEL /** This factory class is used to create instances of TestPanel. It can be extended so that its constructor stores arguments that later are passed to new TestPanel objects. @@ -163,13 +164,11 @@ TestPanel::~TestPanel (void) { } - - - std::auto_ptr<ControlFactory> TestPanel::CreateControlFactory (void) { return std::auto_ptr<ControlFactory>(new TestPanelFactory()); } +#endif } } // end of namespace ::sd::toolpanel diff --git a/sd/source/ui/toolpanel/TestPanel.hxx b/sd/source/ui/toolpanel/TestPanel.hxx index af1b97d0f885..494e5086b179 100755 --- a/sd/source/ui/toolpanel/TestPanel.hxx +++ b/sd/source/ui/toolpanel/TestPanel.hxx @@ -36,6 +36,8 @@ namespace sd { namespace toolpanel { class ControlFactory; class TreeNode; +#ifdef SHOW_TEST_PANEL + /** This panel demonstrates how to create a panel for the task pane. */ class TestPanel @@ -48,6 +50,8 @@ public: static std::auto_ptr<ControlFactory> CreateControlFactory (void); }; +#endif + } } // end of namespace ::sd::toolpanel #endif diff --git a/sd/source/ui/toolpanel/TitleToolBox.cxx b/sd/source/ui/toolpanel/TitleToolBox.cxx deleted file mode 100755 index 403e826ee27a..000000000000 --- a/sd/source/ui/toolpanel/TitleToolBox.cxx +++ /dev/null @@ -1,67 +0,0 @@ -/************************************************************************* - * - * 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. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sd.hxx" - -#include "TitleToolBox.hxx" - -#include "res_bmp.hrc" -#include <vcl/bitmap.hxx> -#include <vcl/bitmapex.hxx> -#include "sdresid.hxx" -#include <rtl/ustring.hxx> - -namespace sd { namespace toolpanel { - - -TitleToolBox::TitleToolBox (::Window* pParent, WinBits nStyle ) - : ToolBox( pParent, nStyle ) -{ - SetOutStyle (TOOLBOX_STYLE_FLAT); - SetBackground (Wallpaper ( - GetSettings().GetStyleSettings().GetDialogColor())); -} - - - - -void TitleToolBox::DataChanged (const DataChangedEvent& rDCEvt) -{ - Window::DataChanged (rDCEvt); - - if (rDCEvt.GetFlags() & SETTINGS_STYLE) - { - SetBackground ( - Wallpaper (GetSettings().GetStyleSettings().GetDialogColor())); - } -} - - - - -} } // end of namespace ::sd::toolbox diff --git a/sd/source/ui/toolpanel/TitleToolBox.hxx b/sd/source/ui/toolpanel/TitleToolBox.hxx deleted file mode 100755 index db2c971c3539..000000000000 --- a/sd/source/ui/toolpanel/TitleToolBox.hxx +++ /dev/null @@ -1,52 +0,0 @@ -/************************************************************************* - * - * 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 SD_TOOLBOX_TITLETOOLBOX_HXX -#define SD_TOOLBOX_TITLETOOLBOX_HXX - -#include <vcl/toolbox.hxx> - -class PushButton; - -namespace sd { namespace toolpanel { - -/** Copied from vcl/menu.cxx -// To get the transparent mouse-over look, the TitleToolBox is actually a toolbox -// overload DataChange to handle style changes correctly -*/ -class TitleToolBox - : public ToolBox -{ -public: - TitleToolBox (::Window* pParent, WinBits nStyle = 0); - - void DataChanged (const DataChangedEvent& rDCEvt); -}; - -} } // end of namespace ::sd::toolbox - -#endif diff --git a/sd/source/ui/toolpanel/TitledControl.cxx b/sd/source/ui/toolpanel/TitledControl.cxx index 4843102feb48..e83e6c47c10a 100755 --- a/sd/source/ui/toolpanel/TitledControl.cxx +++ b/sd/source/ui/toolpanel/TitledControl.cxx @@ -311,22 +311,6 @@ void TitledControl::SetEnabledState(bool bFlag) -void TitledControl::SetUserData (void* pUserData) -{ - mpUserData = pUserData; -} - - - - -void* TitledControl::GetUserData (void) const -{ - return mpUserData; -} - - - - bool TitledControl::IsShowing (void) const { return mbVisible; diff --git a/sd/source/ui/toolpanel/controls/AnimationSchemesPanel.cxx b/sd/source/ui/toolpanel/controls/AnimationSchemesPanel.cxx index c4fc41e97744..730fc74795f2 100644..100755 --- a/sd/source/ui/toolpanel/controls/AnimationSchemesPanel.cxx +++ b/sd/source/ui/toolpanel/controls/AnimationSchemesPanel.cxx @@ -24,7 +24,93 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: AnimationSchemesPanel.cxx,v $ + * $Revision: 1.6 $ + * + * 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. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_sd.hxx" +#include "AnimationSchemesPanel.hxx" + +#include "strings.hrc" +#include "sdresid.hxx" +#include <com/sun/star/frame/XModel.hpp> + +namespace sd +{ + + class ViewShellBase; + extern ::Window * createAnimationSchemesPanel( ::Window* pParent, ViewShellBase& rBase ); + +namespace toolpanel { namespace controls { + +AnimationSchemesPanel::AnimationSchemesPanel(TreeNode* pParent, ViewShellBase& rBase) + : SubToolPanel (pParent), + maPreferredSize( 100, 200 ) +{ + mpWrappedControl = createAnimationSchemesPanel( pParent->GetWindow(), rBase ); + mpWrappedControl->Show(); +} + +AnimationSchemesPanel::~AnimationSchemesPanel() +{ + delete mpWrappedControl; +} + +Size AnimationSchemesPanel::GetPreferredSize() +{ + return maPreferredSize; +} +sal_Int32 AnimationSchemesPanel::GetPreferredWidth(sal_Int32 ) +{ + return maPreferredSize.Width(); +} +sal_Int32 AnimationSchemesPanel::GetPreferredHeight(sal_Int32 ) +{ + return maPreferredSize.Height(); +} +::Window* AnimationSchemesPanel::GetWindow() +{ + return mpWrappedControl; +} +bool AnimationSchemesPanel::IsResizable() +{ + return true; +} +bool AnimationSchemesPanel::IsExpandable() const +{ + return true; +} + + +} } } // end of namespace ::sd::toolpanel::controls // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sd.hxx" #include "AnimationSchemesPanel.hxx" diff --git a/sd/source/ui/toolpanel/controls/AnimationSchemesPanel.hxx b/sd/source/ui/toolpanel/controls/AnimationSchemesPanel.hxx index 4cee546dae0d..dd3388fb0342 100644..100755 --- a/sd/source/ui/toolpanel/controls/AnimationSchemesPanel.hxx +++ b/sd/source/ui/toolpanel/controls/AnimationSchemesPanel.hxx @@ -24,6 +24,35 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: AnimationSchemesPanel.hxx,v $ + * $Revision: 1.6 $ + * + * 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 SD_TASKPANE_CONTROLS_ANIMATION_SCHEMES_PANEL_HXX #define SD_TASKPANE_CONTROLS_ANIMATION_SCHEMES_PANEL_HXX @@ -66,3 +95,44 @@ private: } } } // end of namespace ::sd::toolpanel::controls #endif +#ifndef SD_TASKPANE_CONTROLS_ANIMATION_SCHEMES_PANEL_HXX +#define SD_TASKPANE_CONTROLS_ANIMATION_SCHEMES_PANEL_HXX + +#include "taskpane/SubToolPanel.hxx" + +namespace sd { +class ViewShellBase; +} + +namespace sd { namespace toolpanel { +class TreeNode; +} } + +namespace sd { namespace toolpanel { namespace controls { + +class AnimationSchemesPanel + : public SubToolPanel +{ +public: + AnimationSchemesPanel ( + TreeNode* pParent, + ViewShellBase& rBase); + virtual ~AnimationSchemesPanel (void); + + virtual Size GetPreferredSize (void); + virtual sal_Int32 GetPreferredWidth (sal_Int32 nHeigh); + virtual sal_Int32 GetPreferredHeight (sal_Int32 nWidth); + virtual ::Window* GetWindow (void); + virtual bool IsResizable (void); + virtual bool IsExpandable (void) const; + + using Window::GetWindow; + +private: + Size maPreferredSize; + ::Window* mpWrappedControl; +}; + +} } } // end of namespace ::sd::toolpanel::controls + +#endif diff --git a/sd/source/ui/toolpanel/controls/MasterPageContainer.cxx b/sd/source/ui/toolpanel/controls/MasterPageContainer.cxx index 444ecd6dacb4..80a094ec1a66 100644..100755 --- a/sd/source/ui/toolpanel/controls/MasterPageContainer.cxx +++ b/sd/source/ui/toolpanel/controls/MasterPageContainer.cxx @@ -73,24 +73,6 @@ namespace { typedef ::std::vector<SharedMasterPageDescriptor> MasterPageContainerType; - -class PreviewCreationRequest -{ -public: - PreviewCreationRequest (MasterPageContainer::Token aToken, int nPriority); - MasterPageContainer::Token maToken; - int mnPriority; - class Compare {public: - bool operator() (const PreviewCreationRequest& r1,const PreviewCreationRequest& r2); - }; - class CompareToken {public: - MasterPageContainer::Token maToken; - CompareToken(MasterPageContainer::Token aToken); - bool operator() (const PreviewCreationRequest& rRequest); - }; -}; - - } // end of anonymous namespace @@ -423,28 +405,6 @@ MasterPageContainer::Token MasterPageContainer::GetTokenForURL ( -MasterPageContainer::Token MasterPageContainer::GetTokenForPageName ( - const String& sPageName) -{ - const ::osl::MutexGuard aGuard (mpImpl->maMutex); - - Token aResult (NIL_TOKEN); - if (sPageName.Len() > 0) - { - MasterPageContainerType::iterator iEntry ( - ::std::find_if ( - mpImpl->maContainer.begin(), - mpImpl->maContainer.end(), - MasterPageDescriptor::PageNameComparator(sPageName))); - if (iEntry != mpImpl->maContainer.end()) - aResult = (*iEntry)->maToken; - } - return aResult; -} - - - - MasterPageContainer::Token MasterPageContainer::GetTokenForStyleName (const String& sStyleName) { const ::osl::MutexGuard aGuard (mpImpl->maMutex); @@ -589,46 +549,6 @@ sal_Int32 MasterPageContainer::GetTemplateIndexForToken (Token aToken) -void MasterPageContainer::SetPreviewProviderForToken ( - Token aToken, - const ::boost::shared_ptr<PreviewProvider>& rpPreviewProvider) -{ - const ::osl::MutexGuard aGuard (mpImpl->maMutex); - - SharedMasterPageDescriptor pDescriptor = mpImpl->GetDescriptor(aToken); - if (pDescriptor.get()!=NULL) - { - pDescriptor->mpPreviewProvider = rpPreviewProvider; - mpImpl->InvalidatePreview(aToken); - } -} - - - - -SdPage* MasterPageContainer::GetSlideForToken ( - MasterPageContainer::Token aToken, - bool bLoad) -{ - const ::osl::MutexGuard aGuard (mpImpl->maMutex); - - SdPage* pSlide = NULL; - SharedMasterPageDescriptor pDescriptor = mpImpl->GetDescriptor(aToken); - if (pDescriptor.get() != NULL) - { - pSlide = pDescriptor->mpSlide; - if (pSlide==NULL && bLoad) - { - GetPageObjectForToken(aToken, bLoad); - pSlide = pDescriptor->mpSlide; - } - } - return pSlide; -} - - - - SharedMasterPageDescriptor MasterPageContainer::GetDescriptorForToken ( MasterPageContainer::Token aToken) { @@ -639,19 +559,6 @@ SharedMasterPageDescriptor MasterPageContainer::GetDescriptorForToken ( - -bool MasterPageContainer::UpdateDescriptor ( - const SharedMasterPageDescriptor& rpDescriptor, - bool bForcePageObject, - bool bForcePreview, - bool bSendEvents) -{ - return mpImpl->UpdateDescriptor(rpDescriptor, bForcePageObject, bForcePreview, bSendEvents); -} - - - - void MasterPageContainer::InvalidatePreview (MasterPageContainer::Token aToken) { mpImpl->InvalidatePreview(aToken); @@ -1311,58 +1218,3 @@ void MasterPageContainer::Implementation::FillingDone (void) } } } // end of namespace ::sd::toolpanel::controls - - - - -namespace { - -//===== PreviewCreationRequest ================================================ - -PreviewCreationRequest::PreviewCreationRequest ( - MasterPageContainer::Token aToken, - int nPriority) - : maToken(aToken), - mnPriority(nPriority) -{ -} - - - - -bool PreviewCreationRequest::Compare::operator() ( - const PreviewCreationRequest& aRequest1, - const PreviewCreationRequest& aRequest2) -{ - if (aRequest1.mnPriority != aRequest2.mnPriority) - { - // Prefer requests with higher priority. - return aRequest1.mnPriority > aRequest2.mnPriority; - } - else - { - // Prefer tokens that have been earlier created (those with lower - // value). - return aRequest1.maToken < aRequest2.maToken; - } -} - - - - -PreviewCreationRequest::CompareToken::CompareToken (MasterPageContainer::Token aToken) - : maToken(aToken) -{ -} - - - - -bool PreviewCreationRequest::CompareToken::operator() (const PreviewCreationRequest& aRequest) -{ - return maToken==aRequest.maToken; -} - - - -} // end of anonymous namespace diff --git a/sd/source/ui/toolpanel/controls/MasterPageContainer.hxx b/sd/source/ui/toolpanel/controls/MasterPageContainer.hxx index d922c089ffb4..60f760f63e34 100644..100755 --- a/sd/source/ui/toolpanel/controls/MasterPageContainer.hxx +++ b/sd/source/ui/toolpanel/controls/MasterPageContainer.hxx @@ -143,26 +143,16 @@ public: Token GetTokenForIndex (int nIndex); Token GetTokenForURL (const String& sURL); - Token GetTokenForPageName (const String& sPageName); Token GetTokenForStyleName (const String& sStyleName); Token GetTokenForPageObject (const SdPage* pPage); String GetURLForToken (Token aToken); String GetPageNameForToken (Token aToken); String GetStyleNameForToken (Token aToken); - SdPage* GetSlideForToken (Token aToken, bool bLoad=true); SdPage* GetPageObjectForToken (Token aToken, bool bLoad=true); Origin GetOriginForToken (Token aToken); sal_Int32 GetTemplateIndexForToken (Token aToken); ::boost::shared_ptr<MasterPageDescriptor> GetDescriptorForToken (Token aToken); - bool UpdateDescriptor ( - const ::boost::shared_ptr<MasterPageDescriptor>& rpDescriptor, - bool bForcePageObject, - bool bForcePreview, - bool bSendEvents); - - void SetPreviewProviderForToken (Token aToken, - const ::boost::shared_ptr<PreviewProvider>& rpPreviewProvider); void InvalidatePreview (Token aToken); diff --git a/sd/source/ui/toolpanel/controls/MasterPageContainerProviders.cxx b/sd/source/ui/toolpanel/controls/MasterPageContainerProviders.cxx index 9a5eefb6d925..61483f278a4f 100755 --- a/sd/source/ui/toolpanel/controls/MasterPageContainerProviders.cxx +++ b/sd/source/ui/toolpanel/controls/MasterPageContainerProviders.cxx @@ -387,46 +387,6 @@ bool DefaultPageObjectProvider::operator== (const PageObjectProvider& rProvider) -//===== DefaultPagePreviewProvider ============================================ - -DefaultPagePreviewProvider::DefaultPagePreviewProvider (void) -{ -} - - - -Image DefaultPagePreviewProvider::operator() ( - int nWidth, - SdPage* pPage, - ::sd::PreviewRenderer& rRenderer) -{ - // Unused parameters. - (void)nWidth; - (void)pPage; - (void)rRenderer; - - return Image(); -} - - - - -int DefaultPagePreviewProvider::GetCostIndex (void) -{ - return 0; -} - - - - -bool DefaultPagePreviewProvider::NeedsPageObject (void) -{ - return false; -} - - - - //===== ExistingPageProvider ================================================== ExistingPageProvider::ExistingPageProvider (SdPage* pPage) diff --git a/sd/source/ui/toolpanel/controls/MasterPageContainerProviders.hxx b/sd/source/ui/toolpanel/controls/MasterPageContainerProviders.hxx index 7cde148b3e3d..071b23cdbb16 100644..100755 --- a/sd/source/ui/toolpanel/controls/MasterPageContainerProviders.hxx +++ b/sd/source/ui/toolpanel/controls/MasterPageContainerProviders.hxx @@ -170,21 +170,6 @@ public: - -/** Used temporarily to avoid the (expensive) creation of the default page - too early. -*/ -class DefaultPagePreviewProvider : public PreviewProvider -{ -public: - DefaultPagePreviewProvider (void); - virtual Image operator() (int nWidth, SdPage* pPage, ::sd::PreviewRenderer& rRenderer); - virtual int GetCostIndex (void); - virtual bool NeedsPageObject (void); -}; - - - /** This implementation of the PageObjectProvider simply returns an already existing master page object. */ diff --git a/sd/source/ui/toolpanel/controls/MasterPageDescriptor.cxx b/sd/source/ui/toolpanel/controls/MasterPageDescriptor.cxx index 49ae6dff264d..6871883d65f5 100644..100755 --- a/sd/source/ui/toolpanel/controls/MasterPageDescriptor.cxx +++ b/sd/source/ui/toolpanel/controls/MasterPageDescriptor.cxx @@ -337,28 +337,6 @@ bool MasterPageDescriptor::URLComparator::operator() ( -//===== PageNameComparator ==================================================== - -MasterPageDescriptor::PageNameComparator::PageNameComparator (const ::rtl::OUString& sPageName) - : msPageName(sPageName) -{ -} - - - - -bool MasterPageDescriptor::PageNameComparator::operator() ( - const SharedMasterPageDescriptor& rDescriptor) -{ - if (rDescriptor.get() == NULL) - return false; - else - return rDescriptor->msPageName.equals(msPageName); -} - - - - // ===== StyleNameComparator ================================================== MasterPageDescriptor::StyleNameComparator::StyleNameComparator (const ::rtl::OUString& sStyleName) diff --git a/sd/source/ui/toolpanel/controls/MasterPageDescriptor.hxx b/sd/source/ui/toolpanel/controls/MasterPageDescriptor.hxx index 1eea46bd1802..0303989e3379 100644..100755 --- a/sd/source/ui/toolpanel/controls/MasterPageDescriptor.hxx +++ b/sd/source/ui/toolpanel/controls/MasterPageDescriptor.hxx @@ -214,11 +214,6 @@ public: URLComparator (const ::rtl::OUString& sURL); bool operator() (const SharedMasterPageDescriptor& rDescriptor); }; - class PageNameComparator { public: - ::rtl::OUString msPageName; - PageNameComparator (const ::rtl::OUString& sPageName); - bool operator() (const SharedMasterPageDescriptor& rDescriptor); - }; class StyleNameComparator { public: ::rtl::OUString msStyleName; StyleNameComparator (const ::rtl::OUString& sStyleName); diff --git a/sd/source/ui/toolpanel/controls/MasterPageObserver.cxx b/sd/source/ui/toolpanel/controls/MasterPageObserver.cxx index 0f485174009d..2ba0cc678403 100644..100755 --- a/sd/source/ui/toolpanel/controls/MasterPageObserver.cxx +++ b/sd/source/ui/toolpanel/controls/MasterPageObserver.cxx @@ -187,15 +187,6 @@ MasterPageObserver::~MasterPageObserver (void) -MasterPageObserver::MasterPageNameSet MasterPageObserver::GetMasterPageNames ( - SdDrawDocument& rDocument) -{ - return mpImpl->GetMasterPageNames (rDocument); -} - - - - //===== MasterPageObserver::Implementation ==================================== void MasterPageObserver::Implementation::RegisterDocument ( diff --git a/sd/source/ui/toolpanel/controls/MasterPagesSelector.cxx b/sd/source/ui/toolpanel/controls/MasterPagesSelector.cxx index 4571d4278140..b321dbf8dd14 100644..100755 --- a/sd/source/ui/toolpanel/controls/MasterPagesSelector.cxx +++ b/sd/source/ui/toolpanel/controls/MasterPagesSelector.cxx @@ -41,7 +41,6 @@ #include "app.hrc" #include "res_bmp.hrc" #include "strings.hrc" -#include "showview.hxx" #include "DrawViewShell.hxx" #include "DrawController.hxx" #include "SlideSorterViewShell.hxx" @@ -699,21 +698,6 @@ void MasterPagesSelector::RemoveTokenToIndexEntry ( -void MasterPagesSelector::InvalidatePreview (MasterPageContainer::Token aToken) -{ - const ::osl::MutexGuard aGuard (maMutex); - - int nIndex (GetIndexForToken(aToken)); - if (nIndex > 0) - { - mpContainer->InvalidatePreview(aToken); - mpContainer->RequestPreview(aToken); - } -} - - - - void MasterPagesSelector::InvalidatePreview (const SdPage* pPage) { const ::osl::MutexGuard aGuard (maMutex); @@ -734,20 +718,6 @@ void MasterPagesSelector::InvalidatePreview (const SdPage* pPage) } } - - - -void MasterPagesSelector::InvalidateAllPreviews (void) -{ - const ::osl::MutexGuard aGuard (maMutex); - - for (USHORT nIndex=1; nIndex<=mpPageSet->GetItemCount(); nIndex++) - InvalidatePreview(nIndex); -} - - - - void MasterPagesSelector::UpdateAllPreviews (void) { const ::osl::MutexGuard aGuard (maMutex); diff --git a/sd/source/ui/toolpanel/controls/MasterPagesSelector.hxx b/sd/source/ui/toolpanel/controls/MasterPagesSelector.hxx index a480729aa9c8..a2df51f2bd4b 100644..100755 --- a/sd/source/ui/toolpanel/controls/MasterPagesSelector.hxx +++ b/sd/source/ui/toolpanel/controls/MasterPagesSelector.hxx @@ -131,14 +131,8 @@ public: Index into the value set control that is used for displaying the previews. */ - void InvalidatePreview (MasterPageContainer::Token aToken); void InvalidatePreview (const SdPage* pPage); - /** Mark all previews as no being up-to-date anymore. This method is - typically called when the size of the previews has changed. - */ - void InvalidateAllPreviews (void); - void UpdateAllPreviews (void); protected: diff --git a/sd/source/ui/toolpanel/controls/makefile.mk b/sd/source/ui/toolpanel/controls/makefile.mk index 33871a415a7e..b2218e55008c 100644..100755 --- a/sd/source/ui/toolpanel/controls/makefile.mk +++ b/sd/source/ui/toolpanel/controls/makefile.mk @@ -59,8 +59,7 @@ SLOFILES = \ $(SLO)$/RecentMasterPagesSelector.obj \ $(SLO)$/CustomAnimationPanel.obj \ $(SLO)$/SlideTransitionPanel.obj \ - $(SLO)$/TableDesignPanel.obj \ - $(SLO)$/AnimationSchemesPanel.obj + $(SLO)$/TableDesignPanel.obj # --- Tagets ------------------------------------------------------- diff --git a/sd/source/ui/toolpanel/makefile.mk b/sd/source/ui/toolpanel/makefile.mk index 4d83b8a85a70..262b32535ef3 100755 --- a/sd/source/ui/toolpanel/makefile.mk +++ b/sd/source/ui/toolpanel/makefile.mk @@ -45,10 +45,8 @@ PRJINC=..$/slidesorter SLOFILES = \ $(SLO)$/ControlContainer.obj \ $(SLO)$/ScrollPanel.obj \ - $(SLO)$/SimpleLayoutWrapper.obj \ $(SLO)$/SubToolPanel.obj \ $(SLO)$/TitleBar.obj \ - $(SLO)$/TitleToolBox.obj \ $(SLO)$/TitledControl.obj \ $(SLO)$/TaskPaneControlFactory.obj \ $(SLO)$/TaskPaneFocusManager.obj \ @@ -59,7 +57,6 @@ SLOFILES = \ $(SLO)$/ToolPanelFactory.obj \ $(SLO)$/ToolPanelUIElement.obj \ \ - $(SLO)$/EmptyWindow.obj \ $(SLO)$/LayoutMenu.obj \ $(SLO)$/TestMenu.obj \ $(SLO)$/TestPanel.obj \ |