xref: /trunk/main/sfx2/source/sidebar/Panel.hxx (revision 95a18594)
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_PANEL_HXX
2322de8995SAndre Fischer #define SFX_SIDEBAR_PANEL_HXX
2422de8995SAndre Fischer 
25ff12d537SAndre Fischer #include <vcl/window.hxx>
26ff12d537SAndre Fischer 
2722de8995SAndre Fischer #include <com/sun/star/ui/XUIElement.hpp>
2822de8995SAndre Fischer #include <com/sun/star/ui/XVerticalStackLayoutElement.hpp>
2922de8995SAndre Fischer 
30ff12d537SAndre Fischer #include <boost/function.hpp>
31ff12d537SAndre Fischer 
3222de8995SAndre Fischer namespace css = ::com::sun::star;
3322de8995SAndre Fischer namespace cssu = ::com::sun::star::uno;
3422de8995SAndre Fischer 
35ff12d537SAndre Fischer namespace sfx2 { namespace sidebar {
3622de8995SAndre Fischer 
37ff12d537SAndre Fischer class PanelDescriptor;
3822de8995SAndre Fischer class TitleBar;
3922de8995SAndre Fischer 
4022de8995SAndre Fischer 
4122de8995SAndre Fischer class Panel
4222de8995SAndre Fischer     : public Window
4322de8995SAndre Fischer {
4422de8995SAndre Fischer public:
4522de8995SAndre Fischer     Panel (
46ff12d537SAndre Fischer         const PanelDescriptor& rPanelDescriptor,
47ff12d537SAndre Fischer         Window* pParentWindow,
48ff12d537SAndre Fischer         const ::boost::function<void(void)>& rDeckLayoutTrigger);
4922de8995SAndre Fischer     virtual ~Panel (void);
5022de8995SAndre Fischer 
51ff12d537SAndre Fischer     void Dispose (void);
52ff12d537SAndre Fischer 
5322de8995SAndre Fischer     const ::rtl::OUString& GetLayoutHint (void) const;
5422de8995SAndre Fischer     TitleBar* GetTitleBar (void) const;
5522de8995SAndre Fischer     bool IsTitleBarOptional (void) const;
5622de8995SAndre Fischer     void SetUIElement (const cssu::Reference<css::ui::XUIElement>& rxElement);
57ff12d537SAndre Fischer     cssu::Reference<css::ui::XVerticalStackLayoutElement> GetVerticalStackElement (void) const;
58ff12d537SAndre Fischer     void SetExpanded (const bool bIsExpanded);
59ff12d537SAndre Fischer     bool IsExpanded (void) const;
60*95a18594SAndre Fischer     bool HasIdPredicate (const ::rtl::OUString& rsId) const;
6122de8995SAndre Fischer 
6222de8995SAndre Fischer     virtual void Paint (const Rectangle& rUpdateArea);
63ff12d537SAndre Fischer     virtual void SetPosSizePixel (
64ff12d537SAndre Fischer         long nX,
65ff12d537SAndre Fischer         long nY,
66ff12d537SAndre Fischer         long nWidth,
67ff12d537SAndre Fischer         long nHeight,
68ff12d537SAndre Fischer         sal_uInt16 nFlags = WINDOW_POSSIZE_ALL);
69b9e67834SAndre Fischer     virtual void DataChanged (const DataChangedEvent& rEvent);
70b9e67834SAndre Fischer     virtual void Activate (void);
7122de8995SAndre Fischer 
7222de8995SAndre Fischer private:
73*95a18594SAndre Fischer     const ::rtl::OUString msPanelId;
7422de8995SAndre Fischer     const ::rtl::OUString msLayoutHint;
7522de8995SAndre Fischer     TitleBar* mpTitleBar;
7622de8995SAndre Fischer     const bool mbIsTitleBarOptional;
7722de8995SAndre Fischer     cssu::Reference<css::ui::XUIElement> mxElement;
78ff12d537SAndre Fischer     cssu::Reference<css::awt::XWindow> mxElementWindow;
7922de8995SAndre Fischer     cssu::Reference<css::ui::XVerticalStackLayoutElement> mxVerticalStackLayoutElement;
80ff12d537SAndre Fischer     bool mbIsExpanded;
81ff12d537SAndre Fischer     const ::boost::function<void(void)> maDeckLayoutTrigger;
82b9e67834SAndre Fischer     Rectangle maBoundingBox;
83b9e67834SAndre Fischer 
84b9e67834SAndre Fischer     DECL_LINK(WindowEventHandler, VclWindowEvent*);
8522de8995SAndre Fischer };
8622de8995SAndre Fischer 
87*95a18594SAndre Fischer 
8822de8995SAndre Fischer 
89ff12d537SAndre Fischer } } // end of namespace sfx2::sidebar
9022de8995SAndre Fischer 
9122de8995SAndre Fischer #endif
92