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