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