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 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 #ifndef SFX_SIDEBAR_DECK_HXX 23 #define SFX_SIDEBAR_DECK_HXX 24 25 #include "vcl/window.hxx" 26 27 28 namespace sfx2 { namespace sidebar { 29 30 class DeckDescriptor; 31 class Panel; 32 class TitleBar; 33 34 35 /** This is the parent window of the panels. 36 It displays the deck title. 37 */ 38 class Deck 39 : public Window 40 { 41 public: 42 Deck ( 43 const DeckDescriptor& rDeckDescriptor, 44 Window* pParentWindow); 45 virtual ~Deck (void); 46 47 void Dispose (void); 48 49 const ::rtl::OUString& GetId (void) const; 50 TitleBar* GetTitleBar (void) const; 51 Rectangle GetContentArea (void) const; 52 ::rtl::OUString GetIconURL (const bool bIsHighContrastModeActive) const; 53 void SetPanels (const ::std::vector<Panel*>& rPanels); 54 void RequestLayout (void); 55 56 virtual void Paint (const Rectangle& rUpdateArea); 57 virtual void DataChanged (const DataChangedEvent& rEvent); 58 59 private: 60 const ::rtl::OUString msTitle; 61 const ::rtl::OUString msId; 62 TitleBar* mpTitleBar; 63 Image maIcon; 64 const ::rtl::OUString msIconURL; 65 const ::rtl::OUString msHighContrastIconURL; 66 ::std::vector<Panel*> maPanels; 67 ::std::vector<sal_Int32> maSeparators; 68 Window* mpFiller; 69 70 void LayoutSinglePanel (void); 71 void LayoutMultiplePanels (void); 72 Rectangle PlaceDeckTitle ( 73 TitleBar* pDeckTitleBar, 74 const Rectangle& rAvailableSpace); 75 void ShowFiller (const Rectangle& rBox); 76 void HideFiller (void); 77 }; 78 79 80 } } // end of namespace sfx2::sidebar 81 82 #endif 83