122de8995SAndre Fischer /************************************************************** 222de8995SAndre Fischer * 322de8995SAndre Fischer * Licensed to the Apache Software Foundation (ASF) under one 422de8995SAndre Fischer * or more contributor license agreements. See the NOTICE file 522de8995SAndre Fischer * distributed with this work for additional information 622de8995SAndre Fischer * regarding copyright ownership. The ASF licenses this file 722de8995SAndre Fischer * to you under the Apache License, Version 2.0 (the 822de8995SAndre Fischer * "License"); you may not use this file except in compliance 922de8995SAndre Fischer * with the License. You may obtain a copy of the License at 1022de8995SAndre Fischer * 1122de8995SAndre Fischer * http://www.apache.org/licenses/LICENSE-2.0 1222de8995SAndre Fischer * 1322de8995SAndre Fischer * Unless required by applicable law or agreed to in writing, 1422de8995SAndre Fischer * software distributed under the License is distributed on an 1522de8995SAndre Fischer * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 1622de8995SAndre Fischer * KIND, either express or implied. See the License for the 1722de8995SAndre Fischer * specific language governing permissions and limitations 1822de8995SAndre Fischer * under the License. 1922de8995SAndre Fischer * 2022de8995SAndre Fischer *************************************************************/ 2122de8995SAndre Fischer 2222de8995SAndre Fischer #ifndef SFX_SIDEBAR_DECK_HXX 2322de8995SAndre Fischer #define SFX_SIDEBAR_DECK_HXX 2422de8995SAndre Fischer 25f120fe41SAndre Fischer #include "Panel.hxx" 26f120fe41SAndre Fischer 27f120fe41SAndre Fischer #include <vcl/window.hxx> 28f120fe41SAndre Fischer #include <vcl/image.hxx> 297a32b0c8SAndre Fischer #include <com/sun/star/ui/LayoutSize.hpp> 3022de8995SAndre Fischer 317a32b0c8SAndre Fischer #include <boost/function.hpp> 327a32b0c8SAndre Fischer #include <boost/scoped_ptr.hpp> 337a32b0c8SAndre Fischer 347a32b0c8SAndre Fischer class ScrollBar; 357a32b0c8SAndre Fischer 367a32b0c8SAndre Fischer namespace css = ::com::sun::star; 3722de8995SAndre Fischer 38ff12d537SAndre Fischer namespace sfx2 { namespace sidebar { 3922de8995SAndre Fischer 4022de8995SAndre Fischer class DeckDescriptor; 417a32b0c8SAndre Fischer class DeckTitleBar; 4222de8995SAndre Fischer 4322de8995SAndre Fischer 4422de8995SAndre Fischer /** This is the parent window of the panels. 4522de8995SAndre Fischer It displays the deck title. 4622de8995SAndre Fischer */ 4722de8995SAndre Fischer class Deck 4822de8995SAndre Fischer : public Window 4922de8995SAndre Fischer { 5022de8995SAndre Fischer public: 5122de8995SAndre Fischer Deck ( 5222de8995SAndre Fischer const DeckDescriptor& rDeckDescriptor, 537a32b0c8SAndre Fischer Window* pParentWindow, 547a32b0c8SAndre Fischer const ::boost::function<void(void)>& rCloserAction); 5522de8995SAndre Fischer virtual ~Deck (void); 5622de8995SAndre Fischer 57ff12d537SAndre Fischer void Dispose (void); 58ff12d537SAndre Fischer 5922de8995SAndre Fischer const ::rtl::OUString& GetId (void) const; 607a32b0c8SAndre Fischer DeckTitleBar* GetTitleBar (void) const; 61ff12d537SAndre Fischer Rectangle GetContentArea (void) const; 62ff12d537SAndre Fischer ::rtl::OUString GetIconURL (const bool bIsHighContrastModeActive) const; 63f120fe41SAndre Fischer void SetPanels (const SharedPanelContainer& rPanels); 64f120fe41SAndre Fischer const SharedPanelContainer& GetPanels (void) const; 65ff12d537SAndre Fischer void RequestLayout (void); 667a32b0c8SAndre Fischer ::Window* GetPanelParentWindow (void); 6752d13b84SAndre Fischer 6852d13b84SAndre Fischer /** Try to make the panel completely visible. 6952d13b84SAndre Fischer When the whole panel does not fit then make its top visible 7052d13b84SAndre Fischer and it off at the bottom. 7152d13b84SAndre Fischer */ 7252d13b84SAndre Fischer void ShowPanel (const Panel& rPanel); 7352d13b84SAndre Fischer 7422de8995SAndre Fischer virtual void Paint (const Rectangle& rUpdateArea); 75b9e67834SAndre Fischer virtual void DataChanged (const DataChangedEvent& rEvent); 763fac691dSAndre Fischer virtual long Notify (NotifyEvent& rEvent); 7722de8995SAndre Fischer 787a32b0c8SAndre Fischer void PrintWindowTree (void); 797a32b0c8SAndre Fischer void PrintWindowTree (const ::std::vector<Panel*>& rPanels); 807a32b0c8SAndre Fischer static void PrintWindowSubTree (Window* pRoot, int nIndentation); 817a32b0c8SAndre Fischer 827a32b0c8SAndre Fischer class ScrollContainerWindow : public Window 837a32b0c8SAndre Fischer { 847a32b0c8SAndre Fischer public: 857a32b0c8SAndre Fischer ScrollContainerWindow (Window* pParentWindow); 867a32b0c8SAndre Fischer virtual ~ScrollContainerWindow (void); 877a32b0c8SAndre Fischer virtual void Paint (const Rectangle& rUpdateArea); 887a32b0c8SAndre Fischer void SetSeparators (const ::std::vector<sal_Int32>& rSeparators); 897a32b0c8SAndre Fischer private: 907a32b0c8SAndre Fischer ::std::vector<sal_Int32> maSeparators; 917a32b0c8SAndre Fischer }; 927a32b0c8SAndre Fischer 9322de8995SAndre Fischer private: 9422de8995SAndre Fischer const ::rtl::OUString msTitle; 9522de8995SAndre Fischer const ::rtl::OUString msId; 96ff12d537SAndre Fischer Image maIcon; 97ff12d537SAndre Fischer const ::rtl::OUString msIconURL; 98ff12d537SAndre Fischer const ::rtl::OUString msHighContrastIconURL; 99f120fe41SAndre Fischer SharedPanelContainer maPanels; 1007a32b0c8SAndre Fischer ::boost::scoped_ptr<DeckTitleBar> mpTitleBar; 1017a32b0c8SAndre Fischer ::boost::scoped_ptr<Window> mpScrollClipWindow; 1027a32b0c8SAndre Fischer ::boost::scoped_ptr<ScrollContainerWindow> mpScrollContainer; 1037a32b0c8SAndre Fischer ::boost::scoped_ptr<Window> mpFiller; 1047a32b0c8SAndre Fischer ::boost::scoped_ptr<ScrollBar> mpVerticalScrollBar; 105ff12d537SAndre Fischer 1067a32b0c8SAndre Fischer DECL_LINK(HandleVerticalScrollBarChange,void*); 107*a1fa6b52SAndre Fischer bool ProcessWheelEvent ( 108*a1fa6b52SAndre Fischer CommandEvent* pCommandEvent, 109*a1fa6b52SAndre Fischer NotifyEvent& rEvent); 11022de8995SAndre Fischer }; 11122de8995SAndre Fischer 11222de8995SAndre Fischer 113ff12d537SAndre Fischer } } // end of namespace sfx2::sidebar 11422de8995SAndre Fischer 11522de8995SAndre Fischer #endif 116