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