Version 4.3.0.0.beta1, tag libreoffice-4.3.0.0.beta1
[LibreOffice.git] / include / svx / itemwin.hxx
blob8dc402025340c07d150d7c9aaab18c38026c85d5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_SVX_ITEMWIN_HXX
20 #define INCLUDED_SVX_ITEMWIN_HXX
22 #include <vcl/bitmap.hxx>
24 #include <svx/dlgctrl.hxx>
25 #include <svx/svxdllapi.h>
27 // forward ---------------------------------------------------------------
29 class XLineColorItem;
30 class XLineWidthItem;
31 class SfxObjectShell;
33 // class SvxLineBox ------------------------------------------------------
35 class SvxLineBox : public LineLB
37 sal_uInt16 nCurPos;
38 Timer aDelayTimer;
39 Size aLogicalSize;
40 bool bRelease;
41 SfxObjectShell* mpSh;
42 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
44 DECL_LINK(DelayHdl_Impl, void *);
46 void ReleaseFocus_Impl();
48 public:
49 SvxLineBox( Window* pParent,
50 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
51 WinBits nBits = WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL );
52 virtual ~SvxLineBox();
54 void FillControl();
56 protected:
57 virtual void Select() SAL_OVERRIDE;
58 virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
59 virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
60 virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
64 // class SvxColorBox -----------------------------------------------------
66 class SvxColorBox : public ColorLB
68 using Window::Update;
70 sal_uInt16 nCurPos;
71 Timer aDelayTimer;
72 Size aLogicalSize;
73 bool bRelease;
74 OUString maCommand;
75 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
77 void ReleaseFocus_Impl();
79 public:
80 SvxColorBox( Window* pParent,
81 const OUString& rCommand,
82 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
83 WinBits nBits = WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL );
84 virtual ~SvxColorBox();
86 void Update( const XLineColorItem* pItem );
88 protected:
89 virtual void Select() SAL_OVERRIDE;
90 virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
91 virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
92 virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
96 // class SvxMetricField --------------------------------------------------
98 class SVX_DLLPUBLIC SvxMetricField : public MetricField
100 using Window::Update;
102 OUString aCurTxt;
103 SfxMapUnit ePoolUnit;
104 FieldUnit eDlgUnit;
105 Size aLogicalSize;
106 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
108 void ReleaseFocus_Impl();
110 protected:
111 virtual void Modify() SAL_OVERRIDE;
112 virtual void Down() SAL_OVERRIDE;
113 virtual void Up() SAL_OVERRIDE; // just to be sure
115 virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
116 virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
117 virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
119 public:
120 SvxMetricField( Window* pParent,
121 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
122 WinBits nBits = WB_BORDER | WB_SPIN | WB_REPEAT );
123 virtual ~SvxMetricField();
125 void Update( const XLineWidthItem* pItem );
126 void SetCoreUnit( SfxMapUnit eUnit );
127 void RefreshDlgUnit();
130 // class SvxFillTypeBox --------------------------------------------------
132 class SvxFillTypeBox : public FillTypeLB
134 public:
135 SvxFillTypeBox( Window* pParent, WinBits nBits = WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL );
136 virtual ~SvxFillTypeBox();
138 void Selected() { bSelect = true; }
139 bool IsRelease() { return bRelease;}
141 protected:
142 virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
143 virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
145 private:
146 sal_uInt16 nCurPos;
147 bool bSelect;
148 bool bRelease;
150 void ReleaseFocus_Impl();
153 // class SvxFillAttrBox --------------------------------------------------
155 class SvxFillAttrBox : public FillAttrLB
157 public:
158 SvxFillAttrBox( Window* pParent, WinBits nBits = WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL );
159 virtual ~SvxFillAttrBox();
161 bool IsRelease() { return bRelease;}
163 protected:
164 virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
165 virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
166 virtual void Select() SAL_OVERRIDE;
168 private:
169 sal_uInt16 nCurPos;
170 bool bRelease;
172 void ReleaseFocus_Impl();
175 #endif // INCLUDED_SVX_ITEMWIN_HXX
177 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */