xref: /aoo42x/main/sfx2/source/sidebar/Deck.hxx (revision 4e21436d)
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);
6722de8995SAndre Fischer 
6822de8995SAndre Fischer     virtual void Paint (const Rectangle& rUpdateArea);
69b9e67834SAndre Fischer     virtual void DataChanged (const DataChangedEvent& rEvent);
7022de8995SAndre Fischer 
717a32b0c8SAndre Fischer     void PrintWindowTree (void);
727a32b0c8SAndre Fischer     void PrintWindowTree (const ::std::vector<Panel*>& rPanels);
737a32b0c8SAndre Fischer     static void PrintWindowSubTree (Window* pRoot, int nIndentation);
747a32b0c8SAndre Fischer 
757a32b0c8SAndre Fischer     class ScrollContainerWindow : public Window
767a32b0c8SAndre Fischer     {
777a32b0c8SAndre Fischer     public:
787a32b0c8SAndre Fischer         ScrollContainerWindow (Window* pParentWindow);
797a32b0c8SAndre Fischer         virtual ~ScrollContainerWindow (void);
807a32b0c8SAndre Fischer         virtual void Paint (const Rectangle& rUpdateArea);
817a32b0c8SAndre Fischer         void SetSeparators (const ::std::vector<sal_Int32>& rSeparators);
827a32b0c8SAndre Fischer     private:
837a32b0c8SAndre Fischer         ::std::vector<sal_Int32> maSeparators;
847a32b0c8SAndre Fischer     };
857a32b0c8SAndre Fischer 
8622de8995SAndre Fischer private:
8722de8995SAndre Fischer     const ::rtl::OUString msTitle;
8822de8995SAndre Fischer     const ::rtl::OUString msId;
89ff12d537SAndre Fischer     Image maIcon;
90ff12d537SAndre Fischer     const ::rtl::OUString msIconURL;
91ff12d537SAndre Fischer     const ::rtl::OUString msHighContrastIconURL;
92f120fe41SAndre Fischer     SharedPanelContainer maPanels;
937a32b0c8SAndre Fischer     ::boost::scoped_ptr<DeckTitleBar> mpTitleBar;
947a32b0c8SAndre Fischer     ::boost::scoped_ptr<Window> mpScrollClipWindow;
957a32b0c8SAndre Fischer     ::boost::scoped_ptr<ScrollContainerWindow> mpScrollContainer;
967a32b0c8SAndre Fischer     ::boost::scoped_ptr<Window> mpFiller;
977a32b0c8SAndre Fischer     ::boost::scoped_ptr<ScrollBar> mpVerticalScrollBar;
98ff12d537SAndre Fischer 
997a32b0c8SAndre Fischer     DECL_LINK(HandleVerticalScrollBarChange,void*);
100*4e21436dSAndre Fischer 
101*4e21436dSAndre Fischer 
10222de8995SAndre Fischer };
10322de8995SAndre Fischer 
10422de8995SAndre Fischer 
105ff12d537SAndre Fischer } } // end of namespace sfx2::sidebar
10622de8995SAndre Fischer 
10722de8995SAndre Fischer #endif
108