update credits
[LibreOffice.git] / include / svtools / toolpanel / toolpanel.hxx
blob4c2d0f736ba09037206cf3b5a19043f8c5d283c7
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef SVT_TOOLPANEL_HXX
21 #define SVT_TOOLPANEL_HXX
23 #include "svtools/svtdllapi.h"
24 #include "svtools/toolpanel/refbase.hxx"
26 #include <rtl/ustring.hxx>
27 #include <vcl/image.hxx>
29 #include <boost/noncopyable.hpp>
31 class Rectangle;
32 class Window;
33 namespace com { namespace sun { namespace star { namespace accessibility {
34 class XAccessible;
35 } } } }
37 //........................................................................
38 namespace svt
40 //........................................................................
42 //====================================================================
43 //= IToolPanel
44 //====================================================================
45 /** abstract interface for a single tool panel
47 class SVT_DLLPUBLIC IToolPanel : public ::rtl::IReference
49 public:
50 /// retrieves the display name of the panel
51 virtual OUString GetDisplayName() const = 0;
53 /// retrieves the image associated with the panel, if any
54 virtual Image GetImage() const = 0;
56 /// retrieves the help ID associated with the panel, if any.
57 virtual OString GetHelpID() const = 0;
59 /** activates the panel
61 Usually, this means the panel's Window is created (if not previosly done so) and shown.
63 @param i_rParentWindow
64 the parent window to anchor the panel window at. Subsequent calls to the Activate
65 method will always get the same parent window. The complete area of this window is
66 available, and should be used, for the panel window.
68 virtual void Activate( Window& i_rParentWindow ) = 0;
70 /** deactivates the panel
72 There are different ways how an implementation could deactivate a panel. The easiest way
73 would be to simply hide the associated Window. Alternatively, you could completely destroy it,
74 or decide to cache it by re-parenting it to another (temporary, invisible) window.
76 virtual void Deactivate() = 0;
78 /** sets a new size for the panel's Window
80 The panel window is always expected to be positioned at (0,0), relative to the parent window
81 which was passed to the Activate member. Resizing the panel window is necessary when the size of
82 this parent window changes. Effectively, this method is a means of convenience, to relief panel
83 implementations from reacting on size changes of their parent window themselves.
85 virtual void SetSizePixel( const Size& i_rPanelWindowSize ) = 0;
87 /// sets the focus to the panel window
88 virtual void GrabFocus() = 0;
90 /** release any resources associated with the panel.
92 In particular, implementations should ultimately destroy the VCL window which implements the panel
93 window. No subsequent calls to any other method will happen after Destroy has been called.
95 virtual void Dispose() = 0;
97 /** creates an XAccessible for the tool panel
99 Implementations are allowed to create a new instance each time this method is called, the caller
100 is responsible for caching the XAccessible implementation, if this is desired.
102 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
103 CreatePanelAccessible(
104 const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rParentAccessible
105 ) = 0;
107 virtual ~IToolPanel()
112 typedef ::rtl::Reference< IToolPanel > PToolPanel;
114 //====================================================================
115 //= ToolPanelBase
116 //====================================================================
117 /** base class for tool panel implementations, adding ref count implementation to the IToolPanel interface,
118 but still being abstract
120 class SVT_DLLPUBLIC ToolPanelBase :public IToolPanel
121 ,public RefBase
122 ,public ::boost::noncopyable
124 protected:
125 ToolPanelBase();
126 ~ToolPanelBase();
128 public:
129 DECLARE_IREFERENCE()
132 //........................................................................
133 } // namespace svt
134 //........................................................................
136 #endif // SVT_TOOLPANEL_HXX
138 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */