bump product version to 5.0.4.1
[LibreOffice.git] / sd / source / ui / sidebar / PreviewValueSet.hxx
blobb48c840add33e67a4dc50b3896ee04a0b96df032
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 INCLUDED_SD_SOURCE_UI_SIDEBAR_PREVIEWVALUESET_HXX
21 #define INCLUDED_SD_SOURCE_UI_SIDEBAR_PREVIEWVALUESET_HXX
23 #include <svtools/valueset.hxx>
25 namespace sd { namespace sidebar {
27 /** Adapt the svtools valueset to the needs of the master page controls.
29 class PreviewValueSet
30 : public ValueSet
32 public:
33 explicit PreviewValueSet (vcl::Window* pParent);
34 virtual ~PreviewValueSet();
36 void SetRightMouseClickHandler (const Link<>& rLink);
37 virtual void Resize() SAL_OVERRIDE;
39 void SetPreviewSize (const Size& rSize);
41 sal_Int32 GetPreferredHeight (sal_Int32 nWidth);
43 /** Set the number of rows and columns according to the current number
44 of items. Call this method when new items have been inserted.
46 void Rearrange (bool bForceRequestResize = false);
48 protected:
49 virtual void MouseButtonDown (const MouseEvent& rEvent) SAL_OVERRIDE;
51 private:
52 Link<> maRightMouseClickHandler;
53 Size maPreviewSize;
54 const int mnBorderWidth;
55 const int mnBorderHeight;
56 const int mnMaxColumnCount;
58 sal_uInt16 CalculateColumnCount (int nWidth) const;
59 sal_uInt16 CalculateRowCount (sal_uInt16 nColumnCount) const;
62 } } // end of namespace sd::sidebar
64 #endif
66 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */