xref: /aoo41x/main/sd/source/ui/sidebar/PanelBase.hxx (revision 02c50d82)
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 SD_SIDEBAR_PANELS_PANEL_BASE_HXX
23 #define SD_SIDEBAR_PANELS_PANEL_BASE_HXX
24 
25 #include "IDisposable.hxx"
26 #include "ISidebarReceiver.hxx"
27 #include <sfx2/sidebar/ILayoutableWindow.hxx>
28 
29 #include <vcl/ctrl.hxx>
30 
31 #include <boost/scoped_ptr.hpp>
32 
33 
34 namespace css = ::com::sun::star;
35 namespace cssu = ::com::sun::star::uno;
36 
37 namespace sd {
38     class ViewShellBase;
39 }
40 
41 
42 
43 
44 namespace sd { namespace sidebar {
45 
46 
47 class PanelBase
48     : public Control,
49       public sfx2::sidebar::ILayoutableWindow,
50       public IDisposable,
51       public ISidebarReceiver
52 {
53 public:
54     PanelBase (
55         ::Window* pParentWindow,
56         ViewShellBase& rViewShellBase);
57     virtual ~PanelBase (void);
58 
59     virtual void Resize (void);
60 
61     // IDisposable
62     virtual void Dispose (void);
63 
64     // ILayoutableWindow
65     virtual css::ui::LayoutSize GetHeightForWidth (const sal_Int32 nWidth);
66 
67     // ISidebarReceiver
68     virtual void SetSidebar (const cssu::Reference<css::ui::XSidebar>& rxSidebar);
69 
70     virtual ::com::sun::star::uno::Reference<
71         ::com::sun::star::accessibility::XAccessible > CreateAccessibleObject (
72             const ::com::sun::star::uno::Reference<
73             ::com::sun::star::accessibility::XAccessible>& rxParent);
74 
75 protected:
76     ::boost::scoped_ptr< ::Window> mpWrappedControl;
77     virtual ::Window* CreateWrappedControl (
78         ::Window* pParentWindow,
79         ViewShellBase& rViewShellBase) = 0;
80 
81 private:
82     cssu::Reference<css::ui::XSidebar> mxSidebar;
83     ViewShellBase& mrViewShellBase;
84 
85     bool ProvideWrappedControl (void);
86 };
87 
88 } } // end of namespace sd::sidebar
89 
90 #endif
91