xref: /aoo42x/main/sfx2/source/sidebar/Deck.hxx (revision 7a32b0c8)
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 
2522de8995SAndre Fischer #include "vcl/window.hxx"
2695a18594SAndre Fischer #include "vcl/image.hxx"
27*7a32b0c8SAndre Fischer #include <com/sun/star/ui/LayoutSize.hpp>
2822de8995SAndre Fischer 
29*7a32b0c8SAndre Fischer #include <boost/function.hpp>
30*7a32b0c8SAndre Fischer #include <boost/scoped_ptr.hpp>
31*7a32b0c8SAndre Fischer 
32*7a32b0c8SAndre Fischer class ScrollBar;
33*7a32b0c8SAndre Fischer 
34*7a32b0c8SAndre Fischer namespace css = ::com::sun::star;
3522de8995SAndre Fischer 
36ff12d537SAndre Fischer namespace sfx2 { namespace sidebar {
3722de8995SAndre Fischer 
3822de8995SAndre Fischer class DeckDescriptor;
39ff12d537SAndre Fischer class Panel;
40*7a32b0c8SAndre Fischer class DeckTitleBar;
4122de8995SAndre Fischer 
4222de8995SAndre Fischer 
4322de8995SAndre Fischer /** This is the parent window of the panels.
4422de8995SAndre Fischer     It displays the deck title.
4522de8995SAndre Fischer */
4622de8995SAndre Fischer class Deck
4722de8995SAndre Fischer     : public Window
4822de8995SAndre Fischer {
4922de8995SAndre Fischer public:
5022de8995SAndre Fischer     Deck (
5122de8995SAndre Fischer         const DeckDescriptor& rDeckDescriptor,
52*7a32b0c8SAndre Fischer         Window* pParentWindow,
53*7a32b0c8SAndre Fischer         const ::boost::function<void(void)>& rCloserAction);
5422de8995SAndre Fischer     virtual ~Deck (void);
5522de8995SAndre Fischer 
56ff12d537SAndre Fischer     void Dispose (void);
57ff12d537SAndre Fischer 
5822de8995SAndre Fischer     const ::rtl::OUString& GetId (void) const;
59*7a32b0c8SAndre Fischer     DeckTitleBar* GetTitleBar (void) const;
60ff12d537SAndre Fischer     Rectangle GetContentArea (void) const;
61ff12d537SAndre Fischer     ::rtl::OUString GetIconURL (const bool bIsHighContrastModeActive) const;
62ff12d537SAndre Fischer     void SetPanels (const ::std::vector<Panel*>& rPanels);
63ff12d537SAndre Fischer     void RequestLayout (void);
64*7a32b0c8SAndre Fischer     ::Window* GetPanelParentWindow (void);
6522de8995SAndre Fischer 
6622de8995SAndre Fischer     virtual void Paint (const Rectangle& rUpdateArea);
67b9e67834SAndre Fischer     virtual void DataChanged (const DataChangedEvent& rEvent);
6822de8995SAndre Fischer 
69*7a32b0c8SAndre Fischer     void PrintWindowTree (void);
70*7a32b0c8SAndre Fischer     void PrintWindowTree (const ::std::vector<Panel*>& rPanels);
71*7a32b0c8SAndre Fischer     static void PrintWindowSubTree (Window* pRoot, int nIndentation);
72*7a32b0c8SAndre Fischer 
73*7a32b0c8SAndre Fischer     class ScrollContainerWindow : public Window
74*7a32b0c8SAndre Fischer     {
75*7a32b0c8SAndre Fischer     public:
76*7a32b0c8SAndre Fischer         ScrollContainerWindow (Window* pParentWindow);
77*7a32b0c8SAndre Fischer         virtual ~ScrollContainerWindow (void);
78*7a32b0c8SAndre Fischer         virtual void Paint (const Rectangle& rUpdateArea);
79*7a32b0c8SAndre Fischer         void SetSeparators (const ::std::vector<sal_Int32>& rSeparators);
80*7a32b0c8SAndre Fischer     private:
81*7a32b0c8SAndre Fischer         ::std::vector<sal_Int32> maSeparators;
82*7a32b0c8SAndre Fischer     };
83*7a32b0c8SAndre Fischer 
8422de8995SAndre Fischer private:
8522de8995SAndre Fischer     const ::rtl::OUString msTitle;
8622de8995SAndre Fischer     const ::rtl::OUString msId;
87ff12d537SAndre Fischer     Image maIcon;
88ff12d537SAndre Fischer     const ::rtl::OUString msIconURL;
89ff12d537SAndre Fischer     const ::rtl::OUString msHighContrastIconURL;
90*7a32b0c8SAndre Fischer     typedef ::std::vector<Panel*> PanelContainer;
91*7a32b0c8SAndre Fischer     PanelContainer maPanels;
92*7a32b0c8SAndre Fischer     ::boost::scoped_ptr<DeckTitleBar> mpTitleBar;
93*7a32b0c8SAndre Fischer     ::boost::scoped_ptr<Window> mpScrollClipWindow;
94*7a32b0c8SAndre Fischer     ::boost::scoped_ptr<ScrollContainerWindow> mpScrollContainer;
95*7a32b0c8SAndre Fischer     ::boost::scoped_ptr<Window> mpFiller;
96*7a32b0c8SAndre Fischer     ::boost::scoped_ptr<ScrollBar> mpVerticalScrollBar;
97ff12d537SAndre Fischer 
98*7a32b0c8SAndre Fischer     DECL_LINK(HandleVerticalScrollBarChange,void*);
9922de8995SAndre Fischer };
10022de8995SAndre Fischer 
10122de8995SAndre Fischer 
102ff12d537SAndre Fischer } } // end of namespace sfx2::sidebar
10322de8995SAndre Fischer 
10422de8995SAndre Fischer #endif
105