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 : DECL_LINK(DelayHdl_Impl, void *);
45 :
46 : void ReleaseFocus_Impl();
47 :
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 : ~SvxLineBox();
53 :
54 : void FillControl();
55 :
56 : protected:
57 : virtual void Select();
58 : virtual long PreNotify( NotifyEvent& rNEvt );
59 : virtual long Notify( NotifyEvent& rNEvt );
60 : virtual void DataChanged( const DataChangedEvent& rDCEvt );
61 :
62 : };
63 :
64 : // class SvxColorBox -----------------------------------------------------
65 :
66 : class SvxColorBox : public ColorLB
67 : {
68 : using Window::Update;
69 :
70 : sal_uInt16 nCurPos;
71 : Timer aDelayTimer;
72 : Size aLogicalSize;
73 : sal_Bool bRelease;
74 : OUString maCommand;
75 : ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
76 :
77 : void ReleaseFocus_Impl();
78 :
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 : ~SvxColorBox();
85 :
86 : void Update( const XLineColorItem* pItem );
87 :
88 : protected:
89 : virtual void Select();
90 : virtual long PreNotify( NotifyEvent& rNEvt );
91 : virtual long Notify( NotifyEvent& rNEvt );
92 : virtual void DataChanged( const DataChangedEvent& rDCEvt );
93 :
94 : };
95 :
96 : // class SvxMetricField --------------------------------------------------
97 :
98 : class SVX_DLLPUBLIC SvxMetricField : public MetricField
99 : {
100 : using Window::Update;
101 :
102 : String aCurTxt;
103 : SfxMapUnit ePoolUnit;
104 : FieldUnit eDlgUnit;
105 : Size aLogicalSize;
106 : ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
107 :
108 : void ReleaseFocus_Impl();
109 :
110 : protected:
111 : virtual void Modify();
112 : virtual void Down();
113 : virtual void Up(); // just to be sure
114 :
115 : virtual long PreNotify( NotifyEvent& rNEvt );
116 : virtual long Notify( NotifyEvent& rNEvt );
117 : virtual void DataChanged( const DataChangedEvent& rDCEvt );
118 :
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 : ~SvxMetricField();
124 :
125 : void Update( const XLineWidthItem* pItem );
126 : void SetCoreUnit( SfxMapUnit eUnit );
127 : void RefreshDlgUnit();
128 : };
129 :
130 : // class SvxFillTypeBox --------------------------------------------------
131 :
132 : class SvxFillTypeBox : public FillTypeLB
133 : {
134 : public:
135 : SvxFillTypeBox( Window* pParent, WinBits nBits = WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL );
136 : ~SvxFillTypeBox();
137 :
138 0 : void Selected() { bSelect = sal_True; }
139 0 : sal_Bool IsRelease() { return bRelease;}
140 :
141 : protected:
142 : virtual long PreNotify( NotifyEvent& rNEvt );
143 : virtual long Notify( NotifyEvent& rNEvt );
144 :
145 : private:
146 : sal_uInt16 nCurPos;
147 : sal_Bool bSelect;
148 : sal_Bool bRelease;
149 :
150 : void ReleaseFocus_Impl();
151 : };
152 :
153 : // class SvxFillAttrBox --------------------------------------------------
154 :
155 : class SvxFillAttrBox : public FillAttrLB
156 : {
157 : public:
158 : SvxFillAttrBox( Window* pParent, WinBits nBits = WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL );
159 : ~SvxFillAttrBox();
160 :
161 0 : sal_Bool IsRelease() { return bRelease;}
162 :
163 : protected:
164 : virtual long PreNotify( NotifyEvent& rNEvt );
165 : virtual long Notify( NotifyEvent& rNEvt );
166 : virtual void Select();
167 :
168 : private:
169 : sal_uInt16 nCurPos;
170 : sal_Bool bRelease;
171 :
172 : void ReleaseFocus_Impl();
173 : };
174 :
175 : #endif // #ifndef _SVX_ITEMWIN_HXX
176 :
177 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|