diff options
Diffstat (limited to 'sfx2/inc')
-rw-r--r-- | sfx2/inc/sfx2/navigat.hxx | 2 | ||||
-rw-r--r-- | sfx2/inc/sfx2/sfx.hrc | 1 | ||||
-rw-r--r-- | sfx2/inc/sfx2/sfxsids.hrc | 1 | ||||
-rw-r--r-- | sfx2/inc/sfx2/shell.hxx | 2 | ||||
-rw-r--r-- | sfx2/inc/sfx2/sidebar/ContextChangeBroadcaster.hxx | 62 | ||||
-rw-r--r-- | sfx2/inc/sfx2/sidebar/ControlFactory.hxx | 50 | ||||
-rw-r--r-- | sfx2/inc/sfx2/sidebar/ControllerItem.hxx | 58 | ||||
-rw-r--r-- | sfx2/inc/sfx2/sidebar/EnumContext.hxx | 173 | ||||
-rw-r--r-- | sfx2/inc/sfx2/sidebar/IContextChangeReceiver.hxx | 40 | ||||
-rw-r--r-- | sfx2/inc/sfx2/sidebar/ILayoutableWindow.hxx | 47 | ||||
-rwxr-xr-x | sfx2/inc/sfx2/sidebar/PopupContainer.hxx | 41 | ||||
-rw-r--r-- | sfx2/inc/sfx2/sidebar/SidebarChildWindow.hxx | 52 | ||||
-rw-r--r-- | sfx2/inc/sfx2/sidebar/SidebarPanelBase.hxx | 128 | ||||
-rw-r--r-- | sfx2/inc/sfx2/sidebar/Theme.hxx | 282 | ||||
-rw-r--r-- | sfx2/inc/sfx2/sidebar/propertypanel.hrc | 132 | ||||
-rw-r--r-- | sfx2/inc/sfx2/templdlg.hxx | 26 |
16 files changed, 1095 insertions, 2 deletions
diff --git a/sfx2/inc/sfx2/navigat.hxx b/sfx2/inc/sfx2/navigat.hxx index 4960fd417ea8..6be20605bc5d 100644 --- a/sfx2/inc/sfx2/navigat.hxx +++ b/sfx2/inc/sfx2/navigat.hxx @@ -41,7 +41,7 @@ public: SFX_DECL_CHILDWINDOW(SfxNavigatorWrapper); }; -class SfxNavigator : public SfxDockingWindow +class SFX2_DLLPUBLIC SfxNavigator : public SfxDockingWindow { SfxChildWindow* pWrapper; diff --git a/sfx2/inc/sfx2/sfx.hrc b/sfx2/inc/sfx2/sfx.hrc index 05979e1c2ecc..65d1d7a6933a 100644 --- a/sfx2/inc/sfx2/sfx.hrc +++ b/sfx2/inc/sfx2/sfx.hrc @@ -126,6 +126,7 @@ #define RID_SFX_SFXLOCAL_START (RID_SFX_START + 3082) #define RID_SFX_VIEW_START (RID_SFX_START + 4096) +#define RID_SFX_SIDEBAR_START (RID_SFX_START + 4150) #define RID_SFX_NODES_START (RID_SFX_START + 4500) #define RID_CNT_START2 (RID_SFX_NODES_START) #define RID_SFX_CHAOSDOC_START (RID_SFX_START + 5120) diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc index 62dae9f469ca..2b5e8044a706 100644 --- a/sfx2/inc/sfx2/sfxsids.hrc +++ b/sfx2/inc/sfx2/sfxsids.hrc @@ -853,6 +853,7 @@ #define SID_ZOOM (SID_SVX_START + 289) #define SID_SEARCH_ITEM (SID_SVX_START + 291) #define SID_ATTR_CHAR_FONTWIDTH (SID_SVX_START + 303) +#define SID_SIDEBAR (SID_SVX_START + 336) #define SID_HYPERLINK_INSERT (SID_SVX_START + 360) #define SID_HYPERLINK_GETLINK (SID_SVX_START + 361) #define SID_HYPERLINK_SETLINK (SID_SVX_START + 362) diff --git a/sfx2/inc/sfx2/shell.hxx b/sfx2/inc/sfx2/shell.hxx index 90f6db0d2e28..f1b06fdf2c57 100644 --- a/sfx2/inc/sfx2/shell.hxx +++ b/sfx2/inc/sfx2/shell.hxx @@ -254,6 +254,8 @@ public: virtual SfxItemSet* CreateItemSet( sal_uInt16 nId ); virtual void ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ); + void SetContextName (const ::rtl::OUString& rsContextName); + #ifndef _SFXSH_HXX SAL_DLLPRIVATE bool CanExecuteSlot_Impl( const SfxSlot &rSlot ); SAL_DLLPRIVATE void DoActivate_Impl( SfxViewFrame *pFrame, sal_Bool bMDI); diff --git a/sfx2/inc/sfx2/sidebar/ContextChangeBroadcaster.hxx b/sfx2/inc/sfx2/sidebar/ContextChangeBroadcaster.hxx new file mode 100644 index 000000000000..c103ece0d099 --- /dev/null +++ b/sfx2/inc/sfx2/sidebar/ContextChangeBroadcaster.hxx @@ -0,0 +1,62 @@ +/************************************************************** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef SFX_SIDEBAR_CONTEXT_CHANGE_BROADCASTER_HXX +#define SFX_SIDEBAR_CONTEXT_CHANGE_BROADCASTER_HXX + +#include <com/sun/star/frame/XFrame.hpp> + +namespace css = ::com::sun::star; +namespace cssu = ::com::sun::star::uno; + +namespace sfx2 { namespace sidebar { + + +/** This class is a helper for broadcasting context changes that are + tied to shells being activated or deactivated. +*/ +class ContextChangeBroadcaster +{ +public: + ContextChangeBroadcaster (void); + ~ContextChangeBroadcaster (void); + + void Initialize (const ::rtl::OUString& rsContextName); + + void Activate (const cssu::Reference<css::frame::XFrame>& rxFrame); + void Deactivate (const cssu::Reference<css::frame::XFrame>& rxFrame); + +private: + rtl::OUString msContextName; + bool mbIsContextActive; + + void BroadcastContextChange ( + const cssu::Reference<css::frame::XFrame>& rxFrame, + const ::rtl::OUString& rsModuleName, + const ::rtl::OUString& rsContextName); + ::rtl::OUString GetModuleName ( + const cssu::Reference<css::frame::XFrame>& rxFrame); +}; + + +} } // end of namespace ::sd::sidebar + +#endif diff --git a/sfx2/inc/sfx2/sidebar/ControlFactory.hxx b/sfx2/inc/sfx2/sidebar/ControlFactory.hxx new file mode 100644 index 000000000000..f873889f9984 --- /dev/null +++ b/sfx2/inc/sfx2/sidebar/ControlFactory.hxx @@ -0,0 +1,50 @@ +/************************************************************** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef SFX_SIDEBAR_CONTROL_FACTORY_HXX +#define SFX_SIDEBAR_CONTROL_FACTORY_HXX + +#include <sfx2/dllapi.h> +#include <vcl/button.hxx> + +class ToolBox; + +namespace sfx2 { namespace sidebar { + +class ToolBoxBackground; + + +class SFX2_DLLPUBLIC ControlFactory +{ +public: + static CheckBox* CreateMenuButton (Window* pParentWindow); + static ImageRadioButton* CreateTabItem (Window* pParentWindow); + static ToolBox* CreateToolBox (Window* pParentWindow, const ResId& rResId); + static Window* CreateToolBoxBackground (Window* pParentWindow); + static ImageRadioButton* CreateCustomImageRadionButton( + Window* pParentWindow, + const ResId& rResId ); +}; + + +} } // end of namespace sfx2::sidebar + +#endif diff --git a/sfx2/inc/sfx2/sidebar/ControllerItem.hxx b/sfx2/inc/sfx2/sidebar/ControllerItem.hxx new file mode 100644 index 000000000000..c9bdbeaee71b --- /dev/null +++ b/sfx2/inc/sfx2/sidebar/ControllerItem.hxx @@ -0,0 +1,58 @@ +/************************************************************** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef SVX_SIDEBAR_CONTROLLER_ITEM_HXX +#define SVX_SIDEBAR_CONTROLLER_ITEM_HXX + +#include <sfx2/ctrlitem.hxx> + +#include <boost/function.hpp> + + +namespace sfx2 { namespace sidebar { + +class SFX2_DLLPUBLIC ControllerItem + : public SfxControllerItem +{ +public: + class ItemUpdateReceiverInterface + { + public: + virtual void NotifyItemUpdate( + const sal_uInt16 nSId, + const SfxItemState eState, + const SfxPoolItem* pState) = 0; + }; + ControllerItem ( + const sal_uInt16 nId, + SfxBindings &rBindings, + ItemUpdateReceiverInterface& rItemUpdateReceiver); + virtual ~ControllerItem (void); + + virtual void StateChanged (sal_uInt16 nSId, SfxItemState eState, const SfxPoolItem* pState); + +private: + ItemUpdateReceiverInterface& mrItemUpdateReceiver; +}; + +} } // end of namespace sfx2::sidebar + +#endif diff --git a/sfx2/inc/sfx2/sidebar/EnumContext.hxx b/sfx2/inc/sfx2/sidebar/EnumContext.hxx new file mode 100644 index 000000000000..ad436d84d261 --- /dev/null +++ b/sfx2/inc/sfx2/sidebar/EnumContext.hxx @@ -0,0 +1,173 @@ +/************************************************************** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef SFX_SIDEBAR_ENUM_CONTEXT_HXX +#define SFX_SIDEBAR_ENUM_CONTEXT_HXX + +#include "sfx2/dllapi.h" + +#include <rtl/ustring.hxx> + +#include <vector> + + +namespace sfx2 { namespace sidebar { + +class SFX2_DLLPUBLIC EnumContext +{ +public: + enum Application + { + Application_Writer, + Application_WriterWeb, + Application_Calc, + Application_Draw, + Application_Impress, + + // For your convenience to avoid duplicate code in the common + // case that Draw and Impress use identical context configurations. + Application_DrawImpress, + + // Also for your convenience for either Writer or WriterWeb. + Application_WriterAndWeb, + + // Used only by deck or panel descriptors. Matches any + // application. + Application_Any, + + // Use this only in special circumstances. One might be the + // wish to disable a deck or panel during debugging. + Application_None, + + __LastApplicationEnum = Application_None + }; + enum Context + { + Context_3DObject, + Context_Annotation, + Context_Auditing, + Context_Cell, + Context_Chart, + Context_Draw, + Context_DrawPage, + Context_DrawText, + Context_EditCell, + Context_Form, + Context_Frame, + Context_Graphic, + Context_HandoutPage, + Context_MasterPage, + Context_Media, + Context_MultiObject, + Context_NotesPage, + Context_OLE, + Context_OutlineText, + Context_Pivot, + Context_SlidesorterPage, + Context_Table, + Context_Text, + Context_TextObject, + + // Default context of an application. Do we need this? + Context_Default, + + // Used only by deck or panel descriptors. Matches any context. + Context_Any, + + // Special context name that is only used when a deck would + // otherwise be empty. + Context_Empty, + + Context_Unknown, + + __LastContextEnum = Context_Unknown + }; + + EnumContext (void); + EnumContext ( + const Application eApplication, + const Context eContext); + EnumContext ( + const ::rtl::OUString& rsApplicationName, + const ::rtl::OUString& rsContextName); + + /** Return a number that encodes both the application and context + enums. + Use the CombinedEnumContext macro in switch() statements and comparisons. + */ + sal_Int32 GetCombinedContext(void) const; + + /** This variant of the GetCombinedContext() method treats some + application names as identical to each other. Replacements + made are: + Draw or Impress -> DrawImpress + Writer or WriterWeb -> WriterAndWeb + Use the Application_DrawImpress or Application_WriterAndWeb values in the CombinedEnumContext macro. + */ + sal_Int32 GetCombinedContext_DI(void) const; + + const ::rtl::OUString& GetApplicationName (void) const; + const ::rtl::OUString& GetContextName (void) const; + + bool operator == (const EnumContext aOther); + bool operator != (const EnumContext aOther); + + /** When two contexts are matched against each other then + application or context name may have the wildcard value 'any'. + In order to prefer matches without wildcards over matches with + wildcards we introduce a integer evaluation for matches. + */ + const static sal_Int32 NoMatch; + const static sal_Int32 OptimalMatch; + + /** Return the numeric value that describes how good the match + between two contexts is. + Smaller values represent better matches. + */ + sal_Int32 EvaluateMatch (const EnumContext& rOther) const; + + /** Return the best match against the given list of contexts. + */ + sal_Int32 EvaluateMatch (const ::std::vector<EnumContext>& rOthers) const; + + static Application GetApplicationEnum (const ::rtl::OUString& rsApplicationName); + static const ::rtl::OUString& GetApplicationName (const Application eApplication); + + static Context GetContextEnum (const ::rtl::OUString& rsContextName); + static const ::rtl::OUString& GetContextName (const Context eContext); + +private: + Application meApplication; + Context meContext; + + static void ProvideApplicationContainers (void); + static void ProvideContextContainers (void); + static void AddEntry (const ::rtl::OUString& rsName, const Application eApplication); + static void AddEntry (const ::rtl::OUString& rsName, const Context eContext); +}; + + +#define CombinedEnumContext(a,e) ((static_cast<sal_uInt16>(::sfx2::sidebar::EnumContext::a)<<16)\ + | static_cast<sal_uInt16>(::sfx2::sidebar::EnumContext::e)) + +} } // end of namespace sfx2::sidebar + +#endif diff --git a/sfx2/inc/sfx2/sidebar/IContextChangeReceiver.hxx b/sfx2/inc/sfx2/sidebar/IContextChangeReceiver.hxx new file mode 100644 index 000000000000..e495e65ecaff --- /dev/null +++ b/sfx2/inc/sfx2/sidebar/IContextChangeReceiver.hxx @@ -0,0 +1,40 @@ +/************************************************************** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef SFX_SIDEBAR_CONTEXT_CHANGE_RECEIVER_INTERFACE_HXX +#define SFX_SIDEBAR_CONTEXT_CHANGE_RECEIVER_INTERFACE_HXX + +#include "EnumContext.hxx" + + +namespace sfx2 { namespace sidebar { + + +class SFX2_DLLPUBLIC IContextChangeReceiver +{ +public: + virtual void HandleContextChange ( + const EnumContext aContext) = 0; +}; + +} } // end of namespace ::sd::sidebar + +#endif diff --git a/sfx2/inc/sfx2/sidebar/ILayoutableWindow.hxx b/sfx2/inc/sfx2/sidebar/ILayoutableWindow.hxx new file mode 100644 index 000000000000..22b0efc19fb8 --- /dev/null +++ b/sfx2/inc/sfx2/sidebar/ILayoutableWindow.hxx @@ -0,0 +1,47 @@ +/************************************************************** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef SFX_SIDEBAR_LAYOUTABLE_WINDOW_INTERFACE_HXX +#define SFX_SIDEBAR_LAYOUTABLE_WINDOW_INTERFACE_HXX + +#include <tools/gen.hxx> +#include <sal/types.h> + +#include <com/sun/star/ui/LayoutSize.hpp> + +class Window; + +namespace sfx2 { namespace sidebar { + + +class ILayoutableWindow +{ +public: + /** Return the preferred height with the constraint, that the + window will be set to the given width. + */ + virtual ::com::sun::star::ui::LayoutSize GetHeightForWidth (const sal_Int32 nWidth) = 0; +}; + + +} } // end of namespace ::sd::sidebar + +#endif diff --git a/sfx2/inc/sfx2/sidebar/PopupContainer.hxx b/sfx2/inc/sfx2/sidebar/PopupContainer.hxx new file mode 100755 index 000000000000..2d3c240ba06e --- /dev/null +++ b/sfx2/inc/sfx2/sidebar/PopupContainer.hxx @@ -0,0 +1,41 @@ +/************************************************************** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef SFX_SIDEBAR_POPUP_CONTAINER_HXX +#define SFX_SIDEBAR_POPUP_CONTAINER_HXX + +#include "sfx2/dllapi.h" +#include <vcl/floatwin.hxx> + +namespace sfx2 { namespace sidebar { + +class SFX2_DLLPUBLIC PopupContainer : public FloatingWindow +{ +public: + PopupContainer (Window* pParent); + virtual ~PopupContainer (void); + + virtual long Notify (NotifyEvent& rNEvt); +}; + +} } // end of namespace sfx2::sidebar + +#endif diff --git a/sfx2/inc/sfx2/sidebar/SidebarChildWindow.hxx b/sfx2/inc/sfx2/sidebar/SidebarChildWindow.hxx new file mode 100644 index 000000000000..e825f3dfb6ef --- /dev/null +++ b/sfx2/inc/sfx2/sidebar/SidebarChildWindow.hxx @@ -0,0 +1,52 @@ +/************************************************************** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef SFX_SIDEBAR_CHILD_WINDOW_HXX +#define SFX_SIDEBAR_CHILD_WINDOW_HXX + +#include "sfx2/childwin.hxx" + + +namespace sfx2 { namespace sidebar { + +/** Outer container of the sidbar window. + + Has to be registered for every application via the + RegisterChildWindow() method from the RegisterControllers() method + of the applications DLL. +*/ +class SFX2_DLLPUBLIC SidebarChildWindow + : public SfxChildWindow +{ +public: + SidebarChildWindow( + Window* pParent, + sal_uInt16 nId, + SfxBindings* pBindings, + SfxChildWinInfo* pInfo); + + SFX_DECL_CHILDWINDOW(SidebarChildWindow); +}; + + +} } // end of namespace sfx2::sidebar + +#endif diff --git a/sfx2/inc/sfx2/sidebar/SidebarPanelBase.hxx b/sfx2/inc/sfx2/sidebar/SidebarPanelBase.hxx new file mode 100644 index 000000000000..9f894e08119e --- /dev/null +++ b/sfx2/inc/sfx2/sidebar/SidebarPanelBase.hxx @@ -0,0 +1,128 @@ +/************************************************************** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef SFX_SIDEBAR_PANEL_BASE_HXX +#define SFX_SIDEBAR_PANEL_BASE_HXX + +#include "EnumContext.hxx" + +#include <cppuhelper/compbase4.hxx> +#include <cppuhelper/basemutex.hxx> + +#include <com/sun/star/frame/XController.hpp> +#include <com/sun/star/ui/XContextChangeEventListener.hpp> +#include <com/sun/star/ui/XUIElement.hpp> +#include <com/sun/star/ui/XToolPanel.hpp> +#include <com/sun/star/ui/XSidebarPanel.hpp> + +#include <boost/noncopyable.hpp> +#include <boost/function.hpp> + + +namespace css = ::com::sun::star; +namespace cssu = ::com::sun::star::uno; + + +class Window; + +namespace sfx2 { namespace sidebar { + +namespace +{ + typedef ::cppu::WeakComponentImplHelper4 < + css::ui::XContextChangeEventListener, + css::ui::XUIElement, + css::ui::XToolPanel, + css::ui::XSidebarPanel + > SidebarPanelBaseInterfaceBase; +} + +/** Base class for sidebar panels that provides some convenience + functionality. +*/ +class SFX2_DLLPUBLIC SidebarPanelBase + : private ::boost::noncopyable, + private ::cppu::BaseMutex, + public SidebarPanelBaseInterfaceBase +{ +public: + static cssu::Reference<css::ui::XUIElement> Create ( + const ::rtl::OUString& rsResourceURL, + const cssu::Reference<css::frame::XFrame>& rxFrame, + Window* mpWindow, + const css::ui::LayoutSize& rLayoutSize); + + // XContextChangeEventListener + virtual void SAL_CALL notifyContextChangeEvent ( + const css::ui::ContextChangeEventObject& rEvent) + throw (cssu::RuntimeException); + + // XEventListener + virtual void SAL_CALL disposing ( + const css::lang::EventObject& rEvent) + throw (cssu::RuntimeException); + + // XUIElement + virtual cssu::Reference<css::frame::XFrame> SAL_CALL getFrame (void) + throw(cssu::RuntimeException); + virtual ::rtl::OUString SAL_CALL getResourceURL (void) + throw(cssu::RuntimeException); + virtual sal_Int16 SAL_CALL getType (void) + throw(cssu::RuntimeException); + virtual cssu::Reference<cssu::XInterface> SAL_CALL getRealInterface (void) + throw(cssu::RuntimeException); + + // XToolPanel + virtual cssu::Reference<css::accessibility::XAccessible> SAL_CALL createAccessible ( + const cssu::Reference<css::accessibility::XAccessible>& rxParentAccessible) + throw(cssu::RuntimeException); + virtual cssu::Reference<css::awt::XWindow> SAL_CALL getWindow (void) + throw(cssu::RuntimeException); + + // XSidebarPanel + virtual css::ui::LayoutSize SAL_CALL getHeightForWidth (sal_Int32 nWidth) + throw(cssu::RuntimeException); + +protected: + cssu::Reference<css::frame::XFrame> mxFrame; + + SidebarPanelBase ( + const ::rtl::OUString& rsResourceURL, + const cssu::Reference<css::frame::XFrame>& rxFrame, + Window* pWindow, + const css::ui::LayoutSize& rLayoutSize); + virtual ~SidebarPanelBase (void); + + virtual void SAL_CALL disposing (void) + throw (cssu::RuntimeException); + + void SetControl (::Window* pControl); + ::Window* GetControl (void) const; + +private: + Window* mpControl; + const ::rtl::OUString msResourceURL; + const css::ui::LayoutSize maLayoutSize; +}; + +} } // end of namespace sfx2::sidebar + +#endif diff --git a/sfx2/inc/sfx2/sidebar/Theme.hxx b/sfx2/inc/sfx2/sidebar/Theme.hxx new file mode 100644 index 000000000000..03952229e31d --- /dev/null +++ b/sfx2/inc/sfx2/sidebar/Theme.hxx @@ -0,0 +1,282 @@ +/************************************************************** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + *************************************************************/ + +#ifndef SFX_SIDEBAR_THEME_HXX +#define SFX_SIDEBAR_THEME_HXX + +#include "sfx2/dllapi.h" + +#include <tools/color.hxx> +#include <vcl/image.hxx> +#include <cppuhelper/compbase2.hxx> +#include <cppuhelper/basemutex.hxx> +#include <tools/gen.hxx> +#include <rtl/ref.hxx> +#include <vcl/wall.hxx> + +#include <com/sun/star/beans/XPropertySet.hpp> + +#include <hash_map> +#include <map> +#include <boost/optional.hpp> + + +class SvBorder; + +namespace css = ::com::sun::star; +namespace cssu = ::com::sun::star::uno; + + +namespace sfx2 { namespace sidebar { + + +namespace +{ + typedef ::cppu::WeakComponentImplHelper2 < + css::beans::XPropertySet, + css::beans::XPropertySetInfo + > ThemeInterfaceBase; +} + +class Paint; + +/** Simple collection of colors, gradients, fonts that define the + look of the sidebar and its controls. +*/ +class SFX2_DLLPUBLIC Theme + : private ::boost::noncopyable, + private ::cppu::BaseMutex, + public ThemeInterfaceBase +{ +public: + enum ThemeItem + { + __Begin, + __Pre_Image = __Begin, + + __AnyItem = __Pre_Image, + + Image_Grip, + Image_Expand, + Image_Collapse, + Image_TabBarMenu, + Image_PanelMenu, + Image_ToolBoxItemSeparator, + Image_Closer, + + __Image_Color, + + Color_DeckTitleFont, + Color_PanelTitleFont, + Color_TabMenuSeparator, + Color_TabItemBorder, + Color_DropDownBorder, + Color_Highlight, + Color_HighlightText, + + __Color_Paint, + + Paint_DeckBackground, + Paint_DeckTitleBarBackground, + Paint_PanelBackground, + Paint_PanelTitleBarBackground, + Paint_TabBarBackground, + Paint_TabItemBackgroundNormal, + Paint_TabItemBackgroundHighlight, + Paint_HorizontalBorder, + Paint_VerticalBorder, + Paint_ToolBoxBackground, + Paint_ToolBoxBorderTopLeft, + Paint_ToolBoxBorderCenterCorners, + Paint_ToolBoxBorderBottomRight, + Paint_DropDownBackground, + + __Paint_Int, + + Int_DeckTitleBarHeight, + Int_DeckBorderSize, + Int_DeckSeparatorHeight, + Int_PanelTitleBarHeight, + Int_TabMenuPadding, + Int_TabMenuSeparatorPadding, + Int_TabItemWidth, + Int_TabItemHeight, + Int_DeckLeftPadding, + Int_DeckTopPadding, + Int_DeckRightPadding, + Int_DeckBottomPadding, + Int_TabBarLeftPadding, + Int_TabBarTopPadding, + Int_TabBarRightPadding, + Int_TabBarBottomPadding, + Int_ButtonCornerRadius, + + __Int_Bool, + + Bool_UseSymphonyIcons, + Bool_UseSystemColors, + Bool_UseToolBoxItemSeparator, + Bool_IsHighContrastModeActive, + + __Bool_Rect, + + Rect_ToolBoxPadding, + Rect_ToolBoxBorder, + + __Post_Rect, + __End=__Post_Rect + }; + + static Image GetImage (const ThemeItem eItem); + static Color GetColor (const ThemeItem eItem); + static const Paint& GetPaint (const ThemeItem eItem); + static const Wallpaper GetWallpaper (const ThemeItem eItem); + static sal_Int32 GetInteger (const ThemeItem eItem); + static bool GetBoolean (const ThemeItem eItem); + static Rectangle GetRectangle (const ThemeItem eItem); + + static bool IsHighContrastMode (void); + + static void HandleDataChange (void); + + Theme (void); + virtual ~Theme (void); + + virtual void SAL_CALL disposing (void); + + static cssu::Reference<css::beans::XPropertySet> GetPropertySet (void); + + // beans::XPropertySet + virtual cssu::Reference<css::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo (void) + throw(cssu::RuntimeException); + virtual void SAL_CALL setPropertyValue ( + const ::rtl::OUString& rsPropertyName, + const cssu::Any& rValue) + throw(cssu::RuntimeException); + virtual cssu::Any SAL_CALL getPropertyValue ( + const ::rtl::OUString& rsPropertyName) + throw(css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, + cssu::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( + const ::rtl::OUString& rsPropertyName, + const cssu::Reference<css::beans::XPropertyChangeListener>& rxListener) + throw(css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, + cssu::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( + const ::rtl::OUString& rsPropertyName, + const cssu::Reference<css::beans::XPropertyChangeListener>& rxListener) + throw(css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, + cssu::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( + const ::rtl::OUString& rsPropertyName, + const cssu::Reference<css::beans::XVetoableChangeListener>& rxListener) + throw(css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, + cssu::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( + const ::rtl::OUString& rsPropertyName, + const cssu::Reference<css::beans::XVetoableChangeListener>& rxListener) + throw(css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, + cssu::RuntimeException); + + // beans::XPropertySetInfo + virtual cssu::Sequence<css::beans::Property> SAL_CALL getProperties (void) + throw(cssu::RuntimeException); + virtual css::beans::Property SAL_CALL getPropertyByName (const ::rtl::OUString& rsName) + throw(css::beans::UnknownPropertyException, + cssu::RuntimeException); + virtual sal_Bool SAL_CALL hasPropertyByName (const ::rtl::OUString& rsName) + throw(cssu::RuntimeException); + +private: + static ::rtl::Reference<Theme> mpInstance; + static Theme& GetCurrentTheme (void); + + ::std::vector<Image> maImages; + ::std::vector<Color> maColors; + ::std::vector<Paint> maPaints; + ::std::vector<sal_Int32> maIntegers; + ::std::vector<bool> maBooleans; + ::std::vector<Rectangle> maRectangles; + bool mbIsHighContrastMode; + bool mbIsHighContrastModeSetManually; + + typedef ::std::hash_map<rtl::OUString,ThemeItem, rtl::OUStringHash> PropertyNameToIdMap; + PropertyNameToIdMap maPropertyNameToIdMap; + typedef ::std::vector<rtl::OUString> PropertyIdToNameMap; + PropertyIdToNameMap maPropertyIdToNameMap; + typedef ::std::vector<cssu::Any> RawValueContainer; + RawValueContainer maRawValues; + + typedef ::std::vector<cssu::Reference<css::beans::XPropertyChangeListener> > ChangeListenerContainer; + typedef ::std::map<ThemeItem,ChangeListenerContainer> ChangeListeners; + ChangeListeners maChangeListeners; + typedef ::std::vector<cssu::Reference<css::beans::XVetoableChangeListener> > VetoableListenerContainer; + typedef ::std::map<ThemeItem,VetoableListenerContainer> VetoableListeners; + VetoableListeners maVetoableListeners; + + enum PropertyType + { + PT_Image, + PT_Color, + PT_Paint, + PT_Integer, + PT_Boolean, + PT_Rectangle, + PT_Invalid + }; + + void SetupPropertyMaps (void); + void InitializeTheme (void); + void UpdateTheme (void); + static PropertyType GetPropertyType (const ThemeItem eItem); + static cssu::Type GetCppuType (const PropertyType eType); + static sal_Int32 GetIndex ( + const ThemeItem eItem, + const PropertyType eType); + + VetoableListenerContainer* GetVetoableListeners ( + const ThemeItem eItem, + const bool bCreate); + ChangeListenerContainer* GetChangeListeners ( + const ThemeItem eItem, + const bool bCreate); + bool DoVetoableListenersVeto ( + const VetoableListenerContainer* pListeners, + const css::beans::PropertyChangeEvent& rEvent) const; + void BroadcastPropertyChange ( + const ChangeListenerContainer* pListeners, + const css::beans::PropertyChangeEvent& rEvent) const; + void ProcessNewValue ( + const cssu::Any& rValue, + const ThemeItem eItem, + const PropertyType eType); +}; + + + +} } // end of namespace sfx2::sidebar + +#endif diff --git a/sfx2/inc/sfx2/sidebar/propertypanel.hrc b/sfx2/inc/sfx2/sidebar/propertypanel.hrc new file mode 100644 index 000000000000..21e1736b4ffc --- /dev/null +++ b/sfx2/inc/sfx2/sidebar/propertypanel.hrc @@ -0,0 +1,132 @@ +/************************************************************************ + * + * Licensed Materials - Property of IBM. + * (C) Copyright IBM Corporation 2003, 2012. All Rights Reserved. + * U.S. Government Users Restricted Rights: + * Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. + * + ************************************************************************/ + +#ifndef _SFX_PROPERTYPANEL_HRC +#define _SFX_PROPERTYPANEL_HRC + +#include <sfx2/sfx.hrc> + +//section page RID +#define RC_PROPERTYPANEL_START RID_SFX_PROPERTYPANEL_START +#define DLG_PROPERTY_DOCKING_WINDOW ( RC_PROPERTYPANEL_START + 0 ) +#define BMP_PROPERTYPANEL_EXPAND ( RC_PROPERTYPANEL_START + 1 ) +#define BMP_PROPERTYPANEL_COLLAPSE ( RC_PROPERTYPANEL_START + 2 ) +#define BMP_PROPERTYPANEL_EXPAND_HC ( RC_PROPERTYPANEL_START + 3 ) +#define BMP_PROPERTYPANEL_COLLAPSE_HC ( RC_PROPERTYPANEL_START + 4 ) +#define BMP_PROPERTYPANEL_MOREPROPERTY ( RC_PROPERTYPANEL_START + 5 ) +#define BMP_PROPERTYPANEL_MOREPROPERTY_HC ( RC_PROPERTYPANEL_START + 6 ) +#define FT_PROPERTYPANEL_NOTSUPPORT_DESC ( RC_PROPERTYPANEL_START + 7 ) + +#define RID_PROPERTYPANEL_TEXTPAGE_TITLEBAR ( RC_PROPERTYPANEL_START + 8 ) +#define RID_PROPERTYPANEL_PARAGRAPHPAGE_TITLEBAR ( RC_PROPERTYPANEL_START + 9 ) +#define RID_PROPERTYPANEL_AREAPAGE_TITLEBAR ( RC_PROPERTYPANEL_START + 10 ) +#define RID_PROPERTYPANEL_TBLDESIGNPAGE_TITLEBAR ( RC_PROPERTYPANEL_START + 11 ) +#define RID_PROPERTYPANEL_LINEPAGE_TITLEBAR ( RC_PROPERTYPANEL_START + 12 ) +#define RID_PROPERTYPANEL_POSIZEPAGE_TITLEBAR ( RC_PROPERTYPANEL_START + 13 ) +#define RID_PROPERTYPANEL_GRAPHICPAGE_TITLEBAR ( RC_PROPERTYPANEL_START + 14 ) +#define RID_PROPERTYPANEL_CELLAPPEARPAGE_TITLEBAR ( RC_PROPERTYPANEL_START + 15 ) +#define RID_PROPERTYPANEL_SWPAGE_PAGE_TITLEBAR (RC_PROPERTYPANEL_START + 16) +#define RID_PROPERTYPANEL_SWOBJWRAP_PAGE_TITLEBAR (RC_PROPERTYPANEL_START + 17) +#define RID_PROPERTYPANEL_SCCELL_PAGE_TITLEBAR (RC_PROPERTYPANEL_START + 18) +#define RID_PROPERTYPANEL_SCALIGNMENT_PAGE_TITLEBAR (RC_PROPERTYPANEL_START + 19) +#define RID_PROPERTYPANEL_SD_PAGELAYOUT_TITLEBAR (RC_PROPERTYPANEL_START+20) +#define RID_PROPERTYPANEL_SD_PAGEPROPERTY_TITLEBAR (RC_PROPERTYPANEL_START+21) +#define RID_PROPERTYPANEL_SD_TABLEDESIGN_TITLEBAR (RC_PROPERTYPANEL_START+22) +#define RID_PROPERTYPANEL_NUMFORMAT_PAGE_TITLEBAR (RC_PROPERTYPANEL_START+23) + +#define RID_PANELDOCK_WINDOW ( RC_PROPERTYPANEL_START + 24 ) +#define STR_TITLE_DISCRIPTION ( RC_PROPERTYPANEL_START + 25 ) // + +#ifndef STD_MASKCOLOR +#define STD_MASKCOLOR Color { Red = 0xFF00; Green = 0x0000; Blue = 0xFF00; } +#endif + +//unit pixel +//panel common +#define PROPERTYPAGE_WIDTH 109 + +//about titlebar + +#define FI_EXPANSION_INDICATOR 1 +#define FT_TITLE 2 +#define STR_MOREPROPERTY_QUICKHELP 3 + +#define TITLEBAR_WIDTH PROPERTYPAGE_WIDTH +#define TITLEBAR_HEIGHT 13 + +#define TITLEBAR_MARGIN_HORIZONTAL 3 +#define TITLEBAR_CONTROL_SPACING_HORIZONTAL 3 + +#define FI_EXPANSION_INDICATOR_WIDTH 6 +#define FI_EXPANSION_INDICATOR_HEIGTH 6 +#define FI_EXPANSION_INDICATOR_X TITLEBAR_MARGIN_HORIZONTAL +#define FI_EXPANSION_INDICATOR_Y (TITLEBAR_HEIGHT - FI_EXPANSION_INDICATOR_HEIGTH)/2 + +#define FT_TITLE_WIDTH 85 +#define FT_TITLE_HEIGHT 10 +#define FT_TITLE_X FI_EXPANSION_INDICATOR_X + FI_EXPANSION_INDICATOR_WIDTH + TITLEBAR_CONTROL_SPACING_HORIZONTAL +#define FT_TITLE_Y (TITLEBAR_HEIGHT - FT_TITLE_HEIGHT)/2 + 1 + + +//about section page +#define SECTIONPAGE_MARGIN_VERTICAL 12 +#define SECTIONPAGE_MARGIN_VERTICAL_TOP 1 +#define SECTIONPAGE_MARGIN_VERTICAL_BOT 5 +#define SECTIONPAGE_MARGIN_HORIZONTAL 3 +#define CONTROL_SPACING_VERTICAL 5 +#define CONTROL_SPACING_HORIZONTAL 3 +#define TEXT_CONTROL_SPACING_VERTICAL 2 + +#define TEXT_HEIGHT 8 +#define CBOX_HEIGHT 12 +#define MBOX_HEIGHT 12 + +#define TBX_OUT_BORDER_OFFSET_X 2 +#define TBX_OUT_BORDER_OFFSET_Y 1 + +//for 16*16 pixel bmp +#define TOOLBOX_ITEM_HEIGHT 15 +#define TOOLBOX_ITEM_WIDTH 13 +#define TOOLBOX_ITEM_DD_WIDTH 19 + +//for 24*16 pixel bmp +#define TOOLBOX_24_16_ITEM_HEIGHT 15 +#define TOOLBOX_24_16_ITEM_DD_WIDTH 23 + +//for 24*24 pixel bmp +#define TOOLBOX_24_24_ITEM_HEIGHT 18 +#define TOOLBOX_24_24_ITEM_DD_WIDTH 24 + +//about popup panel +#define POPUPPANEL_MARGIN_VERTICAL 7 +#define POPUPPANEL_MARGIN_HORIZONTAL 7 + +//for 42*42 pixel bmp +#define TOOLBOX_42_42_ITEM_HEIGHT 30 +#define TOOLBOX_42_42_ITEM_DD_WIDTH 27 +#define TB_BORDER 2 + +#define POPUPPANEL_SEP_VERTICAL_1 10 +#define POPUPPANEL_SEP_VERTICAL_2 6 +#define POPUPPANEL_SEP_HEIGHT 1 + +#define POPUP_BORDER_WIDTH 2 +#define POPUP_BORDER_HEIGHT 3 +#define OFFSET_X 1 +#define OFFSET_Y 1 + +#define POPUP_TOP_GRADIENT_HEIGHT 4 +#define POPUP_BOT_GRADIENT_HEIGHT 6 + +#define POPUP_COLOR_PICKER_WIDTH 97 +#define POPUP_COLOR_PICKER_HEIGHT 114 +//new +#define POPUPPANEL_MARGIN_SMALL 2 +#define POPUPPANEL_MARGIN_LARGE 5 +#endif diff --git a/sfx2/inc/sfx2/templdlg.hxx b/sfx2/inc/sfx2/templdlg.hxx index 58388f82e4f0..e86e458302f1 100644 --- a/sfx2/inc/sfx2/templdlg.hxx +++ b/sfx2/inc/sfx2/templdlg.hxx @@ -25,7 +25,7 @@ #include "sal/config.h" #include "sfx2/dllapi.h" - +#include <vcl/ctrl.hxx> #include <rsc/rscsfx.hxx> #include <sfx2/dockwin.hxx> @@ -94,5 +94,29 @@ public: void SetParagraphFamily(); }; +// class SfxTemplatePanelControl ----------------------------------------- + +class SFX2_DLLPUBLIC SfxTemplatePanelControl : public DockingWindow +{ +public: + SfxTemplatePanelControl (SfxBindings* pBindings, Window* pParentWindow); + ~SfxTemplatePanelControl (void); + + virtual void Update(); + virtual void DataChanged( const DataChangedEvent& _rDCEvt ); + virtual void Resize(); + virtual SfxChildAlignment CheckAlignment( SfxChildAlignment, SfxChildAlignment ); + virtual void StateChanged( StateChangedType nStateChange ); + virtual void FreeResource (void); + + ISfxTemplateCommon* GetISfxTemplateCommon(); + void SetParagraphFamily(); + +private: + SfxTemplateDialog_Impl* pImpl; + SfxBindings* mpBindings; +}; + + #endif |