xref: /aoo42x/main/sfx2/source/sidebar/Deck.hxx (revision 52d13b84)
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);
67*52d13b84SAndre Fischer 
68*52d13b84SAndre Fischer     /** Try to make the panel completely visible.
69*52d13b84SAndre Fischer         When the whole panel does not fit then make its top visible
70*52d13b84SAndre Fischer         and it off at the bottom.
71*52d13b84SAndre Fischer     */
72*52d13b84SAndre Fischer     void ShowPanel (const Panel& rPanel);
73*52d13b84SAndre Fischer 
7422de8995SAndre Fischer     virtual void Paint (const Rectangle& rUpdateArea);
75b9e67834SAndre Fischer     virtual void DataChanged (const DataChangedEvent& rEvent);
7622de8995SAndre Fischer 
777a32b0c8SAndre Fischer     void PrintWindowTree (void);
787a32b0c8SAndre Fischer     void PrintWindowTree (const ::std::vector<Panel*>& rPanels);
797a32b0c8SAndre Fischer     static void PrintWindowSubTree (Window* pRoot, int nIndentation);
807a32b0c8SAndre Fischer 
817a32b0c8SAndre Fischer     class ScrollContainerWindow : public Window
827a32b0c8SAndre Fischer     {
837a32b0c8SAndre Fischer     public:
847a32b0c8SAndre Fischer         ScrollContainerWindow (Window* pParentWindow);
857a32b0c8SAndre Fischer         virtual ~ScrollContainerWindow (void);
867a32b0c8SAndre Fischer         virtual void Paint (const Rectangle& rUpdateArea);
877a32b0c8SAndre Fischer         void SetSeparators (const ::std::vector<sal_Int32>& rSeparators);
887a32b0c8SAndre Fischer     private:
897a32b0c8SAndre Fischer         ::std::vector<sal_Int32> maSeparators;
907a32b0c8SAndre Fischer     };
917a32b0c8SAndre Fischer 
9222de8995SAndre Fischer private:
9322de8995SAndre Fischer     const ::rtl::OUString msTitle;
9422de8995SAndre Fischer     const ::rtl::OUString msId;
95ff12d537SAndre Fischer     Image maIcon;
96ff12d537SAndre Fischer     const ::rtl::OUString msIconURL;
97ff12d537SAndre Fischer     const ::rtl::OUString msHighContrastIconURL;
98f120fe41SAndre Fischer     SharedPanelContainer maPanels;
997a32b0c8SAndre Fischer     ::boost::scoped_ptr<DeckTitleBar> mpTitleBar;
1007a32b0c8SAndre Fischer     ::boost::scoped_ptr<Window> mpScrollClipWindow;
1017a32b0c8SAndre Fischer     ::boost::scoped_ptr<ScrollContainerWindow> mpScrollContainer;
1027a32b0c8SAndre Fischer     ::boost::scoped_ptr<Window> mpFiller;
1037a32b0c8SAndre Fischer     ::boost::scoped_ptr<ScrollBar> mpVerticalScrollBar;
104ff12d537SAndre Fischer 
1057a32b0c8SAndre Fischer     DECL_LINK(HandleVerticalScrollBarChange,void*);
1064e21436dSAndre Fischer 
1074e21436dSAndre Fischer 
10822de8995SAndre Fischer };
10922de8995SAndre Fischer 
11022de8995SAndre Fischer 
111ff12d537SAndre Fischer } } // end of namespace sfx2::sidebar
11222de8995SAndre Fischer 
11322de8995SAndre Fischer #endif
114