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 
23 
24 #ifndef SVX_PROPERTYPANEL_GRAPHICPAGE_HXX
25 #define SVX_PROPERTYPANEL_GRAPHICPAGE_HXX
26 
27 #include <vcl/ctrl.hxx>
28 #include <sfx2/sidebar/SidebarPanelBase.hxx>
29 #include <sfx2/sidebar/ControllerItem.hxx>
30 #include <sfx2/sidebar/GridLayouter.hxx>
31 #include <vcl/fixed.hxx>
32 #include <boost/scoped_ptr.hpp>
33 
34 class FixedText;
35 class MetricField;
36 class ListBox;
37 class FloatingWindow;
38 
39 
40 namespace svx { namespace sidebar {
41 
42 class GraphicPropertyPanel
43 :   public Control,
44     public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
45 {
46 public:
47     static GraphicPropertyPanel* Create(
48         Window* pParent,
49         const cssu::Reference<css::frame::XFrame>& rxFrame,
50         SfxBindings* pBindings);
51 
52     virtual void DataChanged(
53         const DataChangedEvent& rEvent);
54 
55     virtual void NotifyItemUpdate(
56         const sal_uInt16 nSId,
57         const SfxItemState eState,
58         const SfxPoolItem* pState,
59         const bool bIsEnabled);
60 
61     SfxBindings* GetBindings();
62 
63     virtual void Resize (void);
64 
65 private:
66     //ui controls
67     ::boost::scoped_ptr< FixedText >                    mpFtBrightness;
68     ::boost::scoped_ptr< MetricField >                  mpMtrBrightness;
69     ::boost::scoped_ptr< FixedText >                    mpFtContrast;
70     ::boost::scoped_ptr< MetricField >                  mpMtrContrast;
71     ::boost::scoped_ptr< FixedText >                    mpFtColorMode;
72     ::boost::scoped_ptr< ListBox >                      mpLBColorMode;
73     ::boost::scoped_ptr< FixedText >                    mpFtTrans;
74     ::boost::scoped_ptr< MetricField >                  mpMtrTrans;
75     ::boost::scoped_ptr< MetricField >                  mpMtrRed;
76     ::boost::scoped_ptr< MetricField >                  mpMtrGreen;
77     ::boost::scoped_ptr< MetricField >                  mpMtrBlue;
78     ::boost::scoped_ptr< MetricField >                  mpMtrGamma;
79 
80     ::sfx2::sidebar::ControllerItem                     maBrightControl;
81     ::sfx2::sidebar::ControllerItem                     maContrastControl;
82     ::sfx2::sidebar::ControllerItem                     maTransparenceControl;
83     ::sfx2::sidebar::ControllerItem                     maRedControl;
84     ::sfx2::sidebar::ControllerItem                     maGreenControl;
85     ::sfx2::sidebar::ControllerItem                     maBlueControl;
86     ::sfx2::sidebar::ControllerItem                     maGammaControl;
87     ::sfx2::sidebar::ControllerItem                     maModeControl;
88 
89     Image                                               maImgNormal;
90     Image                                               maImgBW;
91     Image                                               maImgGray;
92     Image                                               maImgWater;
93 
94     FixedImage                                          maImgRed;
95     FixedImage                                          maImgGreen;
96     FixedImage                                          maImgBlue;
97     FixedImage                                          maImgGamma;
98 
99     String                                              msNormal;
100     String                                              msBW;
101     String                                              msGray;
102     String                                              msWater;
103 
104     cssu::Reference<css::frame::XFrame>                 mxFrame;
105     SfxBindings*                                        mpBindings;
106     ::sfx2::sidebar::GridLayouter maLayouter;
107 
108     DECL_LINK( ModifyBrightnessHdl, void * );
109     DECL_LINK( ModifyContrastHdl, void * );
110     DECL_LINK( ModifyTransHdl, void * );
111     DECL_LINK( ClickColorModeHdl, ToolBox * );
112     DECL_LINK( ImplPopupModeEndHdl, FloatingWindow* );
113     DECL_LINK( RedHdl, void*);
114     DECL_LINK( GreenHdl, void*);
115     DECL_LINK( BlueHdl, void*);
116     DECL_LINK( GammaHdl, void*);
117 
118     // constructor/destructor
119     GraphicPropertyPanel(
120         Window* pParent,
121         const cssu::Reference<css::frame::XFrame>& rxFrame,
122         SfxBindings* pBindings);
123     virtual ~GraphicPropertyPanel();
124 
125     void SetupIcons(void);
126     void Initialize();
127 };
128 
129 
130 } } // end of namespace ::svx::sidebar
131 
132 #endif
133 
134 // eof
135