xref: /trunk/main/sd/source/ui/sidebar/PreviewValueSet.hxx (revision 914d351e5f5b84e4342a86d6ab8d4aca7308b9bd)
102c50d82SAndre Fischer /**************************************************************
202c50d82SAndre Fischer  *
302c50d82SAndre Fischer  * Licensed to the Apache Software Foundation (ASF) under one
402c50d82SAndre Fischer  * or more contributor license agreements.  See the NOTICE file
502c50d82SAndre Fischer  * distributed with this work for additional information
602c50d82SAndre Fischer  * regarding copyright ownership.  The ASF licenses this file
702c50d82SAndre Fischer  * to you under the Apache License, Version 2.0 (the
802c50d82SAndre Fischer  * "License"); you may not use this file except in compliance
902c50d82SAndre Fischer  * with the License.  You may obtain a copy of the License at
1002c50d82SAndre Fischer  *
1102c50d82SAndre Fischer  *   http://www.apache.org/licenses/LICENSE-2.0
1202c50d82SAndre Fischer  *
1302c50d82SAndre Fischer  * Unless required by applicable law or agreed to in writing,
1402c50d82SAndre Fischer  * software distributed under the License is distributed on an
1502c50d82SAndre Fischer  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1602c50d82SAndre Fischer  * KIND, either express or implied.  See the License for the
1702c50d82SAndre Fischer  * specific language governing permissions and limitations
1802c50d82SAndre Fischer  * under the License.
1902c50d82SAndre Fischer  *
2002c50d82SAndre Fischer  *************************************************************/
2102c50d82SAndre Fischer 
2202c50d82SAndre Fischer #ifndef SD_SIDEBAR_PANELS_PREVIEW_VALUE_SET_HXX
2302c50d82SAndre Fischer #define SD_SIDEBAR_PANELS_PREVIEW_VALUE_SET_HXX
2402c50d82SAndre Fischer 
2502c50d82SAndre Fischer #include <svtools/valueset.hxx>
2602c50d82SAndre Fischer 
2702c50d82SAndre Fischer 
2802c50d82SAndre Fischer namespace sd { namespace sidebar {
2902c50d82SAndre Fischer 
3002c50d82SAndre Fischer 
31*86e1cf34SPedro Giffuni /** Adapt the svtools valueset to the needs of the master page controls.
3202c50d82SAndre Fischer */
3302c50d82SAndre Fischer class PreviewValueSet
3402c50d82SAndre Fischer     : public ValueSet
3502c50d82SAndre Fischer {
3602c50d82SAndre Fischer public:
3702c50d82SAndre Fischer     PreviewValueSet (::Window* pParent);
3802c50d82SAndre Fischer     ~PreviewValueSet (void);
3902c50d82SAndre Fischer 
4002c50d82SAndre Fischer     void SetRightMouseClickHandler (const Link& rLink);
4102c50d82SAndre Fischer     virtual void Resize (void);
4202c50d82SAndre Fischer 
4302c50d82SAndre Fischer     void SetPreviewSize (const Size& rSize);
4402c50d82SAndre Fischer 
4502c50d82SAndre Fischer     sal_Int32 GetPreferredWidth (sal_Int32 nHeight);
4602c50d82SAndre Fischer     sal_Int32 GetPreferredHeight (sal_Int32 nWidth);
4702c50d82SAndre Fischer 
4802c50d82SAndre Fischer     /** Set the number of rows and columns according to the current number
4902c50d82SAndre Fischer         of items.  Call this method when new items have been inserted.
5002c50d82SAndre Fischer     */
5102c50d82SAndre Fischer     void Rearrange (bool bForceRequestResize = false);
5202c50d82SAndre Fischer 
5302c50d82SAndre Fischer protected:
5402c50d82SAndre Fischer     virtual void MouseButtonDown (const MouseEvent& rEvent);
5502c50d82SAndre Fischer 
5602c50d82SAndre Fischer private:
5702c50d82SAndre Fischer     Link maRightMouseClickHandler;
5802c50d82SAndre Fischer     Size maPreviewSize;
5902c50d82SAndre Fischer     const int mnBorderWidth;
6002c50d82SAndre Fischer     const int mnBorderHeight;
6102c50d82SAndre Fischer     const int mnMaxColumnCount;
6202c50d82SAndre Fischer 
6302c50d82SAndre Fischer     sal_uInt16 CalculateColumnCount (int nWidth) const;
6402c50d82SAndre Fischer     sal_uInt16 CalculateRowCount (sal_uInt16 nColumnCount) const;
6502c50d82SAndre Fischer };
6602c50d82SAndre Fischer 
6702c50d82SAndre Fischer } } // end of namespace sd::sidebar
6802c50d82SAndre Fischer 
6902c50d82SAndre Fischer #endif
70