Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 : #ifndef _SVX_ITEMWIN_HXX
20 : #define _SVX_ITEMWIN_HXX
21 :
22 : #include <vcl/bitmap.hxx>
23 :
24 : #include <svx/dlgctrl.hxx>
25 : #include "svx/svxdllapi.h"
26 :
27 : // forward ---------------------------------------------------------------
28 :
29 : class XLineColorItem;
30 : class XLineWidthItem;
31 : class SfxObjectShell;
32 :
33 : // class SvxLineBox ------------------------------------------------------
34 :
35 : class SvxLineBox : public LineLB
36 : {
37 : sal_uInt16 nCurPos;
38 : Timer aDelayTimer;
39 : Size aLogicalSize;
40 : sal_Bool bRelease;
41 : SfxObjectShell* mpSh;
42 : ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
43 :
44 : #ifdef _SVX_ITEMWIN_CXX
45 : DECL_LINK(DelayHdl_Impl, void *);
46 :
47 : void ReleaseFocus_Impl();
48 : #endif
49 : public:
50 : SvxLineBox( Window* pParent,
51 : const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
52 : WinBits nBits = WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL );
53 : ~SvxLineBox();
54 :
55 : void FillControl();
56 :
57 : protected:
58 : virtual void Select();
59 : virtual long PreNotify( NotifyEvent& rNEvt );
60 : virtual long Notify( NotifyEvent& rNEvt );
61 : virtual void DataChanged( const DataChangedEvent& rDCEvt );
62 :
63 : };
64 :
65 : // class SvxColorBox -----------------------------------------------------
66 :
67 : class SvxColorBox : public ColorLB
68 : {
69 : using Window::Update;
70 :
71 : sal_uInt16 nCurPos;
72 : Timer aDelayTimer;
73 : Size aLogicalSize;
74 : sal_Bool bRelease;
75 : ::rtl::OUString maCommand;
76 : ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
77 :
78 : #ifdef _SVX_ITEMWIN_CXX
79 : void ReleaseFocus_Impl();
80 : #endif
81 :
82 : public:
83 : SvxColorBox( Window* pParent,
84 : const rtl::OUString& rCommand,
85 : const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
86 : WinBits nBits = WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL );
87 : ~SvxColorBox();
88 :
89 : void Update( const XLineColorItem* pItem );
90 :
91 : protected:
92 : virtual void Select();
93 : virtual long PreNotify( NotifyEvent& rNEvt );
94 : virtual long Notify( NotifyEvent& rNEvt );
95 : virtual void DataChanged( const DataChangedEvent& rDCEvt );
96 :
97 : };
98 :
99 : // class SvxMetricField --------------------------------------------------
100 :
101 : class SVX_DLLPUBLIC SvxMetricField : public MetricField
102 : {
103 : using Window::Update;
104 :
105 : String aCurTxt;
106 : SfxMapUnit ePoolUnit;
107 : FieldUnit eDlgUnit;
108 : Size aLogicalSize;
109 : ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
110 :
111 : #ifdef _SVX_ITEMWIN_CXX
112 : void ReleaseFocus_Impl();
113 : #endif
114 :
115 : protected:
116 : virtual void Modify();
117 : virtual void Down();
118 : virtual void Up(); // just to be sure
119 :
120 : virtual long PreNotify( NotifyEvent& rNEvt );
121 : virtual long Notify( NotifyEvent& rNEvt );
122 : virtual void DataChanged( const DataChangedEvent& rDCEvt );
123 :
124 : public:
125 : SvxMetricField( Window* pParent,
126 : const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
127 : WinBits nBits = WB_BORDER | WB_SPIN | WB_REPEAT );
128 : ~SvxMetricField();
129 :
130 : void Update( const XLineWidthItem* pItem );
131 : void SetCoreUnit( SfxMapUnit eUnit );
132 : void RefreshDlgUnit();
133 : };
134 :
135 : // class SvxFillTypeBox --------------------------------------------------
136 :
137 : class SvxFillTypeBox : public FillTypeLB
138 : {
139 : public:
140 : SvxFillTypeBox( Window* pParent, WinBits nBits = WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL );
141 : ~SvxFillTypeBox();
142 :
143 0 : void Selected() { bSelect = sal_True; }
144 0 : sal_Bool IsRelease() { return bRelease;}
145 :
146 : protected:
147 : virtual long PreNotify( NotifyEvent& rNEvt );
148 : virtual long Notify( NotifyEvent& rNEvt );
149 :
150 : private:
151 : sal_uInt16 nCurPos;
152 : sal_Bool bSelect;
153 : sal_Bool bRelease;
154 :
155 : #ifdef _SVX_ITEMWIN_CXX
156 : void ReleaseFocus_Impl();
157 : #endif
158 : };
159 :
160 : // class SvxFillAttrBox --------------------------------------------------
161 :
162 : class SvxFillAttrBox : public FillAttrLB
163 : {
164 : public:
165 : SvxFillAttrBox( Window* pParent, WinBits nBits = WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL );
166 : ~SvxFillAttrBox();
167 :
168 0 : sal_Bool IsRelease() { return bRelease;}
169 :
170 : protected:
171 : virtual long PreNotify( NotifyEvent& rNEvt );
172 : virtual long Notify( NotifyEvent& rNEvt );
173 : virtual void Select();
174 :
175 : private:
176 : sal_uInt16 nCurPos;
177 : sal_Bool bRelease;
178 :
179 : #ifdef _SVX_ITEMWIN_CXX
180 : void ReleaseFocus_Impl();
181 : #endif
182 : };
183 :
184 : #endif // #ifndef _SVX_ITEMWIN_HXX
185 :
186 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|