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