2004-07-13 13:44:27 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2005-09-09 05:40:41 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2004-07-13 13:44:27 +00:00
|
|
|
*
|
2005-09-09 05:40:41 +00:00
|
|
|
* $RCSfile: MasterPagesPanel.cxx,v $
|
2004-07-13 13:44:27 +00:00
|
|
|
*
|
2007-04-03 15:22:28 +00:00
|
|
|
* $Revision: 1.13 $
|
2004-07-13 13:44:27 +00:00
|
|
|
*
|
2007-04-03 15:22:28 +00:00
|
|
|
* last change: $Author: rt $ $Date: 2007-04-03 16:22:28 $
|
2004-07-13 13:44:27 +00:00
|
|
|
*
|
2005-09-09 05:40:41 +00:00
|
|
|
* The Contents of this file are made available subject to
|
|
|
|
* the terms of GNU Lesser General Public License Version 2.1.
|
2004-07-13 13:44:27 +00:00
|
|
|
*
|
|
|
|
*
|
2005-09-09 05:40:41 +00:00
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
* =============================================
|
|
|
|
* Copyright 2005 by Sun Microsystems, Inc.
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
2004-07-13 13:44:27 +00:00
|
|
|
*
|
2005-09-09 05:40:41 +00:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License version 2.1, as published by the Free Software Foundation.
|
2004-07-13 13:44:27 +00:00
|
|
|
*
|
2005-09-09 05:40:41 +00:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2004-07-13 13:44:27 +00:00
|
|
|
*
|
2005-09-09 05:40:41 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
* MA 02111-1307 USA
|
2004-07-13 13:44:27 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-16 18:19:44 +00:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_sd.hxx"
|
|
|
|
|
2004-07-13 13:44:27 +00:00
|
|
|
#include "MasterPagesPanel.hxx"
|
2005-03-18 16:01:36 +00:00
|
|
|
#include "taskpane/ScrollPanel.hxx"
|
2004-07-13 13:44:27 +00:00
|
|
|
#include "CurrentMasterPagesSelector.hxx"
|
|
|
|
#include "RecentMasterPagesSelector.hxx"
|
|
|
|
#include "AllMasterPagesSelector.hxx"
|
2005-03-18 16:01:36 +00:00
|
|
|
#include "taskpane/TaskPaneControlFactory.hxx"
|
2005-07-14 09:25:17 +00:00
|
|
|
#include "taskpane/TitledControl.hxx"
|
2006-03-21 16:32:49 +00:00
|
|
|
#include "../TaskPaneShellManager.hxx"
|
2004-07-13 13:44:27 +00:00
|
|
|
|
|
|
|
#include "DrawViewShell.hxx"
|
|
|
|
#include "ViewShellBase.hxx"
|
|
|
|
|
|
|
|
#include "strings.hrc"
|
|
|
|
#include "sdresid.hxx"
|
2004-11-26 19:26:20 +00:00
|
|
|
#include "helpids.h"
|
2005-07-14 09:25:17 +00:00
|
|
|
#include <svtools/valueset.hxx>
|
2004-07-13 13:44:27 +00:00
|
|
|
|
|
|
|
namespace sd { namespace toolpanel { namespace controls {
|
|
|
|
|
|
|
|
|
|
|
|
MasterPagesPanel::MasterPagesPanel (TreeNode* pParent, ViewShellBase& rBase)
|
2005-02-24 14:07:22 +00:00
|
|
|
: ScrollPanel (pParent)
|
2004-07-13 13:44:27 +00:00
|
|
|
{
|
|
|
|
SdDrawDocument* pDocument = rBase.GetDocument();
|
2005-07-14 09:25:17 +00:00
|
|
|
::std::auto_ptr<controls::MasterPagesSelector> pSelector;
|
|
|
|
TitledControl* pTitledControl;
|
2004-07-13 13:44:27 +00:00
|
|
|
|
2006-04-26 19:51:02 +00:00
|
|
|
::boost::shared_ptr<MasterPageContainer> pContainer (new MasterPageContainer());
|
|
|
|
|
2004-07-13 13:44:27 +00:00
|
|
|
// Create a panel with the master pages that are in use by the currently
|
|
|
|
// edited document.
|
2007-04-03 15:22:28 +00:00
|
|
|
DrawViewShell* pDrawViewShell = dynamic_cast<DrawViewShell*>(rBase.GetMainViewShell().get());
|
2005-07-14 09:25:17 +00:00
|
|
|
pSelector.reset(new controls::CurrentMasterPagesSelector (
|
2005-02-24 14:07:22 +00:00
|
|
|
this,
|
|
|
|
*pDocument,
|
|
|
|
rBase,
|
2006-04-26 19:51:02 +00:00
|
|
|
pContainer));
|
2004-07-13 13:44:27 +00:00
|
|
|
pSelector->LateInit();
|
2005-07-14 09:25:17 +00:00
|
|
|
pSelector->SetSmartHelpId( SmartId(HID_SD_TASK_PANE_PREVIEW_CURRENT) );
|
2006-03-21 16:32:49 +00:00
|
|
|
GetShellManager()->AddSubShell(
|
|
|
|
HID_SD_TASK_PANE_PREVIEW_CURRENT,
|
|
|
|
pSelector.get(),
|
|
|
|
pSelector->GetWindow());
|
2005-07-14 09:25:17 +00:00
|
|
|
pTitledControl = AddControl (
|
|
|
|
::std::auto_ptr<TreeNode>(pSelector.release()),
|
2004-11-26 19:26:20 +00:00
|
|
|
SdResId(STR_TASKPANEL_CURRENT_MASTER_PAGES_TITLE),
|
|
|
|
HID_SD_CURRENT_MASTERS);
|
2004-07-13 13:44:27 +00:00
|
|
|
|
|
|
|
// Create a panel with the most recently used master pages.
|
2005-07-14 09:25:17 +00:00
|
|
|
pSelector.reset(new controls::RecentMasterPagesSelector (
|
2004-07-13 13:44:27 +00:00
|
|
|
this,
|
|
|
|
*pDocument,
|
2006-04-26 19:51:02 +00:00
|
|
|
rBase,
|
|
|
|
pContainer));
|
2004-07-13 13:44:27 +00:00
|
|
|
pSelector->LateInit();
|
2005-07-14 09:25:17 +00:00
|
|
|
pSelector->SetSmartHelpId( SmartId(HID_SD_TASK_PANE_PREVIEW_RECENT) );
|
2006-03-21 16:32:49 +00:00
|
|
|
GetShellManager()->AddSubShell(
|
|
|
|
HID_SD_TASK_PANE_PREVIEW_RECENT,
|
|
|
|
pSelector.get(),
|
|
|
|
pSelector->GetWindow());
|
2005-07-14 09:25:17 +00:00
|
|
|
pTitledControl = AddControl (
|
|
|
|
::std::auto_ptr<TreeNode>(pSelector.release()),
|
2004-11-26 19:26:20 +00:00
|
|
|
SdResId(STR_TASKPANEL_RECENT_MASTER_PAGES_TITLE),
|
|
|
|
HID_SD_RECENT_MASTERS);
|
2004-07-13 13:44:27 +00:00
|
|
|
|
|
|
|
// Create a panel with all available master pages.
|
2005-07-14 09:25:17 +00:00
|
|
|
pSelector.reset(new controls::AllMasterPagesSelector (
|
2004-07-13 13:44:27 +00:00
|
|
|
this,
|
|
|
|
*pDocument,
|
|
|
|
rBase,
|
2006-04-26 19:51:02 +00:00
|
|
|
*pDrawViewShell,
|
|
|
|
pContainer));
|
2004-07-13 13:44:27 +00:00
|
|
|
pSelector->LateInit();
|
2005-07-14 09:25:17 +00:00
|
|
|
pSelector->SetSmartHelpId( SmartId(HID_SD_TASK_PANE_PREVIEW_ALL) );
|
2006-03-21 16:32:49 +00:00
|
|
|
GetShellManager()->AddSubShell(
|
|
|
|
HID_SD_TASK_PANE_PREVIEW_ALL,
|
|
|
|
pSelector.get(),
|
|
|
|
pSelector->GetWindow());
|
2005-07-14 09:25:17 +00:00
|
|
|
pTitledControl = AddControl (
|
|
|
|
::std::auto_ptr<TreeNode>(pSelector.release()),
|
2004-11-26 19:26:20 +00:00
|
|
|
SdResId(STR_TASKPANEL_ALL_MASTER_PAGES_TITLE),
|
|
|
|
HID_SD_ALL_MASTERS);
|
2004-07-13 13:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MasterPagesPanel::~MasterPagesPanel (void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2005-03-18 16:01:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::auto_ptr<ControlFactory> MasterPagesPanel::CreateControlFactory (ViewShellBase& rBase)
|
|
|
|
{
|
|
|
|
return std::auto_ptr<ControlFactory>(
|
|
|
|
new ControlFactoryWithArgs1<MasterPagesPanel,ViewShellBase>(rBase));
|
|
|
|
}
|
|
|
|
|
2005-07-14 09:25:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2004-07-13 13:44:27 +00:00
|
|
|
} } } // end of namespace ::sd::toolpanel::controls
|