PanelFactory.cxx (3c226292) | PanelFactory.cxx (f6859a6b) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 16 unchanged lines hidden (view full) --- 25#include "framework/Pane.hxx" 26#include "ViewShellBase.hxx" 27#include "DrawController.hxx" 28#include "LayoutMenu.hxx" 29#include "CurrentMasterPagesSelector.hxx" 30#include "RecentMasterPagesSelector.hxx" 31#include "AllMasterPagesSelector.hxx" 32#include "CustomAnimationPanel.hxx" | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 16 unchanged lines hidden (view full) --- 25#include "framework/Pane.hxx" 26#include "ViewShellBase.hxx" 27#include "DrawController.hxx" 28#include "LayoutMenu.hxx" 29#include "CurrentMasterPagesSelector.hxx" 30#include "RecentMasterPagesSelector.hxx" 31#include "AllMasterPagesSelector.hxx" 32#include "CustomAnimationPanel.hxx" |
33#include "TableDesignPanel.hxx" | |
34#include "SlideTransitionPanel.hxx" 35#include "NavigatorWrapper.hxx" 36 37#include <sfx2/viewfrm.hxx> 38#include <sfx2/sidebar/SidebarPanelBase.hxx> 39#include <comphelper/namedvaluecollection.hxx> 40#include <vcl/window.hxx> 41#include <toolkit/helper/vclunohelper.hxx> 42 43using namespace css; 44using namespace cssu; 45using namespace ::sd::framework; 46using ::rtl::OUString; 47 48#define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString))) 49 | 33#include "SlideTransitionPanel.hxx" 34#include "NavigatorWrapper.hxx" 35 36#include <sfx2/viewfrm.hxx> 37#include <sfx2/sidebar/SidebarPanelBase.hxx> 38#include <comphelper/namedvaluecollection.hxx> 39#include <vcl/window.hxx> 40#include <toolkit/helper/vclunohelper.hxx> 41 42using namespace css; 43using namespace cssu; 44using namespace ::sd::framework; 45using ::rtl::OUString; 46 47#define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString))) 48 |
49namespace sd { 50 extern ::Window * createTableDesignPanel (::Window* pParent, ViewShellBase& rBase); 51} 52 |
|
50namespace sd { namespace sidebar { 51 52namespace { 53 /** Note that these names have to be identical to (the tail of) 54 the entries in officecfg/registry/data/org/openoffice/Office/Impress.xcu 55 for the TaskPanelFactory. 56 */ 57 const static char* gsResourceNameCustomAnimations = "/CustomAnimations"; --- 107 unchanged lines hidden (view full) --- 165 throw RuntimeException(A2S("can not get ViewShellBase for frame"), NULL); 166 167 // Get bindings from given arguments. 168 const sal_uInt64 nBindingsValue (aArguments.getOrDefault("SfxBindings", sal_uInt64(0))); 169 SfxBindings* pBindings = reinterpret_cast<SfxBindings*>(nBindingsValue); 170 171 // Create a framework view. 172 ::Window* pControl = NULL; | 53namespace sd { namespace sidebar { 54 55namespace { 56 /** Note that these names have to be identical to (the tail of) 57 the entries in officecfg/registry/data/org/openoffice/Office/Impress.xcu 58 for the TaskPanelFactory. 59 */ 60 const static char* gsResourceNameCustomAnimations = "/CustomAnimations"; --- 107 unchanged lines hidden (view full) --- 168 throw RuntimeException(A2S("can not get ViewShellBase for frame"), NULL); 169 170 // Get bindings from given arguments. 171 const sal_uInt64 nBindingsValue (aArguments.getOrDefault("SfxBindings", sal_uInt64(0))); 172 SfxBindings* pBindings = reinterpret_cast<SfxBindings*>(nBindingsValue); 173 174 // Create a framework view. 175 ::Window* pControl = NULL; |
173 | 176 css::ui::LayoutSize aLayoutSize (-1,-1,-1); 177 |
174#define EndsWith(s,t) s.endsWithAsciiL(t,strlen(t)) 175 if (EndsWith(rsUIElementResourceURL, gsResourceNameCustomAnimations)) 176 pControl = new CustomAnimationPanel(pParentWindow, *pBase); 177 else if (EndsWith(rsUIElementResourceURL, gsResourceNameLayouts)) 178 pControl = new LayoutMenu(pParentWindow, *pBase, xSidebar); 179 else if (EndsWith(rsUIElementResourceURL, gsResourceNameAllMasterPages)) 180 pControl = AllMasterPagesSelector::Create(pParentWindow, *pBase, xSidebar); 181 else if (EndsWith(rsUIElementResourceURL, gsResourceNameRecentMasterPages)) 182 pControl = RecentMasterPagesSelector::Create(pParentWindow, *pBase, xSidebar); 183 else if (EndsWith(rsUIElementResourceURL, gsResourceNameUsedMasterPages)) 184 pControl = CurrentMasterPagesSelector::Create(pParentWindow, *pBase, xSidebar); 185 else if (EndsWith(rsUIElementResourceURL, gsResourceNameSlideTransitions)) 186 pControl = new SlideTransitionPanel(pParentWindow, *pBase); 187 else if (EndsWith(rsUIElementResourceURL, gsResourceNameTableDesign)) | 178#define EndsWith(s,t) s.endsWithAsciiL(t,strlen(t)) 179 if (EndsWith(rsUIElementResourceURL, gsResourceNameCustomAnimations)) 180 pControl = new CustomAnimationPanel(pParentWindow, *pBase); 181 else if (EndsWith(rsUIElementResourceURL, gsResourceNameLayouts)) 182 pControl = new LayoutMenu(pParentWindow, *pBase, xSidebar); 183 else if (EndsWith(rsUIElementResourceURL, gsResourceNameAllMasterPages)) 184 pControl = AllMasterPagesSelector::Create(pParentWindow, *pBase, xSidebar); 185 else if (EndsWith(rsUIElementResourceURL, gsResourceNameRecentMasterPages)) 186 pControl = RecentMasterPagesSelector::Create(pParentWindow, *pBase, xSidebar); 187 else if (EndsWith(rsUIElementResourceURL, gsResourceNameUsedMasterPages)) 188 pControl = CurrentMasterPagesSelector::Create(pParentWindow, *pBase, xSidebar); 189 else if (EndsWith(rsUIElementResourceURL, gsResourceNameSlideTransitions)) 190 pControl = new SlideTransitionPanel(pParentWindow, *pBase); 191 else if (EndsWith(rsUIElementResourceURL, gsResourceNameTableDesign)) |
188 pControl = new TableDesignPanel(pParentWindow, *pBase); | 192 pControl = createTableDesignPanel(pParentWindow, *pBase); |
189 else if (EndsWith(rsUIElementResourceURL, gsResourceNameNavigator)) 190 pControl = new NavigatorWrapper(pParentWindow, *pBase, pBindings); 191#undef EndsWith 192 193 if (pControl == NULL) 194 throw lang::IllegalArgumentException(); 195 196 // Create a wrapper around the control that implements the 197 // necessary UNO interfaces. 198 return sfx2::sidebar::SidebarPanelBase::Create( 199 rsUIElementResourceURL, 200 xFrame, 201 pControl, | 193 else if (EndsWith(rsUIElementResourceURL, gsResourceNameNavigator)) 194 pControl = new NavigatorWrapper(pParentWindow, *pBase, pBindings); 195#undef EndsWith 196 197 if (pControl == NULL) 198 throw lang::IllegalArgumentException(); 199 200 // Create a wrapper around the control that implements the 201 // necessary UNO interfaces. 202 return sfx2::sidebar::SidebarPanelBase::Create( 203 rsUIElementResourceURL, 204 xFrame, 205 pControl, |
202 ui::LayoutSize(-1,-1,-1)); | 206 aLayoutSize); |
203} 204 205 206 207 208} } // end of namespace sd::sidebar | 207} 208 209 210 211 212} } // end of namespace sd::sidebar |