xref: /AOO41X/main/svx/source/sidebar/ColorPanel.hxx (revision ca62e2c2083b5d0995f1245bad6c2edfb455fbec)
1*2d839242SAndre Fischer /**************************************************************
2*2d839242SAndre Fischer  *
3*2d839242SAndre Fischer  * Licensed to the Apache Software Foundation (ASF) under one
4*2d839242SAndre Fischer  * or more contributor license agreements.  See the NOTICE file
5*2d839242SAndre Fischer  * distributed with this work for additional information
6*2d839242SAndre Fischer  * regarding copyright ownership.  The ASF licenses this file
7*2d839242SAndre Fischer  * to you under the Apache License, Version 2.0 (the
8*2d839242SAndre Fischer  * "License"); you may not use this file except in compliance
9*2d839242SAndre Fischer  * with the License.  You may obtain a copy of the License at
10*2d839242SAndre Fischer  *
11*2d839242SAndre Fischer  *   http://www.apache.org/licenses/LICENSE-2.0
12*2d839242SAndre Fischer  *
13*2d839242SAndre Fischer  * Unless required by applicable law or agreed to in writing,
14*2d839242SAndre Fischer  * software distributed under the License is distributed on an
15*2d839242SAndre Fischer  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*2d839242SAndre Fischer  * KIND, either express or implied.  See the License for the
17*2d839242SAndre Fischer  * specific language governing permissions and limitations
18*2d839242SAndre Fischer  * under the License.
19*2d839242SAndre Fischer  *
20*2d839242SAndre Fischer  *************************************************************/
21*2d839242SAndre Fischer 
22*2d839242SAndre Fischer #ifndef SVX_SIDEBAR_COLOR_PANEL_HXX
23*2d839242SAndre Fischer #define SVX_SIDEBAR_COLOR_PANEL_HXX
24*2d839242SAndre Fischer 
25*2d839242SAndre Fischer #include <svtools/valueset.hxx>
26*2d839242SAndre Fischer #include <vcl/window.hxx>
27*2d839242SAndre Fischer 
28*2d839242SAndre Fischer 
29*2d839242SAndre Fischer namespace svx { namespace sidebar {
30*2d839242SAndre Fischer 
31*2d839242SAndre Fischer 
32*2d839242SAndre Fischer /** This demo panel shows the colors that are available from the
33*2d839242SAndre Fischer     StyleSettings.
34*2d839242SAndre Fischer */
35*2d839242SAndre Fischer class ColorPanel
36*2d839242SAndre Fischer     : public ValueSet
37*2d839242SAndre Fischer {
38*2d839242SAndre Fischer public:
39*2d839242SAndre Fischer     ColorPanel (::Window* pParent);
40*2d839242SAndre Fischer     virtual ~ColorPanel (void);
41*2d839242SAndre Fischer 
42*2d839242SAndre Fischer     // From ::Window
43*2d839242SAndre Fischer     virtual void Resize (void);
44*2d839242SAndre Fischer     virtual void DataChanged (const DataChangedEvent& rEvent);
45*2d839242SAndre Fischer 
46*2d839242SAndre Fischer private:
47*2d839242SAndre Fischer     int mnPreferredColumnCount;
48*2d839242SAndre Fischer 
49*2d839242SAndre Fischer     /** Depending on the given number of columns and the item size
50*2d839242SAndre Fischer         calculate the number of rows that are necessary to display all
51*2d839242SAndre Fischer         items.
52*2d839242SAndre Fischer     */
53*2d839242SAndre Fischer     int CalculateRowCount (const Size& rItemSize, int nColumnCount);
54*2d839242SAndre Fischer     void Fill (void);
55*2d839242SAndre Fischer 
56*2d839242SAndre Fischer     sal_Int32 GetPreferredHeight (sal_Int32 nWidth);
57*2d839242SAndre Fischer };
58*2d839242SAndre Fischer 
59*2d839242SAndre Fischer } } // end of namespace ::svx::sidebar
60*2d839242SAndre Fischer 
61*2d839242SAndre Fischer #endif
62